polaris_view_components 0.7.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/icons/polaris/AnalyticsMinor.svg +1 -0
  3. data/app/assets/icons/polaris/AppsMinor.svg +1 -0
  4. data/app/assets/icons/polaris/BlockMinor.svg +1 -0
  5. data/app/assets/icons/polaris/ButtonMinor.svg +1 -0
  6. data/app/assets/icons/polaris/CaretDownMinor.svg +1 -1
  7. data/app/assets/icons/polaris/CaretUpMinor.svg +1 -1
  8. data/app/assets/icons/polaris/CircleTickMinor.svg +1 -0
  9. data/app/assets/icons/polaris/Columns3Minor.svg +1 -0
  10. data/app/assets/icons/polaris/CustomersMinor.svg +1 -1
  11. data/app/assets/icons/polaris/DiscountsMinor.svg +1 -0
  12. data/app/assets/icons/polaris/DropdownMinor.svg +1 -1
  13. data/app/assets/icons/polaris/FinancesMajor.svg +1 -0
  14. data/app/assets/icons/polaris/FinancesMinor.svg +1 -0
  15. data/app/assets/icons/polaris/HomeMinor.svg +1 -0
  16. data/app/assets/icons/polaris/MarketingMinor.svg +1 -0
  17. data/app/assets/icons/polaris/OnlineStoreMinor.svg +1 -0
  18. data/app/assets/icons/polaris/OrdersMinor.svg +1 -0
  19. data/app/assets/icons/polaris/ProductsMinor.svg +1 -0
  20. data/app/assets/icons/polaris/QuestionMarkInverseMajor.svg +1 -0
  21. data/app/assets/icons/polaris/QuestionMarkInverseMinor.svg +1 -0
  22. data/app/assets/icons/polaris/SelectMinor.svg +1 -1
  23. data/app/assets/icons/polaris/TitleMinor.svg +1 -0
  24. data/app/assets/icons/polaris/WandMinor.svg +1 -0
  25. data/app/assets/javascripts/polaris_view_components/autocomplete_controller.js +32 -15
  26. data/app/assets/javascripts/polaris_view_components/collapsible_controller.js +19 -0
  27. data/app/assets/javascripts/polaris_view_components/dropzone_controller.js +495 -0
  28. data/app/assets/javascripts/polaris_view_components/index.js +4 -0
  29. data/app/assets/javascripts/polaris_view_components/polaris_controller.js +4 -0
  30. data/app/assets/javascripts/polaris_view_components/popover_controller.js +9 -2
  31. data/app/assets/javascripts/polaris_view_components/toast_controller.js +13 -2
  32. data/app/assets/javascripts/polaris_view_components/utils.js +23 -0
  33. data/app/assets/javascripts/polaris_view_components.js +560 -65
  34. data/app/assets/stylesheets/polaris_view_components/custom.css +38 -6
  35. data/app/assets/stylesheets/polaris_view_components.css +2107 -2021
  36. data/app/assets/stylesheets/polaris_view_components.postcss.css +1 -1
  37. data/app/components/polaris/action_list/item_component.rb +1 -1
  38. data/app/components/polaris/action_list/section_component.rb +1 -1
  39. data/app/components/polaris/action_list_component.rb +1 -1
  40. data/app/components/polaris/autocomplete/action_component.rb +1 -1
  41. data/app/components/polaris/autocomplete/option_component.rb +1 -1
  42. data/app/components/polaris/autocomplete/section_component.rb +1 -1
  43. data/app/components/polaris/autocomplete_component.rb +9 -2
  44. data/app/components/polaris/avatar_component.rb +1 -1
  45. data/app/components/polaris/badge_component.rb +1 -1
  46. data/app/components/polaris/banner_component.rb +2 -2
  47. data/app/components/polaris/base_button.rb +1 -1
  48. data/app/components/polaris/base_checkbox.rb +1 -1
  49. data/app/components/polaris/base_component.rb +1 -1
  50. data/app/components/polaris/base_radio_button.rb +1 -1
  51. data/app/components/polaris/button_group_component.rb +3 -3
  52. data/app/components/polaris/callout_card_component.rb +1 -1
  53. data/app/components/polaris/caption_component.rb +1 -1
  54. data/app/components/polaris/card/header_component.rb +1 -1
  55. data/app/components/polaris/card/section_component.rb +2 -2
  56. data/app/components/polaris/card_component.rb +1 -1
  57. data/app/components/polaris/checkbox_component.rb +1 -1
  58. data/app/components/polaris/choice_component.rb +1 -1
  59. data/app/components/polaris/choice_list_component.rb +1 -1
  60. data/app/components/polaris/collapsible_component.rb +37 -0
  61. data/app/components/polaris/component.rb +6 -1
  62. data/app/components/polaris/data_table/cell_component.rb +1 -1
  63. data/app/components/polaris/data_table/column_component.rb +1 -1
  64. data/app/components/polaris/data_table_component.rb +1 -1
  65. data/app/components/polaris/description_list_component.rb +2 -2
  66. data/app/components/polaris/display_text_component.rb +1 -1
  67. data/app/components/polaris/dropzone_component.html.erb +156 -0
  68. data/app/components/polaris/dropzone_component.rb +150 -0
  69. data/app/components/polaris/empty_state_component.rb +1 -1
  70. data/app/components/polaris/exception_list/item_component.rb +1 -1
  71. data/app/components/polaris/exception_list_component.rb +1 -1
  72. data/app/components/polaris/filters_component.rb +3 -3
  73. data/app/components/polaris/footer_help_component.rb +1 -1
  74. data/app/components/polaris/form_layout/group_component.rb +2 -2
  75. data/app/components/polaris/form_layout/item_component.rb +1 -1
  76. data/app/components/polaris/form_layout_component.rb +1 -1
  77. data/app/components/polaris/frame/save_bar_component.rb +1 -1
  78. data/app/components/polaris/frame/top_bar_component.rb +1 -1
  79. data/app/components/polaris/frame_component.rb +1 -1
  80. data/app/components/polaris/heading_component.rb +1 -1
  81. data/app/components/polaris/headless_button.rb +1 -1
  82. data/app/components/polaris/icon_component.rb +1 -1
  83. data/app/components/polaris/index_table/cell_component.rb +1 -1
  84. data/app/components/polaris/index_table/column_component.rb +1 -1
  85. data/app/components/polaris/index_table_component.rb +1 -1
  86. data/app/components/polaris/inline_error_component.rb +1 -1
  87. data/app/components/polaris/keyboard_key_component.rb +20 -0
  88. data/app/components/polaris/label_component.rb +1 -1
  89. data/app/components/polaris/labelled_component.rb +1 -1
  90. data/app/components/polaris/layout/annotated_section.rb +1 -1
  91. data/app/components/polaris/layout/section.rb +1 -1
  92. data/app/components/polaris/layout_component.rb +1 -1
  93. data/app/components/polaris/link_component.rb +1 -1
  94. data/app/components/polaris/list_component.rb +2 -2
  95. data/app/components/polaris/modal/section_component.rb +1 -1
  96. data/app/components/polaris/modal_component.rb +1 -1
  97. data/app/components/polaris/navigation/item_component.rb +2 -2
  98. data/app/components/polaris/navigation/section_component.rb +2 -2
  99. data/app/components/polaris/navigation_component.rb +1 -1
  100. data/app/components/polaris/option_list/checkbox_component.rb +1 -1
  101. data/app/components/polaris/option_list/option_component.rb +1 -1
  102. data/app/components/polaris/option_list/radio_button_component.rb +1 -1
  103. data/app/components/polaris/option_list/section_component.rb +1 -1
  104. data/app/components/polaris/option_list_component.rb +1 -1
  105. data/app/components/polaris/page_actions_component.rb +1 -1
  106. data/app/components/polaris/page_component.rb +1 -1
  107. data/app/components/polaris/pagination_component.rb +1 -1
  108. data/app/components/polaris/popover/pane_component.rb +1 -1
  109. data/app/components/polaris/popover/section_component.rb +1 -1
  110. data/app/components/polaris/popover_component.rb +10 -4
  111. data/app/components/polaris/progress_bar_component.rb +1 -1
  112. data/app/components/polaris/radio_button_component.rb +1 -1
  113. data/app/components/polaris/resource_item_component.rb +4 -2
  114. data/app/components/polaris/resource_list_component.rb +1 -1
  115. data/app/components/polaris/scrollable_component.rb +1 -1
  116. data/app/components/polaris/select_component.rb +1 -1
  117. data/app/components/polaris/setting_toggle_component.rb +1 -1
  118. data/app/components/polaris/shopify_navigation_component.rb +2 -2
  119. data/app/components/polaris/skeleton_body_text_component.rb +1 -1
  120. data/app/components/polaris/skeleton_display_text_component.rb +32 -0
  121. data/app/components/polaris/skeleton_thumbnail_component.rb +31 -0
  122. data/app/components/polaris/spacer_component.rb +1 -1
  123. data/app/components/polaris/spinner_component.rb +1 -1
  124. data/app/components/polaris/stack/item_component.rb +15 -0
  125. data/app/components/polaris/stack_component.rb +2 -18
  126. data/app/components/polaris/subheading_component.rb +1 -1
  127. data/app/components/polaris/tabs/tab_component.rb +1 -1
  128. data/app/components/polaris/tabs_component.rb +1 -1
  129. data/app/components/polaris/tag_component.rb +3 -2
  130. data/app/components/polaris/text_container_component.rb +1 -1
  131. data/app/components/polaris/text_field_component.rb +2 -2
  132. data/app/components/polaris/text_style_component.rb +1 -1
  133. data/app/components/polaris/thumbnail_component.rb +1 -1
  134. data/app/components/polaris/toast_component.rb +1 -1
  135. data/app/components/polaris/top_bar/user_menu_component.rb +1 -1
  136. data/app/components/polaris/visually_hidden_component.rb +1 -1
  137. data/app/helpers/polaris/form_builder.rb +14 -5
  138. data/app/helpers/polaris/view_helper.rb +6 -1
  139. data/config/locales/en.yml +6 -0
  140. data/lib/polaris/view_components/engine.rb +5 -1
  141. data/lib/polaris/view_components/version.rb +1 -1
  142. metadata +31 -21
  143. data/app/components/polaris/application_component.rb +0 -35
  144. data/app/components/polaris/dropzone/component.html.erb +0 -72
  145. data/app/components/polaris/dropzone/component.rb +0 -128
  146. data/app/components/polaris/dropzone/controller.js +0 -226
  147. data/app/components/polaris/dropzone/utils.js +0 -57
  148. data/app/components/polaris/new_component.rb +0 -10
  149. data/app/helpers/polaris/conditional_helper.rb +0 -11
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polaris
4
- class ResourceListComponent < Polaris::NewComponent
4
+ class ResourceListComponent < Polaris::Component
5
5
  renders_one :filters, Polaris::FiltersComponent
