ariadne_view_components 0.0.12-x86_64-darwin → 0.0.14-x86_64-darwin
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/ariadne.d.ts +1 -0
- data/app/assets/javascripts/ariadne_view_components.js +2 -2
- data/app/assets/javascripts/ariadne_view_components.js.map +1 -1
- data/app/assets/javascripts/comment-component.d.ts +1 -2
- data/app/assets/javascripts/tab-container-component.d.ts +1 -0
- data/app/assets/javascripts/tab-nav-component.d.ts +9 -0
- data/app/assets/stylesheets/ariadne_view_components.css +1 -0
- data/app/assets/stylesheets/dropdown.css +46 -0
- data/app/assets/stylesheets/tooltip-component.css +8 -8
- data/app/components/ariadne/ariadne.ts +3 -2
- data/app/components/ariadne/avatar_component.rb +81 -0
- data/app/components/ariadne/avatar_stack_component.html.erb +12 -0
- data/app/components/ariadne/avatar_stack_component.rb +75 -0
- data/app/components/ariadne/base_button.rb +13 -4
- data/app/components/ariadne/blankslate_component.rb +4 -4
- data/app/components/ariadne/body_component.rb +1 -1
- data/app/components/ariadne/button_component.html.erb +1 -1
- data/app/components/ariadne/button_component.rb +11 -5
- data/app/components/ariadne/comment-component.ts +32 -50
- data/app/components/ariadne/comment_component.html.erb +31 -13
- data/app/components/ariadne/comment_component.rb +18 -6
- data/app/components/ariadne/component.rb +3 -5
- data/app/components/ariadne/container_component.rb +1 -1
- data/app/components/ariadne/counter_component.rb +1 -1
- data/app/components/ariadne/details_component.html.erb +4 -0
- data/app/components/ariadne/details_component.rb +80 -0
- data/app/components/ariadne/dropdown/menu_component.html.erb +20 -0
- data/app/components/ariadne/dropdown/menu_component.rb +101 -0
- data/app/components/ariadne/dropdown/menu_component.ts +1 -0
- data/app/components/ariadne/dropdown_component.html.erb +8 -0
- data/app/components/ariadne/dropdown_component.rb +172 -0
- data/app/components/ariadne/flash_component.rb +1 -1
- data/app/components/ariadne/flex_component.rb +2 -2
- data/app/components/ariadne/footer_component.html.erb +1 -1
- data/app/components/ariadne/footer_component.rb +1 -1
- data/app/components/ariadne/grid_component.html.erb +2 -2
- data/app/components/ariadne/grid_component.rb +10 -8
- data/app/components/ariadne/header_component.rb +3 -3
- data/app/components/ariadne/heroicon_component.html.erb +1 -1
- data/app/components/ariadne/heroicon_component.rb +7 -6
- data/app/components/ariadne/inline_flex_component.html.erb +1 -0
- data/app/components/ariadne/inline_flex_component.rb +8 -1
- data/app/components/ariadne/link_component.rb +2 -2
- data/app/components/ariadne/list_component.html.erb +2 -11
- data/app/components/ariadne/list_component.rb +11 -15
- data/app/components/ariadne/main_component.rb +2 -2
- data/app/components/ariadne/narrow_container_component.rb +1 -1
- data/app/components/ariadne/panel_bar_component.rb +2 -2
- data/app/components/ariadne/pill_component.rb +20 -6
- data/app/components/ariadne/rich-text-area-component.ts +4 -4
- data/app/components/ariadne/rich_text_area_component.html.erb +2 -2
- data/app/components/ariadne/rich_text_area_component.rb +2 -2
- data/app/components/ariadne/slideover_component.html.erb +1 -1
- data/app/components/ariadne/slideover_component.rb +2 -2
- data/app/components/ariadne/tab-container-component.ts +24 -0
- data/app/components/ariadne/tab-nav-component.ts +34 -0
- data/app/components/ariadne/tab_component.html.erb +2 -6
- data/app/components/ariadne/tab_component.rb +75 -19
- data/app/components/ariadne/tab_container_component.erb +12 -0
- data/app/components/ariadne/tab_container_component.rb +67 -0
- data/app/components/ariadne/tab_nav_component.html.erb +7 -0
- data/app/components/ariadne/tab_nav_component.rb +72 -0
- data/app/components/ariadne/table_nav_component.html.erb +52 -0
- data/app/components/ariadne/table_nav_component.rb +338 -0
- data/app/components/ariadne/time_ago_component.rb +1 -1
- data/app/components/ariadne/timeline_component.rb +1 -1
- data/app/components/ariadne/tooltip_component.html.erb +1 -1
- data/app/components/ariadne/tooltip_component.rb +4 -4
- data/app/lib/ariadne/action_view_extensions/form_helper.rb +21 -7
- data/app/lib/ariadne/fetch_or_fallback_helper.rb +11 -3
- data/app/lib/ariadne/form_builder.rb +2 -2
- data/app/lib/ariadne/icon_helper.rb +17 -13
- data/lib/ariadne/view_components/constants.rb +2 -2
- data/lib/ariadne/view_components/statuses.rb +2 -2
- data/lib/ariadne/view_components/version.rb +1 -1
- data/lib/rubocop/config/default.yml +1 -1
- data/lib/tasks/docs.rake +22 -97
- data/static/arguments.yml +151 -23
- data/static/audited_at.json +17 -1
- data/static/classes.yml +160 -268
- data/static/constants.json +208 -40
- data/static/statuses.json +17 -1
- data/tailwind.config.js +28 -19
- metadata +24 -10
- data/app/components/ariadne/tab_bar_component.html.erb +0 -3
- data/app/components/ariadne/tab_bar_component.rb +0 -45
- data/app/lib/ariadne/join_style_arguments_helper.rb +0 -14
- data/app/lib/ariadne/tab_nav_helper.rb +0 -35
- data/app/lib/ariadne/tabbed_component_helper.rb +0 -39
- data/app/lib/ariadne/test_selector_helper.rb +0 -20
- 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
|