ariadne_view_components 0.0.12-x64-mingw-ucrt → 0.0.14-x64-mingw-ucrt

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/ariadne.d.ts +1 -0
  3. data/app/assets/javascripts/ariadne_view_components.js +2 -2
  4. data/app/assets/javascripts/ariadne_view_components.js.map +1 -1
  5. data/app/assets/javascripts/comment-component.d.ts +1 -2
  6. data/app/assets/javascripts/tab-container-component.d.ts +1 -0
  7. data/app/assets/javascripts/tab-nav-component.d.ts +9 -0
  8. data/app/assets/stylesheets/ariadne_view_components.css +1 -0
  9. data/app/assets/stylesheets/dropdown.css +46 -0
  10. data/app/assets/stylesheets/tooltip-component.css +8 -8
  11. data/app/components/ariadne/ariadne.ts +3 -2
  12. data/app/components/ariadne/avatar_component.rb +81 -0
  13. data/app/components/ariadne/avatar_stack_component.html.erb +12 -0
  14. data/app/components/ariadne/avatar_stack_component.rb +75 -0
  15. data/app/components/ariadne/base_button.rb +13 -4
  16. data/app/components/ariadne/blankslate_component.rb +4 -4
  17. data/app/components/ariadne/body_component.rb +1 -1
  18. data/app/components/ariadne/button_component.html.erb +1 -1
  19. data/app/components/ariadne/button_component.rb +11 -5
  20. data/app/components/ariadne/comment-component.ts +32 -50
  21. data/app/components/ariadne/comment_component.html.erb +31 -13
  22. data/app/components/ariadne/comment_component.rb +18 -6
  23. data/app/components/ariadne/component.rb +3 -5
  24. data/app/components/ariadne/container_component.rb +1 -1
  25. data/app/components/ariadne/counter_component.rb +1 -1
  26. data/app/components/ariadne/details_component.html.erb +4 -0
  27. data/app/components/ariadne/details_component.rb +80 -0
  28. data/app/components/ariadne/dropdown/menu_component.html.erb +20 -0
  29. data/app/components/ariadne/dropdown/menu_component.rb +101 -0
  30. data/app/components/ariadne/dropdown/menu_component.ts +1 -0
  31. data/app/components/ariadne/dropdown_component.html.erb +8 -0
  32. data/app/components/ariadne/dropdown_component.rb +172 -0
  33. data/app/components/ariadne/flash_component.rb +1 -1
  34. data/app/components/ariadne/flex_component.rb +2 -2
  35. data/app/components/ariadne/footer_component.html.erb +1 -1
  36. data/app/components/ariadne/footer_component.rb +1 -1
  37. data/app/components/ariadne/grid_component.html.erb +2 -2
  38. data/app/components/ariadne/grid_component.rb +10 -8
  39. data/app/components/ariadne/header_component.rb +3 -3
  40. data/app/components/ariadne/heroicon_component.html.erb +1 -1
  41. data/app/components/ariadne/heroicon_component.rb +7 -6
  42. data/app/components/ariadne/inline_flex_component.html.erb +1 -0
  43. data/app/components/ariadne/inline_flex_component.rb +8 -1
  44. data/app/components/ariadne/link_component.rb +2 -2
  45. data/app/components/ariadne/list_component.html.erb +2 -11
  46. data/app/components/ariadne/list_component.rb +11 -15
  47. data/app/components/ariadne/main_component.rb +2 -2
  48. data/app/components/ariadne/narrow_container_component.rb +1 -1
  49. data/app/components/ariadne/panel_bar_component.rb +2 -2
  50. data/app/components/ariadne/pill_component.rb +20 -6
  51. data/app/components/ariadne/rich-text-area-component.ts +4 -4
  52. data/app/components/ariadne/rich_text_area_component.html.erb +2 -2
  53. data/app/components/ariadne/rich_text_area_component.rb +2 -2
  54. data/app/components/ariadne/slideover_component.html.erb +1 -1
  55. data/app/components/ariadne/slideover_component.rb +2 -2
  56. data/app/components/ariadne/tab-container-component.ts +24 -0
  57. data/app/components/ariadne/tab-nav-component.ts +34 -0
  58. data/app/components/ariadne/tab_component.html.erb +2 -6
  59. data/app/components/ariadne/tab_component.rb +75 -19
  60. data/app/components/ariadne/tab_container_component.erb +12 -0
  61. data/app/components/ariadne/tab_container_component.rb +67 -0
  62. data/app/components/ariadne/tab_nav_component.html.erb +7 -0
  63. data/app/components/ariadne/tab_nav_component.rb +72 -0
  64. data/app/components/ariadne/table_nav_component.html.erb +52 -0
  65. data/app/components/ariadne/table_nav_component.rb +338 -0
  66. data/app/components/ariadne/time_ago_component.rb +1 -1
  67. data/app/components/ariadne/timeline_component.rb +1 -1
  68. data/app/components/ariadne/tooltip_component.html.erb +1 -1
  69. data/app/components/ariadne/tooltip_component.rb +4 -4
  70. data/app/lib/ariadne/action_view_extensions/form_helper.rb +21 -7
  71. data/app/lib/ariadne/fetch_or_fallback_helper.rb +11 -3
  72. data/app/lib/ariadne/form_builder.rb +2 -2
  73. data/app/lib/ariadne/icon_helper.rb +17 -13
  74. data/lib/ariadne/view_components/constants.rb +2 -2
  75. data/lib/ariadne/view_components/statuses.rb +2 -2
  76. data/lib/ariadne/view_components/version.rb +1 -1
  77. data/lib/rubocop/config/default.yml +1 -1
  78. data/lib/tasks/docs.rake +22 -97
  79. data/static/arguments.yml +151 -23
  80. data/static/audited_at.json +17 -1
  81. data/static/classes.yml +160 -268
  82. data/static/constants.json +208 -40
  83. data/static/statuses.json +17 -1
  84. data/tailwind.config.js +28 -19
  85. metadata +24 -10
  86. data/app/components/ariadne/tab_bar_component.html.erb +0 -3
  87. data/app/components/ariadne/tab_bar_component.rb +0 -45
  88. data/app/lib/ariadne/join_style_arguments_helper.rb +0 -14
  89. data/app/lib/ariadne/tab_nav_helper.rb +0 -35
  90. data/app/lib/ariadne/tabbed_component_helper.rb +0 -39
  91. data/app/lib/ariadne/test_selector_helper.rb +0 -20
  92. data/app/lib/ariadne/underline_nav_helper.rb +0 -44
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Ariadne
4
- # :nodoc:
5
- module JoinStyleArgumentsHelper
6
- # Join two `style` arguments
7
- #
8
- # join_style_arguments("width: 100%", "height: 100%") =>
9
- # "width: 100%;height: 100%"
10
- def join_style_arguments(*args)
11
- args.compact.join(";")
12
- end
13
- end
14
- end
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "active_support/concern"
4
-
5
- module Ariadne
6
- # Helper to share tab validation logic between components.
7
- # The component will raise an error if there are 0 or 2+ selected tabs.
8
- module TabNavHelper
9
- extend ActiveSupport::Concern
10
-
11
- EXTRA_ALIGN_DEFAULT = :left
12
- EXTRA_ALIGN_OPTIONS = [EXTRA_ALIGN_DEFAULT, :right].freeze
13
-
14
- def tab_nav_tab_classes(classes)
15
- class_names(
16
- "tabnav-tab",
17
- classes
18
- )
19
- end
20
-
21
- def tab_nav_classes(classes)
22
- class_names(
23
- "tabnav",
24
- classes
25
- )
26
- end
27
-
28
- def tab_nav_body_classes(classes)
29
- class_names(
30
- "tabnav-tabs",
31
- classes
32
- )
33
- end
34
- end
35
- end
@@ -1,39 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "active_support/concern"
4
-
5
- module Ariadne
6
- # Helper to share tab validation logic between components.
7
- # The component will raise an error if there are 0 or 2+ selected tabs.
8
- module TabbedComponentHelper
9
- extend ActiveSupport::Concern
10
-
11
- class MultipleSelectedTabsError < StandardError; end
12
-
13
- def before_render
14
- validate_single_selected_tab unless Rails.env.production?
15
- end
16
-
17
- private
18
-
19
- def aria_label_for_page_nav(label)
20
- @attributes[:tag] == :nav ? @attributes[:"aria-label"] = label : @body_arguments[:"aria-label"] = label
21
- end
22
-
23
- def tab_container_wrapper(with_panel:, **attributes)
24
- return yield unless with_panel
25
-
26
- render(Ariadne::TabContainerComponent.new(**attributes)) do
27
- yield if block_given?
28
- end
29
- end
30
-
31
- def validate_single_selected_tab
32
- raise MultipleSelectedTabsError, "only one tab can be selected" if selected_tabs_count > 1
33
- end
34
-
35
- def selected_tabs_count
36
- @selected_tabs_count ||= tabs.count(&:selected)
37
- end
38
- end
39
- end
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Ariadne
4
- # Module to allow components to deal with the `test_selector` argument.
5
- # It will only add the selector if env is not Production.
6
- #
7
- # test_selector: "foo" => data-test-selector="foo"
8
- module TestSelectorHelper
9
- TEST_SELECTOR_TAG = :test_selector
10
-
11
- def add_test_selector(args)
12
- if args.key?(TEST_SELECTOR_TAG)
13
- args[:data] ||= {}
14
- args[:data][TEST_SELECTOR_TAG] = args[TEST_SELECTOR_TAG]
15
- end
16
-
17
- args.except(TEST_SELECTOR_TAG)
18
- end
19
- end
20
- end
@@ -1,44 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "active_support/concern"
4
-
5
- module Ariadne
6
- # Helper to share tab validation logic between components.
7
- # The component will raise an error if there are 0 or 2+ selected tabs.
8
- module UnderlineNavHelper
9
- extend ActiveSupport::Concern
10
-
11
- ALIGN_DEFAULT = :left
12
- ALIGN_OPTIONS = [ALIGN_DEFAULT, :right].freeze
13
-
14
- ACTIONS_TAG_DEFAULT = :div
15
- ACTIONS_TAG_OPTIONS = [ACTIONS_TAG_DEFAULT, :span].freeze
16
-
17
- def underline_nav_classes(classes, align)
18
- class_names(
19
- classes,
20
- "UnderlineNav",
21
- "UnderlineNav--right" => align == :right
22
- )
23
- end
24
-
25
- def underline_nav_body_classes(classes)
26
- class_names(
27
- "UnderlineNav-body",
28
- classes,
29
- "list-style-none"
30
- )
31
- end
32
-
33
- def underline_nav_action_classes(classes)
34
- class_names("UnderlineNav-actions", classes)
35
- end
36
-
37
- def underline_nav_tab_classes(classes)
38
- class_names(
39
- "UnderlineNav-item",
40
- classes
41
- )
42
- end
43
- end
44
- end