ariadne_view_components 0.0.4 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/assets/javascripts/ariadne-form-with.d.ts +20 -0
  4. data/app/assets/javascripts/ariadne-form.d.ts +22 -0
  5. data/app/assets/javascripts/ariadne.d.ts +1 -0
  6. data/app/assets/javascripts/ariadne_view_components.js +7 -1
  7. data/app/assets/javascripts/ariadne_view_components.js.map +1 -1
  8. data/app/assets/javascripts/clipboard-copy-component.d.ts +4 -0
  9. data/app/assets/javascripts/comment-component.d.ts +13 -0
  10. data/app/assets/javascripts/rich-text-area-component.d.ts +4 -0
  11. data/app/assets/javascripts/slideover-component.d.ts +9 -0
  12. data/app/assets/javascripts/time-ago-component.d.ts +1 -0
  13. data/app/assets/javascripts/time_ago_component.d.ts +1 -0
  14. data/app/assets/javascripts/tooltip-component.d.ts +24 -0
  15. data/app/assets/stylesheets/application.ariadne_view_components.css +6 -3
  16. data/app/assets/stylesheets/prosemirror.css +323 -0
  17. data/app/assets/stylesheets/tooltip-component.css +37 -0
  18. data/app/components/ariadne/ariadne-form.ts +96 -0
  19. data/app/components/ariadne/ariadne.ts +11 -1
  20. data/app/components/ariadne/base_button.rb +12 -12
  21. data/app/components/ariadne/base_component.rb +13 -131
  22. data/app/components/ariadne/blankslate_component.html.erb +5 -5
  23. data/app/components/ariadne/blankslate_component.rb +5 -10
  24. data/app/components/ariadne/body_component.rb +30 -0
  25. data/app/components/ariadne/button_component.rb +12 -16
  26. data/app/components/ariadne/clipboard_copy_component.html.erb +5 -4
  27. data/app/components/ariadne/clipboard_copy_component.rb +41 -3
  28. data/app/components/ariadne/comment-component.ts +55 -0
  29. data/app/components/ariadne/comment_component.html.erb +22 -0
  30. data/app/components/ariadne/comment_component.rb +57 -0
  31. data/app/components/ariadne/component.rb +4 -3
  32. data/app/components/ariadne/container_component.rb +1 -1
  33. data/app/components/ariadne/counter_component.rb +4 -4
  34. data/app/components/ariadne/flash_component.html.erb +12 -12
  35. data/app/components/ariadne/flash_component.rb +17 -17
  36. data/app/components/ariadne/flex_component.rb +49 -0
  37. data/app/components/ariadne/footer_component.html.erb +1 -1
  38. data/app/components/ariadne/footer_component.rb +1 -1
  39. data/app/components/ariadne/grid_component.html.erb +13 -4
  40. data/app/components/ariadne/grid_component.rb +22 -11
  41. data/app/components/ariadne/header_component.html.erb +7 -7
  42. data/app/components/ariadne/header_component.rb +8 -8
  43. data/app/components/ariadne/heading_component.rb +3 -3
  44. data/app/components/ariadne/heroicon_component.html.erb +4 -6
  45. data/app/components/ariadne/heroicon_component.rb +21 -10
  46. data/app/components/ariadne/inline_flex_component.rb +14 -12
  47. data/app/components/ariadne/link_component.rb +13 -8
  48. data/app/components/ariadne/list_component.html.erb +5 -7
  49. data/app/components/ariadne/list_component.rb +9 -38
  50. data/app/components/ariadne/main_component.rb +32 -0
  51. data/app/components/ariadne/narrow_container_component.html.erb +3 -0
  52. data/app/components/ariadne/narrow_container_component.rb +30 -0
  53. data/app/components/ariadne/panel_bar_component.html.erb +20 -0
  54. data/app/components/ariadne/panel_bar_component.rb +79 -0
  55. data/app/components/ariadne/pill_component.rb +2 -2
  56. data/app/components/ariadne/rich-text-area-component.ts +32 -0
  57. data/app/components/ariadne/rich_text_area_component.html.erb +6 -0
  58. data/app/components/ariadne/rich_text_area_component.rb +35 -0
  59. data/app/components/ariadne/slideover-component.ts +3 -3
  60. data/app/components/ariadne/slideover_component.html.erb +3 -6
  61. data/app/components/ariadne/slideover_component.rb +19 -15
  62. data/app/components/ariadne/tab_bar_component.html.erb +3 -0
  63. data/app/components/ariadne/tab_bar_component.rb +45 -0
  64. data/app/components/ariadne/tab_component.html.erb +7 -0
  65. data/app/components/ariadne/tab_component.rb +43 -0
  66. data/app/components/ariadne/{time_ago_component.ts → time-ago-component.ts} +0 -0
  67. data/app/components/ariadne/time_ago_component.rb +2 -2
  68. data/app/components/ariadne/timeline_component.html.erb +6 -6
  69. data/app/components/ariadne/tooltip-component.ts +57 -0
  70. data/app/components/ariadne/tooltip_component.html.erb +4 -0
  71. data/app/components/ariadne/tooltip_component.rb +34 -31
  72. data/app/lib/ariadne/action_view_extensions/form_helper.rb +4 -1
  73. data/app/lib/ariadne/fetch_or_fallback_helper.rb +3 -1
  74. data/app/lib/ariadne/form_builder.rb +22 -22
  75. data/app/lib/ariadne/icon_helper.rb +1 -1
  76. data/lib/ariadne/view_components/engine.rb +171 -3
  77. data/lib/ariadne/view_components/version.rb +1 -1
  78. data/lib/ariadne/view_components.rb +31 -30
  79. data/lib/rubocop/config/default.yml +0 -6
  80. data/lib/rubocop/cop/ariadne/no_tag_memoize.rb +1 -0
  81. data/lib/tasks/docs.rake +9 -0
  82. data/static/arguments.yml +186 -15
  83. data/static/audited_at.json +12 -2
  84. data/static/classes.yml +200 -154
  85. data/static/constants.json +168 -146
  86. data/static/statuses.json +12 -2
  87. metadata +65 -13
  88. data/lib/ariadne/classify/utilities.rb +0 -199
  89. data/lib/ariadne/classify/utilities.yml +0 -1817
  90. data/lib/ariadne/classify/validation.rb +0 -18
  91. data/lib/ariadne/classify.rb +0 -218
  92. data/lib/rubocop/cop/ariadne/ariadne_heroicon.rb +0 -252
  93. data/lib/rubocop/cop/ariadne/component_name_migration.rb +0 -35
  94. data/lib/rubocop/cop/ariadne/system_argument_instead_of_class.rb +0 -57
  95. data/lib/tasks/utilities.rake +0 -121
