ariadne_view_components 0.0.24-x64-mingw32 → 0.0.26-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +52 -0
  3. data/README.md +6 -5
  4. data/app/assets/javascripts/ariadne_view_components.js +1 -1
  5. data/app/assets/javascripts/ariadne_view_components.js.map +1 -1
  6. data/app/components/ariadne/ariadne.ts +7 -7
  7. data/app/components/ariadne/{avatar_stack_component.html.erb → avatar_stack_component/avatar_stack_component.html.erb} +0 -0
  8. data/app/components/ariadne/{blankslate_component.html.erb → blankslate_component/blankslate_component.html.erb} +0 -0
  9. data/app/components/ariadne/body_component.rb +1 -1
  10. data/app/components/ariadne/{button_component.html.erb → button_component/button_component.html.erb} +0 -0
  11. data/app/components/ariadne/button_component.rb +2 -2
  12. data/app/components/ariadne/{clipboard-copy-component.ts → clipboard_copy_component/clipboard-copy-component.ts} +0 -0
  13. data/app/components/ariadne/{clipboard_copy_component.html.erb → clipboard_copy_component/clipboard_copy_component.html.erb} +0 -0
  14. data/app/components/ariadne/{comment_component.html.erb → comment_component/comment_component.html.erb} +1 -1
  15. data/app/components/ariadne/comment_component.rb +1 -1
  16. data/app/components/ariadne/{container_component.html.erb → container_component/container_component.html.erb} +0 -0
  17. data/app/components/ariadne/{details_component.html.erb → details_component/details_component.html.erb} +0 -0
  18. data/app/components/ariadne/details_component.rb +1 -1
  19. data/app/components/ariadne/{dropdown_component.html.erb → dropdown_component/dropdown_component.html.erb} +0 -0
  20. data/app/components/ariadne/{flash_component.html.erb → flash_component/flash_component.html.erb} +0 -0
  21. data/app/components/ariadne/flash_component.rb +4 -4
  22. data/app/components/ariadne/{footer_component.html.erb → footer_component/footer_component.html.erb} +0 -0
  23. data/app/components/ariadne/{grid_component.html.erb → grid_component/grid_component.html.erb} +0 -0
  24. data/app/components/ariadne/{header_component.html.erb → header_component/header_component.html.erb} +0 -0
  25. data/app/components/ariadne/header_component.rb +6 -10
  26. data/app/components/ariadne/{heroicon_component.html.erb → heroicon_component/heroicon_component.html.erb} +0 -0
  27. data/app/components/ariadne/{inline_flex_component.html.erb → inline_flex_component/inline_flex_component.html.erb} +0 -0
  28. data/app/components/ariadne/{list_component.html.erb → list_component/list_component.html.erb} +0 -0
  29. data/app/components/ariadne/{narrow_container_component.html.erb → narrow_container_component/narrow_container_component.html.erb} +0 -0
  30. data/app/components/ariadne/{panel_bar_component.html.erb → panel_bar_component/panel_bar_component.html.erb} +0 -0
  31. data/app/components/ariadne/{pill_component.html.erb → pill_component/pill_component.html.erb} +0 -0
  32. data/app/components/ariadne/{rich-text-area-component.ts → rich_text_area_component/rich-text-area-component.ts} +0 -0
  33. data/app/components/ariadne/{rich_text_area_component.html.erb → rich_text_area_component/rich_text_area_component.html.erb} +0 -0
  34. data/app/components/ariadne/{slideover-component.ts → slideover_component/slideover-component.ts} +0 -0
  35. data/app/components/ariadne/{slideover_component.html.erb → slideover_component/slideover_component.html.erb} +0 -0
  36. data/app/components/ariadne/{tab_component.html.erb → tab_component/tab_component.html.erb} +0 -0
  37. data/app/components/ariadne/{tab-container-component.ts → tab_container_component/tab-container-component.ts} +1 -1
  38. data/app/components/ariadne/tab_container_component.rb +1 -1
  39. data/app/components/ariadne/{tab-nav-component.ts → tab_nav_component/tab-nav-component.ts} +1 -1
  40. data/app/components/ariadne/{tab_nav_component.html.erb → tab_nav_component/tab_nav_component.html.erb} +0 -0
  41. data/app/components/ariadne/tab_nav_component.rb +2 -2
  42. data/app/components/ariadne/{table_nav_component.html.erb → table_nav_component/table_nav_component.html.erb} +0 -0
  43. data/app/components/ariadne/table_nav_component.rb +1 -1
  44. data/app/components/ariadne/{time-ago-component.ts → time_ago_component/time-ago-component.ts} +0 -0
  45. data/app/components/ariadne/{timeline_component.html.erb → timeline_component/timeline_component.html.erb} +0 -0
  46. data/app/components/ariadne/{tooltip-component.ts → tooltip_component/tooltip-component.ts} +0 -0
  47. data/app/components/ariadne/{tooltip_component.html.erb → tooltip_component/tooltip_component.html.erb} +0 -0
  48. data/app/lib/ariadne/form_builder.rb +6 -6
  49. data/lib/ariadne/view_components/version.rb +1 -1
  50. data/lib/tasks/docs.rake +27 -19
  51. data/static/classes.yml +17 -18
  52. data/static/constants.json +15 -15
  53. data/tailwind.config.js +3 -3
  54. metadata +34 -34
@@ -2,14 +2,14 @@ import {Application} from '@hotwired/stimulus'
2
2
 
3
3
  import AriadneForm from './ariadne-form'
4
4
 
5
- import ClipboardCopyComponent from './clipboard-copy-component'
6
- import RichTextAreaComponent from './rich-text-area-component'
7
- import SlideoverComponent from './slideover-component'
8
- import TabNavComponent from './tab-nav-component'
9
- import TooltipComponent from './tooltip-component'
5
+ import ClipboardCopyComponent from './clipboard_copy_component/clipboard-copy-component'
6
+ import RichTextAreaComponent from './rich_text_area_component/rich-text-area-component'
7
+ import SlideoverComponent from './slideover_component/slideover-component'
8
+ import TabNavComponent from './tab_nav_component/tab-nav-component'
9
+ import TooltipComponent from './tooltip_component/tooltip-component'
10
10
 