6
6
 
7
7
  def initialize(
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polaris
4
- class ScrollableComponent < Polaris::NewComponent
4
+ class ScrollableComponent < Polaris::Component
5
5
  def initialize(
6
6
  height: nil,
7
7
  width: nil,
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polaris
4
- class SelectComponent < Polaris::NewComponent
4
+ class SelectComponent < Polaris::Component
5
5
  def initialize(
6
6
  options:,
7
7
  form: nil,
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polaris
4
- class SettingToggleComponent < Polaris::NewComponent
4
+ class SettingToggleComponent < Polaris::Component
5
5
  renders_one :action, ->(**system_arguments) do
6
6
  Polaris::ButtonComponent.new(primary: !@enabled, **system_arguments)
7
7
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polaris
4
- class ShopifyNavigationComponent < Polaris::NewComponent
4
+ class ShopifyNavigationComponent < Polaris::Component
5
5
  renders_many :links, ->(**system_arguments) do
6
6
  ShopifyNavigationLinkComponent.new(auto_detect_active: @auto_detect_active, **system_arguments)
7
7
  end
@@ -21,7 +21,7 @@ module Polaris
21
21
  links.any?
22
22
  end
23
23
 
24
- class ShopifyNavigationLinkComponent < Polaris::NewComponent
24
+ class ShopifyNavigationLinkComponent < Polaris::Component
25
25
  def initialize(url:, auto_detect_active:, active: false, **system_arguments)
26
26
  @url = url
27
27
  @auto_detect_active = auto_detect_active
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polaris
4
- class SkeletonBodyTextComponent < Polaris::NewComponent
4
+ class SkeletonBodyTextComponent < Polaris::Component
5
5
  def initialize(lines: 3, **system_arguments)
6
6
  @lines = lines
7
7
  @system_arguments = system_arguments
@@ -0,0 +1,32 @@
1
+ module Polaris
2
+ class SkeletonDisplayTextComponent < Polaris::Component
3
+ SIZE_DEFAULT = :medium
4
+ SIZE_MAPPINGS = {
5
+ small: "Polaris-SkeletonDisplayText--sizeSmall",
6
+ medium: "Polaris-SkeletonDisplayText--sizeMedium",
7
+ large: "Polaris-SkeletonDisplayText--sizeLarge",
8
+ extra_large: "Polaris-SkeletonDisplayText--sizeExtraLarge"
9
+ }
10
+ SIZE_OPTIONS = SIZE_MAPPINGS.keys
11
+
12
+ def initialize(size: SIZE_DEFAULT, **system_arguments)
13
+ @size = size
14
+ @system_arguments = system_arguments
15
+ end
16
+
17
+ def system_arguments
18
+ @system_arguments.tap do |opts|
19
+ opts[:tag] = "div"
20
+ opts[:classes] = class_names(
21
+ @system_arguments[:classes],
22
+ "Polaris-SkeletonDisplayText__DisplayText",
23
+ SIZE_MAPPINGS[fetch_or_fallback(SIZE_OPTIONS, @size, SIZE_DEFAULT)]
24
+ )
25
+ end
26
+ end
27
+
28
+ def call
29
+ render(Polaris::BaseComponent.new(**system_arguments))
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,31 @@
1
+ module Polaris
2
+ class SkeletonThumbnailComponent < Polaris::Component
3
+ SIZE_DEFAULT = :medium
4
+ SIZE_MAPPINGS = {
5
+ small: "Polaris-SkeletonThumbnail--sizeSmall",
6
+ medium: "Polaris-SkeletonThumbnail--sizeMedium",
7
+ large: "Polaris-SkeletonThumbnail--sizeLarge"
8
+ }
9
+ SIZE_OPTIONS = SIZE_MAPPINGS.keys
10
+
11
+ def initialize(size: SIZE_DEFAULT, **system_arguments)
12
+ @size = size
13
+ @system_arguments = system_arguments
14
+ end
15
+
16
+ def system_arguments
17
+ @system_arguments.tap do |opts|
18
+ opts[:tag] = "div"
19
+ opts[:classes] = class_names(
20
+ @system_arguments[:classes],
21
+ "Polaris-SkeletonThumbnail",
22
+ SIZE_MAPPINGS[fetch_or_fallback(SIZE_OPTIONS, @size, SIZE_DEFAULT)]
23
+ )
24
+ end
25
+ end
26
+
27
+ def call
28
+ render(Polaris::BaseComponent.new(**system_arguments))
29
+ end
30
+ end
31
+ end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polaris
4
- class SpacerComponent < Polaris::NewComponent
4
+ class SpacerComponent < Polaris::Component
5
5
  VERTICAL_SPACING_DEFAULT = :default
6
6
  VERTICAL_SPACING_MAPPINGS = {
7
7
  VERTICAL_SPACING_DEFAULT => "",
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polaris
4
- class SpinnerComponent < Polaris::NewComponent
4
+ class SpinnerComponent < Polaris::Component
5
5
  SIZE_DEFAULT = :large
6
6
  SIZE_MAPPINGS = {
7
7
  small: "Polaris-Spinner--sizeSmall",
@@ -0,0 +1,15 @@
1
+ class Polaris::Stack::ItemComponent < Polaris::Component
2
+ def initialize(fill: false, **system_arguments)
3
+ @system_arguments = system_arguments
4
+ @system_arguments[:tag] = "div"
5
+ @system_arguments[:classes] = class_names(
6
+ @system_arguments[:classes],
7
+ "Polaris-Stack__Item",
8
+ "Polaris-Stack__Item--fill": fill
9
+ )
10
+ end
11
+
12
+ def call
13
+ render(Polaris::BaseComponent.new(**@system_arguments)) { content }
14
+ end
15
+ end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polaris
4
- class StackComponent < Polaris::NewComponent
4
+ class StackComponent < Polaris::Component
5
5
  ALIGNMENT_DEFAULT = :default
6
6
  ALIGNMENT_MAPPINGS = {
7
7
  ALIGNMENT_DEFAULT => "",
@@ -37,7 +37,7 @@ module Polaris
37
37
  }
38
38
  SPACING_OPTIONS = SPACING_MAPPINGS.keys
39
39
 
40
- renders_many :items, "StackItemComponent"
40
+ renders_many :items, Polaris::Stack::ItemComponent
41
41
 
42
42
  def initialize(
43
43
  alignment: ALIGNMENT_DEFAULT,
@@ -59,21 +59,5 @@ module Polaris
59
59
  "Polaris-Stack--noWrap": !wrap
60
60
  )
61
61
  end
62
-
63
- class StackItemComponent < Polaris::NewComponent
64
- def initialize(fill: false, **system_arguments)
65
- @system_arguments = system_arguments
66
- @system_arguments[:tag] = "div"
67
- @system_arguments[:classes] = class_names(
68
- @system_arguments[:classes],
69
- "Polaris-Stack__Item",
70
- "Polaris-Stack__Item--fill": fill
71
- )
72
- end
73
-
74
- def call
75
- render(Polaris::BaseComponent.new(**@system_arguments)) { content }
76
- end
77
- end
78
62
  end
79
63
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polaris
4
- class SubheadingComponent < Polaris::NewComponent
4
+ class SubheadingComponent < Polaris::Component
5
5
  ELEMENT_DEFAULT = :h3
6
6
  ELEMENT_OPTIONS = %i[p h1 h2 h3 h4 h5 h6]
7
7
 
@@ -1,4 +1,4 @@
1
- class Polaris::Tabs::TabComponent < Polaris::NewComponent
1
+ class Polaris::Tabs::TabComponent < Polaris::Component
2
2
  renders_one :badge, Polaris::BadgeComponent
3
3
 
4
4
  def initialize(
@@ -1,5 +1,5 @@
1
1
  module Polaris
2
- class TabsComponent < Polaris::NewComponent
2
+ class TabsComponent < Polaris::Component
3
3
  renders_many :tabs, Polaris::Tabs::TabComponent
4
4
 
5
5
  def initialize(fitted: false, wrapper_arguments: {}, **system_arguments)
@@ -1,11 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polaris
4
- class TagComponent < Polaris::NewComponent
5
- renders_one :remove_button, ->(**system_arguments) do
4
+ class TagComponent < Polaris::Component
5
+ renders_one :remove_button, ->(type: :button, **system_arguments) do
6
6
  render Polaris::BaseButton.new(
7
7
  classes: "Polaris-Tag__Button",
8
8
  disabled: @disabled,
9
+ type: type,
9
10
  **system_arguments
10
11
  ) do |button|
11
12
  polaris_icon(name: "CancelSmallMinor")
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polaris
4
- class TextContainerComponent < Polaris::NewComponent
4
+ class TextContainerComponent < Polaris::Component
5
5
  SPACING_DEFAULT = :default
6
6
  SPACING_MAPPINGS = {
7
7
  SPACING_DEFAULT => "",
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polaris
4
- class TextFieldComponent < Polaris::NewComponent
4
+ class TextFieldComponent < Polaris::Component
5
5
  TYPE_DEFAULT = :text
6
6
  TYPE_OPTIONS = %i[
7
7
  text number email password search tel url date
@@ -180,7 +180,7 @@ module Polaris
180
180
  @type == :number && !@disabled
181
181
  end
182
182
 
183
- class Affix < Polaris::NewComponent
183
+ class Affix < Polaris::Component
184
184
  def initialize(icon: nil)
185
185
  @icon = icon
186
186
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polaris
4
- class TextStyleComponent < Polaris::NewComponent
4
+ class TextStyleComponent < Polaris::Component
5
5
  VARIATION_DEFAULT = :default
6
6
  VARIATION_MAPPINGS = {
7
7
  VARIATION_DEFAULT => "",
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polaris
4
- class ThumbnailComponent < Polaris::NewComponent
4
+ class ThumbnailComponent < Polaris::Component
5
5
  SIZE_DEFAULT = :medium
6
6
  SIZE_MAPPINGS = {
7
7
  small: "Polaris-Thumbnail--sizeSmall",
@@ -1,4 +1,4 @@
1
- class Polaris::ToastComponent < Polaris::NewComponent
1
+ class Polaris::ToastComponent < Polaris::Component
2
2
  renders_one :action, ->(**system_arguments) do
3
3
  Polaris::ButtonComponent.new(plain: true, monochrome: true, **system_arguments)
4
4
  end
@@ -1,4 +1,4 @@
1
- class Polaris::TopBar::UserMenuComponent < Polaris::NewComponent
1
+ class Polaris::TopBar::UserMenuComponent < Polaris::Component
2
2
  renders_one :avatar, Polaris::AvatarComponent
3
3
 
4
4
  def initialize(name:, detail:, **system_arguments)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polaris
4
- class VisuallyHiddenComponent < Polaris::NewComponent
4
+ class VisuallyHiddenComponent < Polaris::Component
5
5
  def initialize
6
6
  end
7
7
 
@@ -10,12 +10,13 @@ module Polaris
10
10
  return if object.blank?
11
11
  return unless object.errors.any?
12
12
 
13
- model_name = object.class.model_name.human.downcase
13
+ title = I18n.t(
14
+ "polaris.form_builder.errors_summary",
15
+ count: object.errors.count,
16
+ model: object.class.model_name.human.downcase
17
+ )
14
18
 
15
- render Polaris::BannerComponent.new(
16
- title: "There's #{pluralize(object.errors.count, "error")} with this #{model_name}:",
17
- status: :critical
18
- ) do
19
+ render Polaris::BannerComponent.new(title: title, status: :critical, within: :container) do
19
20
  render(Polaris::ListComponent.new) do |list|
20
21
  object.errors.full_messages.each do |error|
21
22
  list.item { error.html_safe }
@@ -75,5 +76,13 @@ module Polaris
75
76
  end
76
77
  render Polaris::RadioButtonComponent.new(form: self, attribute: method, **options, &block)
77
78
  end
79
+
80
+ def polaris_dropzone(method, **options, &block)
81
+ options[:error] ||= error_for(method)
82
+ if options[:error_hidden] && options[:error]
83
+ options[:error] = !!options[:error]
84
+ end
85
+ render Polaris::DropzoneComponent.new(form: self, attribute: method, **options, &block)
86
+ end
78
87
  end
79
88
  end
@@ -19,10 +19,11 @@ module Polaris
19
19
  checkbox: "Polaris::CheckboxComponent",
20
20
  check_box: "Polaris::CheckboxComponent",
21
21
  choice_list: "Polaris::ChoiceListComponent",
22
+ collapsible: "Polaris::CollapsibleComponent",
22
23
  data_table: "Polaris::DataTableComponent",
23
24
  description_list: "Polaris::DescriptionListComponent",
24
25
  display_text: "Polaris::DisplayTextComponent",
25
- dropzone: "Polaris::Dropzone::Component",
26
+ dropzone: "Polaris::DropzoneComponent",
26
27
  empty_state: "Polaris::EmptyStateComponent",
27
28
  exception_list: "Polaris::ExceptionListComponent",
28
29
  footer_help: "Polaris::FooterHelpComponent",
@@ -33,6 +34,7 @@ module Polaris
33
34
  icon: "Polaris::IconComponent",
34
35
  index_table: "Polaris::IndexTableComponent",
35
36
  inline_error: "Polaris::InlineErrorComponent",
37
+ keyboard_key: "Polaris::KeyboardKeyComponent",
36
38
  layout: "Polaris::LayoutComponent",
37
39
  link: "Polaris::LinkComponent",
38
40
  list: "Polaris::ListComponent",
@@ -51,10 +53,13 @@ module Polaris
51
53
  setting_toggle: "Polaris::SettingToggleComponent",
52
54
  shopify_navigation: "Polaris::ShopifyNavigationComponent",
53
55
  stack: "Polaris::StackComponent",
56
+ stack_item: "Polaris::Stack::ItemComponent",
54
57
  subheading: "Polaris::SubheadingComponent",
55
58
  scrollable: "Polaris::ScrollableComponent",
56
59
  spinner: "Polaris::SpinnerComponent",
57
60
  skeleton_body_text: "Polaris::SkeletonBodyTextComponent",
61
+ skeleton_display_text: "Polaris::SkeletonDisplayTextComponent",
62
+ skeleton_thumbnail: "Polaris::SkeletonThumbnailComponent",
58
63
  spacer: "Polaris::SpacerComponent",
59
64
  tabs: "Polaris::TabsComponent",
60
65
  tag: "Polaris::TagComponent",
@@ -0,0 +1,6 @@
1
+ en:
2
+ polaris:
3
+ form_builder:
4
+ errors_summary:
5
+ one: "There is 1 error with this %{model}:"
6
+ other: "There are %{count} errors with this %{model}:"
@@ -15,6 +15,11 @@ module Polaris
15
15
  #{root}/app/helpers
16
16
  ]
17
17
 
18
+ # Remove default wrapping .field_with_errors for proper Shopify form validations
19
+ config.to_prepare do
20
+ ActionView::Base.field_error_proc = ->(html_tag, _instance) { html_tag.html_safe }
21
+ end
22
+
18
23
  initializer "polaris_view_components.assets" do |app|
19
24
  if app.config.respond_to?(:assets)
20
25
  app.config.assets.precompile += %w[
@@ -33,7 +38,6 @@ module Polaris
33
38
  ActiveSupport.on_load(:action_controller_base) do
34
39
  helper Polaris::ViewHelper
35
40
  helper Polaris::UrlHelper
36
- helper Polaris::ConditionalHelper
37
41
  end
38
42
  end
39
43
  end
@@ -1,5 +1,5 @@
1
1
  module Polaris
2
2
  module ViewComponents
3
- VERSION = "0.7.0"
3
+ VERSION = "0.9.0"
4
4
  end
5
5
  end