data/static/arguments.yml CHANGED
@@ -12,8 +12,8 @@
12
12
  description: One of `:button`, `:reset`, or `:submit`.
13
13
  - name: size
14
14
  type: Symbol
15
- default: "`:m`"
16
- description: One of `:l`, `:m`, `:s`, `:xl`, or `:xs`.
15
+ default: "`:md`"
16
+ description: One of `:lg`, `:md`, `:sm`, `:xl`, or `:xs`.
17
17
  - name: classes
18
18
  type: String
19
19
  default: '`""`'
@@ -37,6 +37,17 @@
37
37
  type: Hash
38
38
  default: "`{}`"
39
39
  description: "[Classes and attributes](/classes-attributes)"
40
+ - component: Body
41
+ source: https://github.com/yettoapp/ariadne/ruby/view_components/tree/main/app/components/ariadne/body_component.rb
42
+ parameters:
43
+ - name: classes
44
+ type: String
45
+ default: '`""`'
46
+ description: "[Classes and attributes](/classes-attributes)"
47
+ - name: attributes
48
+ type: Hash
49
+ default: "`{}`"
50
+ description: "[Classes and attributes](/classes-attributes)"
40
51
  - component: Button
41
52
  source: https://github.com/yettoapp/ariadne/ruby/view_components/tree/main/app/components/ariadne/button_component.rb
42
53
  parameters:
@@ -51,11 +62,11 @@
51
62
  - name: scheme
52
63
  type: Symbol
53
64
  default: "`:default`"
54
- description: One of `:danger`, `:default`, `:info`, `:success`, or `:warning`.
65
+ description: One of `:danger`, `:default`, `:info`, `:none`, `:success`, or `:warning`.
55
66
  - name: size
56
67
  type: Symbol
57
68
  default: "`BaseButton::DEFAULT_SIZE`"
58
- description: One of `:l`, `:m`, `:s`, `:xl`, or `:xs`.
69
+ description: One of `:lg`, `:md`, `:sm`, `:xl`, or `:xs`.
59
70
  - name: type