11
- import './tab-container-component'
12
- import './time-ago-component'
11
+ import './tab_container_component/tab-container-component'
12
+ import './time_ago_component/time-ago-component'
13
13
 
14
14
  const application = Application.start()
15
15
 
@@ -5,7 +5,7 @@ module Ariadne
5
5
  # Add additional usage considerations or best practices that may aid the user to use the component correctly.
6
6
  # @accessibility Add any accessibility considerations
7
7
  class BodyComponent < Ariadne::Component
8
- DEFAULT_CLASSES = "ariadne-scroll-smooth ariadne-bg-white ariadne-antialiased"
8
+ DEFAULT_CLASSES = "ariadne-scroll-smooth ariadne-antialiased"
9
9
 
10
10
  # @example Default
11
11
  #
@@ -11,8 +11,8 @@ module Ariadne
11
11
  SCHEME_CLASS_MAPPINGS = {
12
12
  link: Ariadne::LinkComponent::DEFAULT_ACTIONABLE_CLASSES,
13
13
  none: "",
14
- default: "ariadne-text-purple-800 ariadne-bg-purple-50 hover:ariadne-bg-purple-100 ariadne-border-purple-300 focus:ariadne-ring-offset-purple-50 focus:ariadne-ring-purple-600",
15
- info: "ariadne-text-blue-800 ariadne-bg-blue-50 hover:ariadne-bg-blue-100 ariadne-border-blue-300 focus:ariadne-ring-offset-blue-50 focus:ariadne-ring-blue-600",
14
+ default: "ariadne-text-slate-800 ariadne-bg-slate-50 hover:ariadne-bg-slate-100 ariadne-border-slate-300 focus:ariadne-ring-offset-slate-50 focus:ariadne-ring-slate-600",
15
+ info: "ariadne-text-slate-800 ariadne-bg-slate-50 hover:ariadne-bg-slate-100 ariadne-border-slate-300 focus:ariadne-ring-offset-blue-50 focus:ariadne-ring-slate-600",
16
16
  success: "ariadne-text-green-800 ariadne-bg-green-50 hover:ariadne-bg-green-100 ariadne-border-green-300 focus:ariadne-ring-offset-green-50 focus:ariadne-ring-green-600",
17
17
  warning: "ariadne-text-yellow-800 ariadne-bg-yellow-50 hover:ariadne-bg-yellow-100 ariadne-border-yellow-300 focus:ariadne-ring-offset-yellow-50 focus:ariadne-ring-yellow-600",
18
18
  danger: "ariadne-text-red-800 ariadne-bg-red-50 hover:ariadne-bg-red-100 ariadne-border-red-300 focus:ariadne-ring-offset-red-50 focus:ariadne-ring-red-600",
@@ -4,7 +4,7 @@
4
4
  <% tab.text { @public_tab_text } %>
5
5
  <% tab.panel(attributes: {:"data-public" => true}) do %>
6
6
  <%= ariadne_form_with(url: @url, method: @method, classes: @classes, attributes: @attributes) do |comment_box| %>
7
- <div class="ariadne-overflow-hidden ariadne-border ariadne-border-gray-300 ariadne-shadow-sm">
7
+ <div class="ariadne-overflow-hidden ariadne-border ariadne-border-slate-300 ariadne-shadow-sm">
8
8
  <%= hidden_field_tag 'message_public', true %>
9
9
  <%= render(Ariadne::RichTextAreaComponent.new(name: :public_bodytext, sr_label: "Select reply type", attributes: { required: true})) %>
10
10
  <% comment_box.submit { @submit } %>
@@ -10,7 +10,7 @@ module Ariadne
10
10
  DEFAULT_TAG = :div
11
11
  TAG_OPTIONS = [DEFAULT_TAG].freeze
12
12
 
13
- DEFAULT_CLASSES = "ariadne-bg-white ariadne-border-gray-300 ariadne-border ariadne-shadow ariadne-px-5 ariadne-rounded-md "
13
+ DEFAULT_CLASSES = "ariadne-border-gray-300 ariadne-border ariadne-shadow ariadne-py-5 ariadne-px-5 ariadne-rounded-md "
14
14
 
15
15
  renders_one :public_tab, lambda { |selected: false, text:, classes: "", attributes: {}|
16
16
  attributes[:"data-public"] = true
@@ -28,7 +28,7 @@ module Ariadne
28
28
  Ariadne::Content.new
29
29
  }
30
30
 
31
- DEFAULT_BODY_CLASSES = "ariadne-absolute ariadne-mt-2 ariadne-w-56 ariadne-divide-y ariadne-divide-gray-100 ariadne-rounded-md ariadne-bg-white ariadne-shadow-lg ariadne-ring-1 ariadne-ring-black ariadne-ring-opacity-5 focus:ariadne-outline-none"
31
+ DEFAULT_BODY_CLASSES = "ariadne-absolute ariadne-mt-2 ariadne-w-56 ariadne-divide-y ariadne-divide-gray-100 ariadne-rounded-md ariadne-shadow-lg ariadne-ring-1 ariadne-ring-black ariadne-ring-opacity-5 focus:ariadne-outline-none"
32
32
  # Use the Body slot as the main content to be shown when triggered by the Summary.
33
33
  #
34
34
  # @param tag [Symbol] The tag to use for the body/ <%= one_of(Ariadne::DetailsComponent::VALID_BODY_TAGS) %>
@@ -8,8 +8,8 @@ module Ariadne
8
8
  DEFAULT_SCHEME = :default
9
9
 
10
10
  DISMISSIBLE_SCHEME_CLASS_MAPPINGS = {
11
- default: "ariadne-text-blue-500 ariadne-bg-blue-50 hover:ariadne-bg-blue-100 focus:ariadne-ring-offset-blue-50 focus:ariadne-ring-blue-600",
12
- info: "ariadne-text-blue-500 ariadne-bg-blue-50 hover:ariadne-bg-blue-100 focus:ariadne-ring-offset-blue-50 focus:ariadne-ring-blue-600",
11
+ default: "ariadne-text-slate-500 ariadne-bg-blue-50 hover:ariadne-bg-blue-100 focus:ariadne-ring-offset-blue-50 focus:ariadne-ring-blue-600",
12
+ info: "ariadne-text-slate-500 ariadne-bg-blue-50 hover:ariadne-bg-blue-100 focus:ariadne-ring-offset-blue-50 focus:ariadne-ring-blue-600",
13
13
  success: "ariadne-text-green-500 ariadne-bg-green-50 hover:ariadne-bg-green-100 focus:ariadne-ring-offset-green-50 focus:ariadne-ring-green-600",
14
14
  warning: "ariadne-text-yellow-500 ariadne-bg-yellow-50 hover:ariadne-bg-yellow-100 focus:ariadne-ring-offset-yellow-50 focus:ariadne-ring-yellow-600",
15
15
  danger: "ariadne-text-red-500 ariadne-bg-red-50 hover:ariadne-bg-red-100 focus:ariadne-ring-offset-red-50 focus:ariadne-ring-red-600",
@@ -26,8 +26,8 @@ module Ariadne
26
26
  VALID_BG_SCHEMES = BG_SCHEME_CLASS_MAPPINGS.keys.freeze
27
27
 
28
28
  CONTENT_SCHEME_CLASS_MAPPINGS = {
29
- default: "ariadne-text-blue-700",
30
- info: "ariadne-text-blue-700",
29
+ default: "ariadne-text-slate-700",
30
+ info: "ariadne-text-slate-700",
31
31
  success: "ariadne-text-green-700",
32
32
  warning: "ariadne-text-yellow-700",
33
33
  danger: "ariadne-text-red-700",
@@ -3,8 +3,7 @@
3
3
  module Ariadne
4
4
  # Represents the top navigation bar on every page.
5
5
  class HeaderComponent < Ariadne::Component
6
- DEFAULT_CLASSES = "ariadne-sticky ariadne-top-0 ariadne-z-50 ariadne-px-4 ariadne-pt-4 ariadne-h-16 ariadne-bg-white ariadne-shadow-sm shadow-slate-900/5 ariadne-transition ariadne-duration-500"
7
- # ariadne-flex ariadne-flex-wrap ariadne-items-center ariadne-justify-between ariadne-bg-white dark:ariadne-shadow-none dark:ariadne-bg-transparent
6
+ DEFAULT_CLASSES = "ariadne-sticky ariadne-top-0 ariadne-z-50 ariadne-px-4 ariadne-pt-4 ariadne-h-16 ariadne-shadow-sm shadow-slate-900/5 ariadne-transition ariadne-duration-500"
8
7
  LINK_CLASSES = "ariadne-rounded-lg ariadne-py-1 ariadne-px-2 text-slate-700 hover:bg-slate-100 hover:text-slate-900"
9
8
 
10
9
  DEFAULT_TEXT_LOGO_CLASSES = "ariadne-flex ariadne-items-center ariadne-font-bold ariadne-text-xl"
@@ -21,14 +20,15 @@ module Ariadne
21
20
  # @param attributes [Hash] <%= link_to_attributes_docs %>
22
21
  renders_one :logo, lambda { |href: nil, src: nil, alt: nil, text: "", classes: "", attributes: {}|
23
22
  @href = href
23
+ @text = text
24
+
24
25
  if src.blank?
25
26
  actual_classes = class_names(DEFAULT_TEXT_LOGO_CLASSES, classes)
26
27
  Ariadne::Text.new(tag: :span, classes: actual_classes, attributes: attributes)
27
28
  else
28
29
  actual_classes = class_names(DEFAULT_IMAGE_LOGO_CLASSES, classes)
29
30
  actual_attributes = { width: 40, height: 40 }.merge(attributes)
30
- @text = text
31
- Ariadne::ImageComponent.new(src: src, alt: alt, classes: actual_classes, attributes: actual_attributes)
31
+ @image_logo = Ariadne::ImageComponent.new(src: src, alt: alt, classes: actual_classes, attributes: actual_attributes)
32
32
  end
33
33
  }
34
34
 
@@ -76,7 +76,7 @@ module Ariadne
76
76
  # @example Basic example
77
77
  #
78
78
  # <%= render(Ariadne::HeaderComponent.new) do |header| %>
79
- # <%= header.logo(as_text: true) { "GitHub" } %>
79
+ # <%= header.logo(text: true) { "GitHub" } %>
80
80
  # <%= header.navigation_link(href: "#features") { "Features" } %>
81
81
  # <%= header.login_link(href: "/login") { "Login" } %>
82
82
  # <% end %>
@@ -96,12 +96,8 @@ module Ariadne
96
96
  logo.present?
97
97
  end
98
98
 
99
- private def has_text_logo?
100
- logo.present? && @text_logo.present?
101
- end
102
-
103
99
  private def has_image_logo?
104
- logo.present? && @image_logo.present?
100
+ has_logo? && @image_logo.present?
105
101
  end
106
102
 
107
103
  private def has_signup_link?
@@ -1,7 +1,7 @@
1
1
  import '@github/tab-container-element'
2
2
 
3
3
  // keep in sync with tab_container_component.rb
4
- const DEFAULT_SELECTED_CLASSES: string[] = ['ariadne-border-indigo-500', 'ariadne-text-indigo-600']
4
+ const DEFAULT_SELECTED_CLASSES: string[] = ['ariadne-border-slate-500', 'ariadne-text-slate-600']
5
5
  const DEFAULT_UNSELECTED_CLASSES: string[] = [
6
6
  'ariadne-text-gray-500',
7
7
  'hover:ariadne-text-gray-700',
@@ -9,7 +9,7 @@ module Ariadne
9
9
 
10
10
  DEFAULT_CLASSES = ""
11
11
 
12
- DEFAULT_SELECTED_CLASSES = "ariadne-border-indigo-500 ariadne-text-indigo-600"
12
+ DEFAULT_SELECTED_CLASSES = "ariadne-border-slate-500 ariadne-text-slate-600"
13
13
  DEFAULT_UNSELECTED_CLASSES = "ariadne-text-gray-500 hover:ariadne-text-gray-700 hover:ariadne-border-gray-300"
14
14
 
15
15
  # Tabs and panels to be rendered.
@@ -6,7 +6,7 @@ export default class TabNavComponent extends Controller {
6
6
  declare readonly tabTargets: [HTMLAnchorElement]
7
7
 
8
8
  // keep in synch with tab_nav_component
9
- SELECTED_CLASSES = ['ariadne-border-indigo-500', 'ariadne-text-indigo-600']
9
+ SELECTED_CLASSES = ['ariadne-border-slate-500', 'ariadne-text-slate-600']
10
10
  UNSELECTED_CLASSES = ['ariadne-text-gray-500', 'hover:ariadne-text-gray-700', 'hover:ariadne-border-gray-300']
11
11
 
12
12
  connect() {
@@ -19,8 +19,8 @@ module Ariadne
19
19
  BODY_TAG_DEFAULT = :ul
20
20
 
21
21
  # keep this consistent with tab-container-component.ts
22
- SELECTED_CLASSES = "ariadne-border-indigo-500 ariadne-text-indigo-600"
23
- UNSELECTED_CLASSES = "ariadne-text-gray-500 hover:ariadne-text-gray-700 hover:ariadne-border-gray-300"
22
+ SELECTED_CLASSES = "ariadne-border-slate-600 ariadne-text-slate-700"
23
+ UNSELECTED_CLASSES = "ariadne-text-slate-500 hover:ariadne-text-slate-700 hover:ariadne-border-slate-700"
24
24
 
25
25
  DEFAULT_CLASSES = ""
26
26
 
@@ -287,7 +287,7 @@ module Ariadne
287
287
  }
288
288
 
289
289
  DEFAULT_PAGE_CLASSES = "ariadne-relative ariadne-inline-flex ariadne-items-center ariadne-border ariadne-border-gray-300 ariadne-bg-white ariadne-px-4 ariadne-py-2 ariadne-text-sm ariadne-font-medium ariadne-text-gray-500 hover:ariadne-bg-gray-50 focus:ariadne-z-20"
290
- DEFAULT_CURRENT_PAGE_CLASSES = "ariadne-relative ariadne-z-10 ariadne-inline-flex ariadne-items-center ariadne-border ariadne-border-indigo-500 ariadne-bg-indigo-50 ariadne-px-4 ariadne-py-2 ariadne-text-sm ariadne-font-medium ariadne-text-indigo-600 focus:ariadne-z-20"
290
+ DEFAULT_CURRENT_PAGE_CLASSES = "ariadne-relative ariadne-z-10 ariadne-inline-flex ariadne-items-center ariadne-border ariadne-border-slate-500 ariadne-bg-slate-50 ariadne-px-4 ariadne-py-2 ariadne-text-sm ariadne-font-medium ariadne-text-slate-600 focus:ariadne-z-20"
291
291
  DEFAULT_GAP_CLASSES = " ariadne-relative ariadne-inline-flex ariadne-items-center ariadne-border ariadne-border-gray-300 ariadne-bg-white ariadne-px-4 ariadne-py-2 ariadne-text-sm ariadne-font-medium ariadne-text-gray-700"
292
292
  renders_many :items, lambda { |link:, classes: "", attributes: {}|
293
293
  page, href = link
@@ -32,37 +32,37 @@ module Ariadne
32
32
  super(object_name, content, options, &block)
33
33
  end
34
34
 
35
- DEFAULT_TEXT_CLASSES = "ariadne-shadow-sm focus:ariadne-ring-indigo-500 focus:ariadne-border-indigo-500 ariadne-block ariadne-w-full sm:ariadne-text-sm ariadne-border-gray-300 ariadne-rounded-md"
35
+ DEFAULT_TEXT_CLASSES = "ariadne-shadow-sm focus:ariadne-ring-slate-500 focus:ariadne-border-slate-500 ariadne-block ariadne-w-full sm:ariadne-text-sm ariadne-border-gray-300 ariadne-rounded-md"
36
36
  def text_field(method, options = {})
37
37
  options[:class] = class_names(DEFAULT_TEXT_CLASSES, options.delete(:classes))
38
38
  super(method, **options)
39
39
  end
40
40
 
41
- DEFAULT_CHECKBOX_CLASSES = "focus:ariadne-ring-indigo-500 ariadne-h-4 ariadne-w-4 ariadne-text-indigo-600 ariadne-border-gray-300 ariadne-rounded"
41
+ DEFAULT_CHECKBOX_CLASSES = "focus:ariadne-ring-slate-500 ariadne-h-4 ariadne-w-4 ariadne-text-slate-600 ariadne-border-slate-300 ariadne-rounded"
42
42
  def check_box(object_name, method, options = {}, checked_value = "1", unchecked_value = "0")
43
43
  options[:class] = class_names(DEFAULT_CHECKBOX_CLASSES, options.delete(:classes))
44
44
  super(method, options, checked_value, unchecked_value)
45
45
  end
46
46
 
47
- DEFAULT_RADIO_CLASSES = "focus:ariadne-ring-indigo-500 ariadne-h-4 ariadne-w-4 ariadne-text-indigo-600 ariadne-border-gray-300 ariadne-rounded"
47
+ DEFAULT_RADIO_CLASSES = "focus:ariadne-ring-slate-500 ariadne-h-4 ariadne-w-4 ariadne-text-slate-600 ariadne-border-gray-300 ariadne-rounded"
48
48
  def radio_button(method, tag_value, options = {})
49
49
  options[:class] = class_names(DEFAULT_RADIO_CLASSES, options.delete(:classes))
50
50
  super(method, tag_value, **options)
51
51
  end
52
52
 
53
- DEFAULT_TEXTAREA_CLASSES = "ariadne-shadow-sm focus:ariadne-ring-indigo-500 focus:ariadne-border-indigo-500 ariadne-block ariadne-w-full sm:ariadne-text-sm ariadne-border ariadne-border-gray-300 ariadne-rounded-md"
53
+ DEFAULT_TEXTAREA_CLASSES = "ariadne-shadow-sm focus:ariadne-ring-slate-500 focus:ariadne-border-slate-500 ariadne-block ariadne-w-full sm:ariadne-text-sm ariadne-border ariadne-border-gray-300 ariadne-rounded-md"
54
54
  def text_area(method, options = {})
55
55
  options[:class] = class_names(DEFAULT_TEXTAREA_CLASSES, options.delete(:classes))
56
56
  super(method, **options)
57
57
  end
58
58
 
59
- DEFAULT_EMAIL_CLASSES = "ariadne-shadow-sm focus:ariadne-ring-indigo-500 focus:ariadne-border-indigo-500 ariadne-block ariadne-w-full sm:ariadne-text-sm ariadne-border-gray-300 ariadne-rounded-md"
59
+ DEFAULT_EMAIL_CLASSES = "ariadne-shadow-sm focus:ariadne-ring-slate-500 focus:ariadne-border-slate-500 ariadne-block ariadne-w-full sm:ariadne-text-sm ariadne-border-gray-300 ariadne-rounded-md"
60
60
  def email_field(method, options = {})
61
61
  options[:class] = class_names(DEFAULT_EMAIL_CLASSES, options.delete(:classes))
62
62
  super(method, **options)
63
63
  end
64
64
 
65
- DEFAULT_PASSWORD_CLASSES = "ariadne-appearance-none ariadne-block ariadne-w-full ariadne-px-3 ariadne-py-2 ariadne-border ariadne-border-gray-300 ariadne-rounded-md ariadne-shadow-sm ariadne-placeholder-gray-400 focus:ariadne-outline-none focus:ariadne-ring-indigo-500 focus:ariadne-border-indigo-500 sm:ariadne-text-sm"
65
+ DEFAULT_PASSWORD_CLASSES = "ariadne-appearance-none ariadne-block ariadne-w-full ariadne-px-3 ariadne-py-2 ariadne-border ariadne-border-gray-300 ariadne-rounded-md ariadne-shadow-sm ariadne-placeholder-gray-400 focus:ariadne-outline-none focus:ariadne-ring-slate-500 focus:ariadne-border-slate-500 sm:ariadne-text-sm"
66
66
  def password_field(method, options = {})
67
67
  options[:class] = class_names(DEFAULT_PASSWORD_CLASSES, options.delete(:classes))
68
68
  super(method, **options)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ariadne
4
4
  module ViewComponents
5
- VERSION = "0.0.24"
5
+ VERSION = "0.0.26"
6
6
  end
7
7
  end
data/lib/tasks/docs.rake CHANGED
@@ -230,29 +230,37 @@ namespace :docs do
230
230
  end
231
231
  end
232
232
 
233
- errors << { component.name => { example: "No examples found" } } unless initialize_method.tags(:example).any?
233
+ example_tags = initialize_method.tags(:example)
234
234
 
235
- f.puts
236
- f.puts("## Examples")
237
-
238
- initialize_method.tags(:example).each do |tag|
239
- name, description, code = parse_example_tag(tag)
235
+ if example_tags.any?
240
236
  f.puts
241
- f.puts("### #{name}")
242
- if description
237
+ f.puts("## Examples")
238
+
239
+ example_tags.each do |tag|
240
+ name, description, code = parse_example_tag(tag)
243
241
  f.puts
244
- f.puts(view_context.render(inline: description.squish))
245
- end
246
- f.puts
247
- html = view_context.render(inline: code)
248
- html.scan(/class="([^"]*)"/) do |classnames|
249
- classes_found_in_examples.concat(classnames[0].split.reject { |c| c.starts_with?("heroicon", "js") }.map { ".#{_1}" })
242
+ f.puts("### #{name}")
243
+ if description
244
+ f.puts
245
+ f.puts(view_context.render(inline: description.squish))
246
+ end
247
+ f.puts
248
+ html = begin
249
+ view_context.render(inline: code)
250
+ rescue StandardError => e
251
+ raise StandardError, "Unexpected error with #{data[:title]}: #{e.message}"
252
+ end
253
+ html.scan(/class="([^"]*)"/) do |classnames|
254
+ classes_found_in_examples.concat(classnames[0].split.reject { |c| c.starts_with?("heroicon", "js") }.map { ".#{_1}" })
255
+ end
256
+ f.puts("<Example src=\"#{html.tr('"', "'").delete("\n")}\" />")
257
+ f.puts
258
+ f.puts("```erb")
259
+ f.puts(code.to_s)
260
+ f.puts("```")
250
261
  end
251
- f.puts("<Example src=\"#{html.tr('"', "\'").delete("\n")}\" />")
252
- f.puts
253
- f.puts("```erb")
254
- f.puts(code.to_s)
255
- f.puts("```")
262
+ else
263
+ errors << { component.name => { example: "No examples found" } } unless components_without_examples.include?(component)
256
264
  end
257
265
  end
258
266
  end
data/static/classes.yml CHANGED
@@ -45,20 +45,14 @@
45
45
  - ".ariadne-mt-8"
46
46
  - ".ariadne-justify-center"
47
47
  - ".ariadne-scroll-smooth"
48
- - ".ariadne-bg-white"
49
48
  - ".ariadne-antialiased"
50
- - ".ariadne-text-purple-800"
51
- - ".ariadne-bg-purple-50"
52
- - ".hover:ariadne-bg-purple-100"
53
- - ".ariadne-border-purple-300"
54
- - ".focus:ariadne-ring-offset-purple-50"
55
- - ".focus:ariadne-ring-purple-600"
56
- - ".ariadne-text-blue-800"
57
- - ".ariadne-bg-blue-50"
58
- - ".hover:ariadne-bg-blue-100"
59
- - ".ariadne-border-blue-300"
49
+ - ".ariadne-text-slate-800"
50
+ - ".ariadne-bg-slate-50"
51
+ - ".hover:ariadne-bg-slate-100"
52
+ - ".ariadne-border-slate-300"
53
+ - ".focus:ariadne-ring-offset-slate-50"
54
+ - ".focus:ariadne-ring-slate-600"
60
55
  - ".focus:ariadne-ring-offset-blue-50"
61
- - ".focus:ariadne-ring-blue-600"
62
56
  - ".ariadne-text-green-800"
63
57
  - ".ariadne-bg-green-50"
64
58
  - ".hover:ariadne-bg-green-100"
@@ -97,6 +91,7 @@
97
91
  - ".ariadne-text-green-600"
98
92
  - ".ariadne-border-gray-300"
99
93
  - ".ariadne-shadow"
94
+ - ".ariadne-py-5"
100
95
  - ".ariadne-px-5"
101
96
  - ".ariadne-text-gray-500"
102
97
  - ".hover:ariadne-text-gray-700"
@@ -105,8 +100,8 @@
105
100
  - ".ariadne-py-4"
106
101
  - ".ariadne-px-1"
107
102
  - ".ariadne-border-b-2"
108
- - ".ariadne-border-indigo-500"
109
- - ".ariadne-text-indigo-600"
103
+ - ".ariadne-border-slate-500"
104
+ - ".ariadne-text-slate-600"
110
105
  - ".ariadne-space-y-8"
111
106
  - ".sm:ariadne-space-y-5"
112
107
  - ".tiptap-editor"
@@ -122,8 +117,9 @@
122
117
  - ".ariadne-ring-opacity-5"
123
118
  - ".ariadne-text-gray-700"
124
119
  - ".ariadne-text-red-500"
125
- - ".ariadne-text-blue-700"
120
+ - ".ariadne-text-slate-700"
126
121
  - ".ariadne-p-4"
122
+ - ".ariadne-bg-blue-50"
127
123
  - ".ariadne-flex-shrink-0"
128
124
  - ".ariadne-ml-3"
129
125
  - ".ariadne-text-yellow-700"
@@ -133,15 +129,15 @@
133
129
  - ".ariadne--mx-1.5"
134
130
  - ".ariadne--my-1.5"
135
131
  - ".ariadne-p-1.5"
136
- - ".ariadne-text-blue-500"
132
+ - ".ariadne-text-slate-500"
133
+ - ".hover:ariadne-bg-blue-100"
134
+ - ".focus:ariadne-ring-blue-600"
137
135
  - ".ariadne-sr-only"
138
136
  - ".ariadne-mt-4"
139
137
  - ".ariadne-pt-5"
140
138
  - ".ariadne--mx-2"
141
139
  - ".ariadne-flex-col"
142
- - ".ariadne-py-5"
143
140
  - ".ariadne-mt-6"
144
- - ".ariadne-text-slate-500"
145
141
  - ".sm:ariadne-mt-0"
146
142
  - ".ariadne-grid"
147
143
  - ".ariadne-gap-6"
@@ -164,6 +160,9 @@
164
160
  - ".ariadne-text-black"
165
161
  - ".ariadne-hidden"
166
162
  - ".ariadne-list-none"
163
+ - ".ariadne-border-slate-600"
164
+ - ".hover:ariadne-text-slate-700"
165
+ - ".hover:ariadne-border-slate-700"
167
166
  - ".ariadne-divide-gray-200"
168
167
  - ".ariadne-pb-4"
169
168
  - ".ariadne-text-lg"
@@ -96,7 +96,7 @@
96
96
  ]
97
97
  },
98
98
  "Ariadne::BodyComponent": {
99
- "DEFAULT_CLASSES": "ariadne-scroll-smooth ariadne-bg-white ariadne-antialiased"
99
+ "DEFAULT_CLASSES": "ariadne-scroll-smooth ariadne-antialiased"
100
100
  },
101
101
  "Ariadne::ButtonComponent": {
102
102
  "DEFAULT_SCHEME": "default",
@@ -104,8 +104,8 @@
104
104
  "SCHEME_CLASS_MAPPINGS": {
105
105
  "link": "ariadne-cursor-pointer ariadne-font-semibold ariadne-underline ariadne-decoration-double",
106
106
  "none": "",
107
- "default": "ariadne-text-purple-800 ariadne-bg-purple-50 hover:ariadne-bg-purple-100 ariadne-border-purple-300 focus:ariadne-ring-offset-purple-50 focus:ariadne-ring-purple-600",
108
- "info": "ariadne-text-blue-800 ariadne-bg-blue-50 hover:ariadne-bg-blue-100 ariadne-border-blue-300 focus:ariadne-ring-offset-blue-50 focus:ariadne-ring-blue-600",
107
+ "default": "ariadne-text-slate-800 ariadne-bg-slate-50 hover:ariadne-bg-slate-100 ariadne-border-slate-300 focus:ariadne-ring-offset-slate-50 focus:ariadne-ring-slate-600",
108
+ "info": "ariadne-text-slate-800 ariadne-bg-slate-50 hover:ariadne-bg-slate-100 ariadne-border-slate-300 focus:ariadne-ring-offset-blue-50 focus:ariadne-ring-slate-600",
109
109
  "success": "ariadne-text-green-800 ariadne-bg-green-50 hover:ariadne-bg-green-100 ariadne-border-green-300 focus:ariadne-ring-offset-green-50 focus:ariadne-ring-green-600",
110
110
  "warning": "ariadne-text-yellow-800 ariadne-bg-yellow-50 hover:ariadne-bg-yellow-100 ariadne-border-yellow-300 focus:ariadne-ring-offset-yellow-50 focus:ariadne-ring-yellow-600",
111
111
  "danger": "ariadne-text-red-800 ariadne-bg-red-50 hover:ariadne-bg-red-100 ariadne-border-red-300 focus:ariadne-ring-offset-red-50 focus:ariadne-ring-red-600"
@@ -136,7 +136,7 @@
136
136
  "DEFAULT_TAG": "clipboard-copy"
137
137
  },
138
138
  "Ariadne::CommentComponent": {
139
- "DEFAULT_CLASSES": "ariadne-bg-white ariadne-border-gray-300 ariadne-border ariadne-shadow ariadne-px-5 ariadne-rounded-md ",
139
+ "DEFAULT_CLASSES": "ariadne-border-gray-300 ariadne-border ariadne-shadow ariadne-py-5 ariadne-px-5 ariadne-rounded-md ",
140
140
  "DEFAULT_TAG": "div",
141
141
  "TAG_OPTIONS": [
142
142
  "div"
@@ -151,7 +151,7 @@
151
151
  "DEFAULT_CLASSES": "ariadne-inline-flex ariadne-items-center ariadne-p-1 ariadne-border ariadne-border-transparent ariadne-rounded-full ariadne-shadow-sm focus:ariadne-outline-none focus:ariadne-ring-2 focus:ariadne-ring-offset-2"
152
152
  },
153
153
  "Ariadne::DetailsComponent": {
154
- "DEFAULT_BODY_CLASSES": "ariadne-absolute ariadne-mt-2 ariadne-w-56 ariadne-divide-y ariadne-divide-gray-100 ariadne-rounded-md ariadne-bg-white ariadne-shadow-lg ariadne-ring-1 ariadne-ring-black ariadne-ring-opacity-5 focus:ariadne-outline-none",
154
+ "DEFAULT_BODY_CLASSES": "ariadne-absolute ariadne-mt-2 ariadne-w-56 ariadne-divide-y ariadne-divide-gray-100 ariadne-rounded-md ariadne-shadow-lg ariadne-ring-1 ariadne-ring-black ariadne-ring-opacity-5 focus:ariadne-outline-none",
155
155
  "DEFAULT_BODY_TAG": "div",
156
156
  "DEFAULT_CLASSES": "",
157
157
  "DEFAULT_TAG": "details",
@@ -219,16 +219,16 @@
219
219
  "danger": "ariadne-bg-red-50"
220
220
  },
221
221
  "CONTENT_SCHEME_CLASS_MAPPINGS": {
222
- "default": "ariadne-text-blue-700",
223
- "info": "ariadne-text-blue-700",
222
+ "default": "ariadne-text-slate-700",
223
+ "info": "ariadne-text-slate-700",
224
224
  "success": "ariadne-text-green-700",
225
225
  "warning": "ariadne-text-yellow-700",
226
226
  "danger": "ariadne-text-red-700"
227
227
  },
228
228
  "DEFAULT_SCHEME": "default",
229
229
  "DISMISSIBLE_SCHEME_CLASS_MAPPINGS": {
230
- "default": "ariadne-text-blue-500 ariadne-bg-blue-50 hover:ariadne-bg-blue-100 focus:ariadne-ring-offset-blue-50 focus:ariadne-ring-blue-600",
231
- "info": "ariadne-text-blue-500 ariadne-bg-blue-50 hover:ariadne-bg-blue-100 focus:ariadne-ring-offset-blue-50 focus:ariadne-ring-blue-600",
230
+ "default": "ariadne-text-slate-500 ariadne-bg-blue-50 hover:ariadne-bg-blue-100 focus:ariadne-ring-offset-blue-50 focus:ariadne-ring-blue-600",
231
+ "info": "ariadne-text-slate-500 ariadne-bg-blue-50 hover:ariadne-bg-blue-100 focus:ariadne-ring-offset-blue-50 focus:ariadne-ring-blue-600",
232
232
  "success": "ariadne-text-green-500 ariadne-bg-green-50 hover:ariadne-bg-green-100 focus:ariadne-ring-offset-green-50 focus:ariadne-ring-green-600",
233
233
  "warning": "ariadne-text-yellow-500 ariadne-bg-yellow-50 hover:ariadne-bg-yellow-100 focus:ariadne-ring-offset-yellow-50 focus:ariadne-ring-yellow-600",
234
234
  "danger": "ariadne-text-red-500 ariadne-bg-red-50 hover:ariadne-bg-red-100 focus:ariadne-ring-offset-red-50 focus:ariadne-ring-red-600"
@@ -283,7 +283,7 @@
283
283
  "DEFAULT_ITEM_CLASSES": "ariadne-flex ariadne-flex-col ariadne-text-center ariadne-rounded-lg ariadne-shadow text-black-700 ariadne-border-black"
284
284
  },
285
285
  "Ariadne::HeaderComponent": {
286
- "DEFAULT_CLASSES": "ariadne-sticky ariadne-top-0 ariadne-z-50 ariadne-px-4 ariadne-pt-4 ariadne-h-16 ariadne-bg-white ariadne-shadow-sm shadow-slate-900/5 ariadne-transition ariadne-duration-500",
286
+ "DEFAULT_CLASSES": "ariadne-sticky ariadne-top-0 ariadne-z-50 ariadne-px-4 ariadne-pt-4 ariadne-h-16 ariadne-shadow-sm shadow-slate-900/5 ariadne-transition ariadne-duration-500",
287
287
  "DEFAULT_IMAGE_LOGO_CLASSES": "ariadne-h-10 ariadne-w-auto",
288
288
  "DEFAULT_NAV_LINK_CLASSES": "ariadne-inline-block ariadne-rounded-lg ariadne-py-1 ariadne-px-2 ariadne-text-sm text-slate-700 hover:bg-slate-100 hover:text-slate-900",
289
289
  "DEFAULT_PROFILE_LINK_CLASSES": "group ariadne-inline-flex ariadne-items-center ariadne-justify-center ariadne-rounded-full ariadne-py-2 ariadne-px-4 ariadne-text-sm ariadne-font-semibold focus:ariadne-outline-none focus-visible:ariadne-outline-2 focus-visible:outline-offset-2",
@@ -464,7 +464,7 @@
464
464
  "DEFAULT_TAG": "div"
465
465
  },
466
466
  "Ariadne::SlideoverComponent": {
467
- "DEFAULT_BUTTON_CLASSES": "ariadne-inline-flex ariadne-items-center ariadne-shadow-sm ariadne-px-4 ariadne-py-1.5 ariadne-pb-2 ariadne-text-sm ariadne-leading-5 ariadne-font-medium ariadne-rounded-full ariadne-text-purple-800 ariadne-bg-purple-50 hover:ariadne-bg-purple-100 ariadne-border-purple-300 focus:ariadne-ring-offset-purple-50 focus:ariadne-ring-purple-600",
467
+ "DEFAULT_BUTTON_CLASSES": "ariadne-inline-flex ariadne-items-center ariadne-shadow-sm ariadne-px-4 ariadne-py-1.5 ariadne-pb-2 ariadne-text-sm ariadne-leading-5 ariadne-font-medium ariadne-rounded-full ariadne-text-slate-800 ariadne-bg-slate-50 hover:ariadne-bg-slate-100 ariadne-border-slate-300 focus:ariadne-ring-offset-slate-50 focus:ariadne-ring-slate-600",
468
468
  "DEFAULT_CLASSES": "ariadne-flex ariadne-flex-col",
469
469
  "DEFAULT_TAG": "div",
470
470
  "DIRECTION_X_LEFT": "xl",
@@ -487,7 +487,7 @@
487
487
  },
488
488
  "Ariadne::TabContainerComponent": {
489
489
  "DEFAULT_CLASSES": "",
490
- "DEFAULT_SELECTED_CLASSES": "ariadne-border-indigo-500 ariadne-text-indigo-600",
490
+ "DEFAULT_SELECTED_CLASSES": "ariadne-border-slate-500 ariadne-text-slate-600",
491
491
  "DEFAULT_TAG": "tab-container",
492
492
  "DEFAULT_UNSELECTED_CLASSES": "ariadne-text-gray-500 hover:ariadne-text-gray-700 hover:ariadne-border-gray-300"
493
493
  },
@@ -495,12 +495,12 @@
495
495
  "BODY_TAG_DEFAULT": "ul",
496
496
  "DEFAULT_CLASSES": "",
497
497
  "DEFAULT_TAG": "nav",
498
- "SELECTED_CLASSES": "ariadne-border-indigo-500 ariadne-text-indigo-600",
498
+ "SELECTED_CLASSES": "ariadne-border-slate-600 ariadne-text-slate-700",
499
499
  "TAG_OPTIONS": [
500
500
  "nav",
501
501
  "div"
502
502
  ],
503
- "UNSELECTED_CLASSES": "ariadne-text-gray-500 hover:ariadne-text-gray-700 hover:ariadne-border-gray-300"
503
+ "UNSELECTED_CLASSES": "ariadne-text-slate-500 hover:ariadne-text-slate-700 hover:ariadne-border-slate-700"
504
504
  },
505
505
  "Ariadne::TableNavComponent": {
506
506
  "BaseCellItem": "Ariadne::TableNavComponent::BaseCellItem",
@@ -549,7 +549,7 @@
549
549
  "DEFAULT_RESULT_CLASSES": "ariadne-text-sm ariadne-text-gray-700"
550
550
  },
551
551
  "Ariadne::TableNavComponent::PaginationBarItem": {
552
- "DEFAULT_CURRENT_PAGE_CLASSES": "ariadne-relative ariadne-z-10 ariadne-inline-flex ariadne-items-center ariadne-border ariadne-border-indigo-500 ariadne-bg-indigo-50 ariadne-px-4 ariadne-py-2 ariadne-text-sm ariadne-font-medium ariadne-text-indigo-600 focus:ariadne-z-20",
552
+ "DEFAULT_CURRENT_PAGE_CLASSES": "ariadne-relative ariadne-z-10 ariadne-inline-flex ariadne-items-center ariadne-border ariadne-border-slate-500 ariadne-bg-slate-50 ariadne-px-4 ariadne-py-2 ariadne-text-sm ariadne-font-medium ariadne-text-slate-600 focus:ariadne-z-20",
553
553
  "DEFAULT_GAP_CLASSES": " ariadne-relative ariadne-inline-flex ariadne-items-center ariadne-border ariadne-border-gray-300 ariadne-bg-white ariadne-px-4 ariadne-py-2 ariadne-text-sm ariadne-font-medium ariadne-text-gray-700",
554
554
  "DEFAULT_NEXT_PAGE_CLASSES": "ariadne-relative ariadne-inline-flex ariadne-items-center ariadne-rounded-r-md ariadne-border ariadne-border-gray-300 ariadne-bg-white ariadne-px-2 ariadne-py-2 ariadne-text-sm ariadne-font-medium ariadne-text-gray-500 hover:ariadne-bg-gray-50 focus:ariadne-z-20",
555
555
  "DEFAULT_PAGE_CLASSES": "ariadne-relative ariadne-inline-flex ariadne-items-center ariadne-border ariadne-border-gray-300 ariadne-bg-white ariadne-px-4 ariadne-py-2 ariadne-text-sm ariadne-font-medium ariadne-text-gray-500 hover:ariadne-bg-gray-50 focus:ariadne-z-20",
data/tailwind.config.js CHANGED
@@ -52,9 +52,9 @@ module.exports = {
52
52
  colors: {
53
53
  'billy-purple': '#a700a0',
54
54
 
55
- 'button-text-color': colors.indigo['700'],
56
- 'button-bg-color': colors.indigo['100'],
57
- 'button-hover-color': colors.indigo['200'],
55
+ 'button-text-color': colors.slate['700'],
56
+ 'button-bg-color': colors.slate['100'],
57
+ 'button-hover-color': colors.slate['200'],
58
58
 
59
59
  'list-hover-color': colors.blue['50'],
60
60
  'filter-panel-color': colors.amber['100'],