60
71
  type: Symbol
61
72
  default: "`:button`"
@@ -83,6 +94,10 @@
83
94
  type: String
84
95
  default: '`""`'
85
96
  description: Text to copy into the users clipboard when they click the component.
97
+ - name: for_id
98
+ type: String
99
+ default: "`nil`"
100
+ description: If `value` is not provided, the element with this id will be copied.
86
101
  - name: aria_label
87
102
  type: String
88
103
  default: '`""`'
@@ -92,6 +107,29 @@
92
107
  type: Hash
93
108
  default: "`{}`"
94
109
  description: "[Classes and attributes](/classes-attributes)"
110
+ - component: Comment
111
+ source: https://github.com/yettoapp/ariadne/ruby/view_components/tree/main/app/components/ariadne/comment_component.rb
112
+ parameters:
113
+ - name: url
114
+ type: String
115
+ default: N/A
116
+ description: The URL to take action against.
117
+ - name: method
118
+ type: String
119
+ default: N/A
120
+ description: The method to use when submitting the form.
121
+ - name: sr_label
122
+ type: String
123
+ default: N/A
124
+ description: A label to introduce these tabs for screen readers.
125
+ - name: classes
126
+ type: String
127
+ default: '`""`'
128
+ description: "[Classes and attributes](/classes-attributes)"
129
+ - name: attributes
130
+ type: Hash
131
+ default: "`{}`"
132
+ description: "[Classes and attributes](/classes-attributes)"
95
133
  - component: Container
96
134
  source: https://github.com/yettoapp/ariadne/ruby/view_components/tree/main/app/components/ariadne/container_component.rb
97
135
  parameters:
@@ -167,6 +205,25 @@
167
205
  type: Hash
168
206
  default: "`{}`"
169
207
  description: "[Classes and attributes](/classes-attributes)"
208
+ - component: Flex
209
+ source: https://github.com/yettoapp/ariadne/ruby/view_components/tree/main/app/components/ariadne/flex_component.rb
210
+ parameters:
211
+ - name: tag
212
+ type: Symbol, String
213
+ default: "`:div`"
214
+ description: The rendered tag name.
215
+ - name: type
216
+ type: Symbol
217
+ default: N/A
218
+ description: One of `:column`, `:column_reverse`, `:row`, or `:row_reverse`.
219
+ - name: classes
220
+ type: String
221
+ default: '`""`'
222
+ description: "[Classes and attributes](/classes-attributes)"
223
+ - name: attributes
224
+ type: Hash
225
+ default: "`{}`"
226
+ description: "[Classes and attributes](/classes-attributes)"
170
227
  - component: Footer
171
228
  source: https://github.com/yettoapp/ariadne/ruby/view_components/tree/main/app/components/ariadne/footer_component.rb
172
229
  parameters:
@@ -233,15 +290,23 @@
233
290
  - name: variant
234
291
  type: String
235
292
  default: N/A
236
- description: One of `outline` and `solid`.
293
+ description: One of `outline`, `solid`, or `mini`.
237
294
  - name: size
238
295
  type: Symbol
239
- default: "`:s`"
240
- description: One of `:s` (`16`) and `:m` (`24`).
296
+ default: "`:sm`"
297
+ description: One of `:sm` (`16`), `:md` (`24`), or `:lg` (`128`).
241
298
  - name: attributes
242
299
  type: Hash
243
300
  default: "`{}`"
244
301
  description: "[Classes and attributes](/classes-attributes)"
302
+ - name: text_classes
303
+ type: String
304
+ default: '`""`'
305
+ description: "[Classes and attributes](/classes-attributes)"
306
+ - name: text_attributes
307
+ type: Hash
308
+ default: "`{}`"
309
+ description: "[Classes and attributes](/classes-attributes)"
245
310
  - component: Image
246
311
  source: https://github.com/yettoapp/ariadne/ruby/view_components/tree/main/app/components/ariadne/image_component.rb
247
312
  parameters:
@@ -295,6 +360,10 @@
295
360
  type: String
296
361
  default: N/A
297
362
  description: URL to be used for the link.
363
+ - name: actionable
364
+ type: Boolean
365
+ default: "`false`"
366
+ description: If true, adds additional classes to the link to make it more aware.
298
367
  - name: classes
299
368
  type: String
300
369
  default: '`""`'
@@ -314,6 +383,43 @@
314
383
  type: Hash
315
384
  default: "`{}`"
316
385
  description: "[Classes and attributes](/classes-attributes)"
386
+ - component: Main
387
+ source: https://github.com/yettoapp/ariadne/ruby/view_components/tree/main/app/components/ariadne/main_component.rb
388
+ parameters:
389
+ - name: classes
390
+ type: String
391
+ default: '`""`'
392
+ description: "[Classes and attributes](/classes-attributes)"
393
+ - name: attributes
394
+ type: Hash
395
+ default: "`{}`"
396
+ description: "[Classes and attributes](/classes-attributes)"
397
+ - component: NarrowContainer
398
+ source: https://github.com/yettoapp/ariadne/ruby/view_components/tree/main/app/components/ariadne/narrow_container_component.rb
399
+ parameters:
400
+ - name: classes
401
+ type: String
402
+ default: '`""`'
403
+ description: "[Classes and attributes](/classes-attributes)"
404
+ - name: attributes
405
+ type: Hash
406
+ default: "`{}`"
407
+ description: "[Classes and attributes](/classes-attributes)"
408
+ - component: PanelBar
409
+ source: https://github.com/yettoapp/ariadne/ruby/view_components/tree/main/app/components/ariadne/panel_bar_component.rb
410
+ parameters:
411
+ - name: tag
412
+ type: Symbol, String
413
+ default: N/A
414
+ description: The rendered tag name.
415
+ - name: classes
416
+ type: String
417
+ default: '`""`'
418
+ description: "[Classes and attributes](/classes-attributes)"
419
+ - name: attributes
420
+ type: Hash
421
+ default: "`{}`"
422
+ description: "[Classes and attributes](/classes-attributes)"
317
423
  - component: Pill
318
424
  source: https://github.com/yettoapp/ariadne/ruby/view_components/tree/main/app/components/ariadne/pill_component.rb
319
425
  parameters:
@@ -333,6 +439,29 @@
333
439
  type: Hash
334
440
  default: "`{}`"
335
441
  description: "[Classes and attributes](/classes-attributes)"
442
+ - component: RichTextArea
443
+ source: https://github.com/yettoapp/ariadne/ruby/view_components/tree/main/app/components/ariadne/rich_text_area_component.rb
444
+ parameters:
445
+ - name: name
446
+ type: Symbol
447
+ default: N/A
448
+ description: Identifies the form/param name for this rich text area.
449
+ - name: sr_label
450
+ type: String
451
+ default: N/A
452
+ description: A label to introduce these tabs for screen readers.
453
+ - name: has_form
454
+ type: Boolean
455
+ default: "`true`"
456
+ description: Indicates whether this component is wrapped in a form.
457
+ - name: classes
458
+ type: String
459
+ default: '`""`'
460
+ description: "[Classes and attributes](/classes-attributes)"
461
+ - name: attributes
462
+ type: Hash
463
+ default: "`{}`"
464
+ description: "[Classes and attributes](/classes-attributes)"
336
465
  - component: Slideover
337
466
  source: https://github.com/yettoapp/ariadne/ruby/view_components/tree/main/app/components/ariadne/slideover_component.rb
338
467
  parameters:
@@ -343,7 +472,7 @@
343
472
  - name: direction
344
473
  type: Symbol
345
474
  default: N/A
346
- description: One of `:x` and `:y`.
475
+ description: One of `:xl` and `:yd`.
347
476
  - name: form_id
348
477
  type: String
349
478
  default: "`nil`"
@@ -364,6 +493,44 @@
364
493
  type: Hash
365
494
  default: "`{}`"
366
495
  description: "[Classes and attributes](/classes-attributes)"
496
+ - component: TabBar
497
+ source: https://github.com/yettoapp/ariadne/ruby/view_components/tree/main/app/components/ariadne/tab_bar_component.rb
498
+ parameters:
499
+ - name: tag
500
+ type: Symbol, String
501
+ default: "`:nav`"
502
+ description: The rendered tag name.
503
+ - name: sr_label
504
+ type: String
505
+ default: N/A
506
+ description: A label to introduce these tabs for screen readers.
507
+ - name: classes
508
+ type: String
509
+ default: '`""`'
510
+ description: "[Classes and attributes](/classes-attributes)"
511
+ - name: attributes
512
+ type: Hash
513
+ default: "`{}`"
514
+ description: "[Classes and attributes](/classes-attributes)"
515
+ - component: Tab
516
+ source: https://github.com/yettoapp/ariadne/ruby/view_components/tree/main/app/components/ariadne/tab_component.rb
517
+ parameters:
518
+ - name: tag
519
+ type: Symbol, String
520
+ default: "`:button`"
521
+ description: The rendered tag name.
522
+ - name: selected
523
+ type: Boolean
524
+ default: "`false`"
525
+ description: Whether the tab is selected or not.
526
+ - name: classes
527
+ type: String
528
+ default: '`""`'
529
+ description: "[Classes and attributes](/classes-attributes)"
530
+ - name: attributes
531
+ type: Hash
532
+ default: "`{}`"
533
+ description: "[Classes and attributes](/classes-attributes)"
367
534
  - component: Text
368
535
  source: https://github.com/yettoapp/ariadne/ruby/view_components/tree/main/app/components/ariadne/text.rb
369
536
  parameters:
@@ -423,21 +590,25 @@
423
590
  parameters:
424
591
  - name: tag
425
592
  type: Symbol, String
426
- default: '`:"tool-tip"`'
593
+ default: "`:tooltip`"
427
594
  description: The rendered tag name
428
- - name: type
429
- type: Symbol
430
- default: "`:description`"
431
- description: One of `:description` and `:label`.
595
+ - name: for_id
596
+ type: String
597
+ default: N/A
598
+ description: The ID of the element that the tooltip should be attached to.
432
599
  - name: text
433
600
  type: String
434
601
  default: N/A
435
602
  description: The text content of the tooltip. This should be brief and no longer
436
603
  than a sentence.
604
+ - name: type
605
+ type: Symbol
606
+ default: "`:description`"
607
+ description: One of `:description` and `:label`.
437
608
  - name: direction
438
609
  type: Symbol
439
- default: "`:s`"
440
- description: One of `:e`, `:n`, `:ne`, `:nw`, `:s`, `:se`, `:sw`, or `:w`.
610
+ default: "`:top`"
611
+ description: One of `:bottom`, `:left`, `:right`, or `:top`.
441
612
  - name: classes
442
613
  type: String
443
614
  default: '`""`'
@@ -2,15 +2,18 @@
2
2
  "Ariadne::BaseButton": "",
3
3
  "Ariadne::BaseComponent": "",
4
4
  "Ariadne::BlankslateComponent": "",
5
+ "Ariadne::BodyComponent": "",
5
6
  "Ariadne::ButtonComponent": "",
6
7
  "Ariadne::ClipboardCopyComponent": "",
8
+ "Ariadne::CommentComponent": "",
7
9
  "Ariadne::ContainerComponent": "",
8
10
  "Ariadne::Content": "",
9
11
  "Ariadne::CounterComponent": "",
10
12
  "Ariadne::FlashComponent": "",
13
+ "Ariadne::FlexComponent": "",
11
14
  "Ariadne::FooterComponent": "",
12
15
  "Ariadne::GridComponent": "",
13
- "Ariadne::GridComponent::Item": "",
16
+ "Ariadne::GridComponent::GridItem": "",
14
17
  "Ariadne::HeaderComponent": "",
15
18
  "Ariadne::HeadingComponent": "",
16
19
  "Ariadne::HeroiconComponent": "",
@@ -18,9 +21,16 @@
18
21
  "Ariadne::InlineFlexComponent": "",
19
22
  "Ariadne::LinkComponent": "",
20
23
  "Ariadne::ListComponent": "",
21
- "Ariadne::ListComponent::Item": "",
24
+ "Ariadne::ListComponent::ListItem": "",
25
+ "Ariadne::MainComponent": "",
26
+ "Ariadne::NarrowContainerComponent": "",
27
+ "Ariadne::PanelBarComponent": "",
28
+ "Ariadne::PanelBarComponent::PanelItem": "",
22
29
  "Ariadne::PillComponent": "",
30
+ "Ariadne::RichTextAreaComponent": "",
23
31
  "Ariadne::SlideoverComponent": "",
32
+ "Ariadne::TabBarComponent": "",
33
+ "Ariadne::TabComponent": "",
24
34
  "Ariadne::Text": "",
25
35
  "Ariadne::TimeAgoComponent": "",
26
36
  "Ariadne::TimelineComponent": "",