polaris_view_components 0.3.3 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -3
  3. data/app/assets/javascripts/polaris_view_components/autocomplete_controller.js +119 -0
  4. data/app/assets/javascripts/polaris_view_components/button_controller.js +47 -0
  5. data/app/assets/javascripts/polaris_view_components/frame_controller.js +41 -0
  6. data/app/assets/javascripts/polaris_view_components/index.js +19 -1
  7. data/app/assets/javascripts/polaris_view_components/modal_controller.js +25 -0
  8. data/app/assets/javascripts/polaris_view_components/option_list_controller.js +41 -0
  9. data/app/assets/javascripts/polaris_view_components/polaris_controller.js +28 -0
  10. data/app/assets/javascripts/polaris_view_components/popover_controller.js +49 -0
  11. data/app/assets/javascripts/polaris_view_components/scrollable_controller.js +60 -0
  12. data/app/assets/javascripts/polaris_view_components/select_controller.js +6 -4
  13. data/app/assets/javascripts/polaris_view_components/text_field_controller.js +4 -0
  14. data/app/assets/javascripts/polaris_view_components/toast_controller.js +68 -0
  15. data/app/assets/javascripts/polaris_view_components.js +1936 -5
  16. data/app/assets/stylesheets/polaris_view_components/custom.css +109 -0
  17. data/app/assets/stylesheets/polaris_view_components/shopify_navigation.css +0 -4
  18. data/app/assets/stylesheets/polaris_view_components/spacer_component.css +39 -0
  19. data/app/assets/stylesheets/polaris_view_components.css +118 -3
  20. data/app/assets/stylesheets/polaris_view_components.postcss.css +2 -0
  21. data/app/components/polaris/action.rb +3 -3
  22. data/app/components/polaris/action_list/item_component.html.erb +35 -0
  23. data/app/components/polaris/action_list/item_component.rb +41 -0
  24. data/app/components/polaris/action_list/section_component.html.erb +16 -0
  25. data/app/components/polaris/action_list/section_component.rb +26 -0
  26. data/app/components/polaris/action_list_component.html.erb +13 -0
  27. data/app/components/polaris/action_list_component.rb +25 -0
  28. data/app/components/polaris/application_component.rb +19 -19
  29. data/app/components/polaris/autocomplete/action_component.rb +7 -0
  30. data/app/components/polaris/autocomplete/option_component.rb +35 -0
  31. data/app/components/polaris/autocomplete/section_component.html.erb +9 -0
  32. data/app/components/polaris/autocomplete/section_component.rb +12 -0
  33. data/app/components/polaris/autocomplete_component.html.erb +30 -0
  34. data/app/components/polaris/autocomplete_component.rb +58 -0
  35. data/app/components/polaris/avatar_component.rb +1 -1
  36. data/app/components/polaris/badge_component.rb +1 -1
  37. data/app/components/polaris/banner_component.rb +6 -6
  38. data/app/components/polaris/base_button.rb +1 -1
  39. data/app/components/polaris/base_checkbox.rb +48 -0
  40. data/app/components/polaris/base_radio_button.rb +38 -0
  41. data/app/components/polaris/button_component.html.erb +13 -0
  42. data/app/components/polaris/button_group_component.rb +5 -5
  43. data/app/components/polaris/callout_card_component.rb +5 -5
  44. data/app/components/polaris/caption_component.rb +2 -2
  45. data/app/components/polaris/card/header_component.rb +1 -3
  46. data/app/components/polaris/card/section_component.rb +6 -2
  47. data/app/components/polaris/card_component.html.erb +4 -0
  48. data/app/components/polaris/card_component.rb +5 -6
  49. data/app/components/polaris/character_count.rb +10 -10
  50. data/app/components/polaris/checkbox_component.html.erb +1 -5
  51. data/app/components/polaris/checkbox_component.rb +19 -12
  52. data/app/components/polaris/choice_component.rb +1 -1
  53. data/app/components/polaris/choice_list_component.rb +5 -5
  54. data/app/components/polaris/data_table/cell_component.html.erb +18 -0
  55. data/app/components/polaris/data_table/cell_component.rb +49 -0
  56. data/app/components/polaris/data_table/column_component.rb +19 -0
  57. data/app/components/polaris/data_table_component.html.erb +77 -0
  58. data/app/components/polaris/data_table_component.rb +42 -0
  59. data/app/components/polaris/description_list_component.rb +3 -3
  60. data/app/components/polaris/display_text_component.rb +2 -2
  61. data/app/components/polaris/dropzone/component.rb +36 -38
  62. data/app/components/polaris/empty_state_component.html.erb +16 -11
  63. data/app/components/polaris/empty_state_component.rb +4 -3
  64. data/app/components/polaris/exception_list/item_component.rb +2 -2
  65. data/app/components/polaris/exception_list_component.rb +1 -1
  66. data/app/components/polaris/filters_component.html.erb +35 -0
  67. data/app/components/polaris/filters_component.rb +91 -0
  68. data/app/components/polaris/footer_help_component.rb +1 -1
  69. data/app/components/polaris/form_layout/group_component.rb +3 -3
  70. data/app/components/polaris/form_layout/item_component.rb +1 -1
  71. data/app/components/polaris/form_layout_component.rb +3 -3
  72. data/app/components/polaris/frame/save_bar_component.html.erb +23 -0
  73. data/app/components/polaris/frame/save_bar_component.rb +31 -0
  74. data/app/components/polaris/frame/top_bar_component.html.erb +30 -0
  75. data/app/components/polaris/frame/top_bar_component.rb +18 -0
  76. data/app/components/polaris/frame_component.html.erb +44 -0
  77. data/app/components/polaris/frame_component.rb +33 -0
  78. data/app/components/polaris/heading_component.rb +1 -1
  79. data/app/components/polaris/headless_button.html.erb +13 -0
  80. data/app/components/polaris/headless_button.rb +17 -5
  81. data/app/components/polaris/icon_component.rb +2 -2
  82. data/app/components/polaris/index_table/cell_component.rb +22 -0
  83. data/app/components/polaris/index_table/column_component.rb +13 -0
  84. data/app/components/polaris/index_table_component.html.erb +28 -0
  85. data/app/components/polaris/index_table_component.rb +25 -0
  86. data/app/components/polaris/inline_error_component.html.erb +2 -2
  87. data/app/components/polaris/inline_error_component.rb +7 -1
  88. data/app/components/polaris/label_component.rb +2 -2
  89. data/app/components/polaris/labelled_component.rb +2 -2
  90. data/app/components/polaris/layout/annotated_section.rb +1 -1
  91. data/app/components/polaris/layout/section.rb +2 -0
  92. data/app/components/polaris/layout_component.rb +3 -3
  93. data/app/components/polaris/link_component.rb +5 -3
  94. data/app/components/polaris/list_component.rb +3 -3
  95. data/app/components/polaris/logo.rb +13 -0
  96. data/app/components/polaris/modal/section_component.rb +19 -0
  97. data/app/components/polaris/modal_component.html.erb +79 -0
  98. data/app/components/polaris/modal_component.rb +98 -0
  99. data/app/components/polaris/navigation/item_component.html.erb +31 -0
  100. data/app/components/polaris/navigation/item_component.rb +85 -0
  101. data/app/components/polaris/navigation/section_component.html.erb +17 -0
  102. data/app/components/polaris/navigation/section_component.rb +64 -0
  103. data/app/components/polaris/navigation_component.html.erb +29 -0
  104. data/app/components/polaris/navigation_component.rb +15 -0
  105. data/app/components/polaris/option_list/checkbox_component.html.erb +14 -0
  106. data/app/components/polaris/option_list/checkbox_component.rb +37 -0
  107. data/app/components/polaris/option_list/option_component.rb +24 -0
  108. data/app/components/polaris/option_list/radio_button_component.rb +54 -0
  109. data/app/components/polaris/option_list/section_component.html.erb +14 -0
  110. data/app/components/polaris/option_list/section_component.rb +53 -0
  111. data/app/components/polaris/option_list_component.html.erb +15 -0
  112. data/app/components/polaris/option_list_component.rb +67 -0
  113. data/app/components/polaris/page_actions_component.rb +21 -6
  114. data/app/components/polaris/page_component.rb +4 -4
  115. data/app/components/polaris/pagination_component.rb +1 -5
  116. data/app/components/polaris/popover/pane_component.html.erb +25 -0
  117. data/app/components/polaris/popover/pane_component.rb +20 -0
  118. data/app/components/polaris/popover/section_component.rb +19 -0
  119. data/app/components/polaris/popover_component.html.erb +31 -0
  120. data/app/components/polaris/popover_component.rb +107 -0
  121. data/app/components/polaris/progress_bar_component.rb +5 -5
  122. data/app/components/polaris/radio_button_component.html.erb +1 -6
  123. data/app/components/polaris/radio_button_component.rb +17 -7
  124. data/app/components/polaris/resource_item_component.html.erb +16 -6
  125. data/app/components/polaris/resource_item_component.rb +42 -9
  126. data/app/components/polaris/resource_list_component.html.erb +10 -0
  127. data/app/components/polaris/resource_list_component.rb +4 -10
  128. data/app/components/polaris/scrollable_component.html.erb +5 -0
  129. data/app/components/polaris/scrollable_component.rb +48 -0
  130. data/app/components/polaris/select_component.rb +10 -5
  131. data/app/components/polaris/setting_toggle_component.html.erb +10 -0
  132. data/app/components/polaris/setting_toggle_component.rb +24 -0
  133. data/app/components/polaris/shopify_navigation_component.rb +6 -6
  134. data/app/components/polaris/skeleton_body_text_component.rb +1 -1
  135. data/app/components/polaris/spacer_component.rb +50 -0
  136. data/app/components/polaris/spinner_component.rb +2 -2
  137. data/app/components/polaris/stack_component.rb +5 -5
  138. data/app/components/polaris/subheading_component.rb +1 -1
  139. data/app/components/polaris/tabs/tab_component.html.erb +10 -0
  140. data/app/components/polaris/tabs/tab_component.rb +34 -0
  141. data/app/components/polaris/tabs_component.html.erb +7 -0
  142. data/app/components/polaris/tabs_component.rb +37 -0
  143. data/app/components/polaris/tag_component.rb +2 -2
  144. data/app/components/polaris/text_container_component.rb +2 -2
  145. data/app/components/polaris/text_field_component.rb +24 -10
  146. data/app/components/polaris/text_style_component.rb +11 -2
  147. data/app/components/polaris/thumbnail_component.rb +2 -2
  148. data/app/components/polaris/toast_component.html.erb +21 -0
  149. data/app/components/polaris/toast_component.rb +40 -0
  150. data/app/components/polaris/top_bar/user_menu_component.html.erb +19 -0
  151. data/app/components/polaris/top_bar/user_menu_component.rb +9 -0
  152. data/app/helpers/polaris/form_builder.rb +31 -4
  153. data/app/helpers/polaris/url_helper.rb +3 -3
  154. data/app/helpers/polaris/view_helper.rb +37 -6
  155. data/app/validators/type_validator.rb +2 -2
  156. data/lib/generators/polaris_view_components/install_generator.rb +5 -5
  157. data/lib/polaris/view_components/engine.rb +11 -2
  158. data/lib/polaris/view_components/version.rb +1 -1
  159. data/lib/polaris_view_components.rb +1 -1
  160. metadata +88 -12
  161. data/app/components/polaris/choice_list/component.html.erb +0 -34
  162. data/app/components/polaris/choice_list/component.rb +0 -65
  163. data/app/helpers/polaris/action_helper.rb +0 -14
@@ -1,7 +1,12 @@
1
1
  module Polaris
2
2
  # Module to allow shorthand calls for Polaris components
3
3
  module ViewHelper
4
- HELPERS = {
4
+ # standard:disable Layout/HashAlignment
5
+ POLARIS_HELPERS = {
6
+ action_list: "Polaris::ActionListComponent",
7
+ autocomplete: "Polaris::AutocompleteComponent",
8
+ autocomplete_section: "Polaris::Autocomplete::SectionComponent",
9
+ autocomplete_option: "Polaris::Autocomplete::OptionComponent",
5
10
  avatar: "Polaris::AvatarComponent",
6
11
  badge: "Polaris::BadgeComponent",
7
12
  banner: "Polaris::BannerComponent",
@@ -10,8 +15,11 @@ module Polaris
10
15
  callout_card: "Polaris::CalloutCardComponent",
11
16
  caption: "Polaris::CaptionComponent",
12
17
  card: "Polaris::CardComponent",
18
+ card_section: "Polaris::Card::SectionComponent",
13
19
  checkbox: "Polaris::CheckboxComponent",
20
+ check_box: "Polaris::CheckboxComponent",
14
21
  choice_list: "Polaris::ChoiceListComponent",
22
+ data_table: "Polaris::DataTableComponent",
15
23
  description_list: "Polaris::DescriptionListComponent",
16
24
  display_text: "Polaris::DisplayTextComponent",
17
25
  dropzone: "Polaris::Dropzone::Component",
@@ -19,44 +27,63 @@ module Polaris
19
27
  exception_list: "Polaris::ExceptionListComponent",
20
28
  footer_help: "Polaris::FooterHelpComponent",
21
29
  form_layout: "Polaris::FormLayoutComponent",
30
+ frame: "Polaris::FrameComponent",
31
+ filters: "Polaris::FiltersComponent",
22
32
  heading: "Polaris::HeadingComponent",
23
33
  icon: "Polaris::IconComponent",
34
+ index_table: "Polaris::IndexTableComponent",
24
35
  inline_error: "Polaris::InlineErrorComponent",
25
36
  layout: "Polaris::LayoutComponent",
26
37
  link: "Polaris::LinkComponent",
27
38
  list: "Polaris::ListComponent",
39
+ modal: "Polaris::ModalComponent",
40
+ navigation: "Polaris::NavigationComponent",
41
+ option_list: "Polaris::OptionListComponent",
28
42
  page: "Polaris::PageComponent",
29
43
  page_actions: "Polaris::PageActionsComponent",
30
44
  pagination: "Polaris::PaginationComponent",
31
45
  progress_bar: "Polaris::ProgressBarComponent",
46
+ popover: "Polaris::PopoverComponent",
32
47
  radio_button: "Polaris::RadioButtonComponent",
33
48
  resource_list: "Polaris::ResourceListComponent",
34
49
  resource_item: "Polaris::ResourceItemComponent",
35
50
  select: "Polaris::SelectComponent",
51
+ setting_toggle: "Polaris::SettingToggleComponent",
36
52
  shopify_navigation: "Polaris::ShopifyNavigationComponent",
37
53
  stack: "Polaris::StackComponent",
38
54
  subheading: "Polaris::SubheadingComponent",
55
+ scrollable: "Polaris::ScrollableComponent",
39
56
  spinner: "Polaris::SpinnerComponent",
40
57
  skeleton_body_text: "Polaris::SkeletonBodyTextComponent",
58
+ spacer: "Polaris::SpacerComponent",
59
+ tabs: "Polaris::TabsComponent",
41
60
  tag: "Polaris::TagComponent",
42
61
  text_container: "Polaris::TextContainerComponent",
43
62
  text_field: "Polaris::TextFieldComponent",
44
63
  text_style: "Polaris::TextStyleComponent",
45
64
  thumbnail: "Polaris::ThumbnailComponent",
46
- visually_hidden: "Polaris::VisuallyHiddenComponent",
65
+ toast: "Polaris::ToastComponent",
66
+ visually_hidden: "Polaris::VisuallyHiddenComponent"
47
67
  }.freeze
48
-
49
- HELPERS.each do |name, component|
68
+ # standard:enable Layout/HashAlignment
69
+ POLARIS_HELPERS.each do |name, component|
50
70
  define_method "polaris_#{name}" do |*args, **kwargs, &block|
51
71
  render component.constantize.new(*args, **kwargs), &block
52
72
  end
53
73
  end
54
74
 
75
+ POLARIS_TEXT_STYLES = %i[subdued strong positive negative code].freeze
76
+ POLARIS_TEXT_STYLES.each do |name|
77
+ define_method "polaris_text_#{name}" do |**kwargs, &block|
78
+ polaris_text_style(variation: name, **kwargs, &block)
79
+ end
80
+ end
81
+
55
82
  def polaris_icon_source(name)
56
83
  path = ViewComponents::Engine.root.join("app", "assets", "icons", "polaris", "#{name}.svg")
57
84
  file = File.read(path)
58
85
  doc = Nokogiri::HTML::DocumentFragment.parse(file)
59
- svg = doc.at_css 'svg'
86
+ svg = doc.at_css "svg"
60
87
  svg[:class] = "Polaris-Icon__Svg"
61
88
  svg[:focusable] = false
62
89
  svg[:"aria-hidden"] = true
@@ -64,7 +91,11 @@ module Polaris
64
91
  end
65
92
 
66
93
  def polaris_body_styles
67
- %Q(background-color: rgb(246, 246, 247); color: rgb(32, 34, 35); --p-background:rgba(246, 246, 247, 1); --p-background-hovered:rgba(241, 242, 243, 1); --p-background-pressed:rgba(237, 238, 239, 1); --p-background-selected:rgba(237, 238, 239, 1); --p-surface:rgba(255, 255, 255, 1); --p-surface-neutral:rgba(228, 229, 231, 1); --p-surface-neutral-hovered:rgba(219, 221, 223, 1); --p-surface-neutral-pressed:rgba(201, 204, 208, 1); --p-surface-neutral-disabled:rgba(241, 242, 243, 1); --p-surface-neutral-subdued:rgba(246, 246, 247, 1); --p-surface-subdued:rgba(250, 251, 251, 1); --p-surface-disabled:rgba(250, 251, 251, 1); --p-surface-hovered:rgba(246, 246, 247, 1); --p-surface-pressed:rgba(241, 242, 243, 1); --p-surface-depressed:rgba(237, 238, 239, 1); --p-backdrop:rgba(0, 0, 0, 0.5); --p-overlay:rgba(255, 255, 255, 0.5); --p-shadow-from-dim-light:rgba(0, 0, 0, 0.2); --p-shadow-from-ambient-light:rgba(23, 24, 24, 0.05); --p-shadow-from-direct-light:rgba(0, 0, 0, 0.15); --p-hint-from-direct-light:rgba(0, 0, 0, 0.15); --p-on-surface-background:rgba(241, 242, 243, 1); --p-border:rgba(140, 145, 150, 1); --p-border-neutral-subdued:rgba(186, 191, 195, 1); --p-border-hovered:rgba(153, 158, 164, 1); --p-border-disabled:rgba(210, 213, 216, 1); --p-border-subdued:rgba(201, 204, 207, 1); --p-border-depressed:rgba(87, 89, 89, 1); --p-border-shadow:rgba(174, 180, 185, 1); --p-border-shadow-subdued:rgba(186, 191, 196, 1); --p-divider:rgba(225, 227, 229, 1); --p-icon:rgba(92, 95, 98, 1); --p-icon-hovered:rgba(26, 28, 29, 1); --p-icon-pressed:rgba(68, 71, 74, 1); --p-icon-disabled:rgba(186, 190, 195, 1); --p-icon-subdued:rgba(140, 145, 150, 1); --p-text:rgba(32, 34, 35, 1); --p-text-disabled:rgba(140, 145, 150, 1); --p-text-subdued:rgba(109, 113, 117, 1); --p-interactive:rgba(44, 110, 203, 1); --p-interactive-disabled:rgba(189, 193, 204, 1); --p-interactive-hovered:rgba(31, 81, 153, 1); --p-interactive-pressed:rgba(16, 50, 98, 1); --p-focused:rgba(69, 143, 255, 1); --p-surface-selected:rgba(242, 247, 254, 1); --p-surface-selected-hovered:rgba(237, 244, 254, 1); --p-surface-selected-pressed:rgba(229, 239, 253, 1); --p-icon-on-interactive:rgba(255, 255, 255, 1); --p-text-on-interactive:rgba(255, 255, 255, 1); --p-action-secondary:rgba(255, 255, 255, 1); --p-action-secondary-disabled:rgba(255, 255, 255, 1); --p-action-secondary-hovered:rgba(246, 246, 247, 1); --p-action-secondary-pressed:rgba(241, 242, 243, 1); --p-action-secondary-depressed:rgba(109, 113, 117, 1); --p-action-primary:rgba(0, 128, 96, 1); --p-action-primary-disabled:rgba(241, 241, 241, 1); --p-action-primary-hovered:rgba(0, 110, 82, 1); --p-action-primary-pressed:rgba(0, 94, 70, 1); --p-action-primary-depressed:rgba(0, 61, 44, 1); --p-icon-on-primary:rgba(255, 255, 255, 1); --p-text-on-primary:rgba(255, 255, 255, 1); --p-text-primary:rgba(0, 123, 92, 1); --p-text-primary-hovered:rgba(0, 108, 80, 1); --p-text-primary-pressed:rgba(0, 92, 68, 1); --p-surface-primary-selected:rgba(241, 248, 245, 1); --p-surface-primary-selected-hovered:rgba(179, 208, 195, 1); --p-surface-primary-selected-pressed:rgba(162, 188, 176, 1); --p-border-critical:rgba(253, 87, 73, 1); --p-border-critical-subdued:rgba(224, 179, 178, 1); --p-border-critical-disabled:rgba(255, 167, 163, 1); --p-icon-critical:rgba(215, 44, 13, 1); --p-surface-critical:rgba(254, 211, 209, 1); --p-surface-critical-subdued:rgba(255, 244, 244, 1); --p-surface-critical-subdued-hovered:rgba(255, 240, 240, 1); --p-surface-critical-subdued-pressed:rgba(255, 233, 232, 1); --p-surface-critical-subdued-depressed:rgba(254, 188, 185, 1); --p-text-critical:rgba(215, 44, 13, 1); --p-action-critical:rgba(216, 44, 13, 1); --p-action-critical-disabled:rgba(241, 241, 241, 1); --p-action-critical-hovered:rgba(188, 34, 0, 1); --p-action-critical-pressed:rgba(162, 27, 0, 1); --p-action-critical-depressed:rgba(108, 15, 0, 1); --p-icon-on-critical:rgba(255, 255, 255, 1); --p-text-on-critical:rgba(255, 255, 255, 1); --p-interactive-critical:rgba(216, 44, 13, 1); --p-interactive-critical-disabled:rgba(253, 147, 141, 1); --p-interactive-critical-hovered:rgba(205, 41, 12, 1); --p-interactive-critical-pressed:rgba(103, 15, 3, 1); --p-border-warning:rgba(185, 137, 0, 1); --p-border-warning-subdued:rgba(225, 184, 120, 1); --p-icon-warning:rgba(185, 137, 0, 1); --p-surface-warning:rgba(255, 215, 157, 1); --p-surface-warning-subdued:rgba(255, 245, 234, 1); --p-surface-warning-subdued-hovered:rgba(255, 242, 226, 1); --p-surface-warning-subdued-pressed:rgba(255, 235, 211, 1); --p-text-warning:rgba(145, 106, 0, 1); --p-border-highlight:rgba(68, 157, 167, 1); --p-border-highlight-subdued:rgba(152, 198, 205, 1); --p-icon-highlight:rgba(0, 160, 172, 1); --p-surface-highlight:rgba(164, 232, 242, 1); --p-surface-highlight-subdued:rgba(235, 249, 252, 1); --p-surface-highlight-subdued-hovered:rgba(228, 247, 250, 1); --p-surface-highlight-subdued-pressed:rgba(213, 243, 248, 1); --p-text-highlight:rgba(52, 124, 132, 1); --p-border-success:rgba(0, 164, 124, 1); --p-border-success-subdued:rgba(149, 201, 180, 1); --p-icon-success:rgba(0, 127, 95, 1); --p-surface-success:rgba(174, 233, 209, 1); --p-surface-success-subdued:rgba(241, 248, 245, 1); --p-surface-success-subdued-hovered:rgba(236, 246, 241, 1); --p-surface-success-subdued-pressed:rgba(226, 241, 234, 1); --p-text-success:rgba(0, 128, 96, 1); --p-decorative-one-icon:rgba(126, 87, 0, 1); --p-decorative-one-surface:rgba(255, 201, 107, 1); --p-decorative-one-text:rgba(61, 40, 0, 1); --p-decorative-two-icon:rgba(175, 41, 78, 1); --p-decorative-two-surface:rgba(255, 196, 176, 1); --p-decorative-two-text:rgba(73, 11, 28, 1); --p-decorative-three-icon:rgba(0, 109, 65, 1); --p-decorative-three-surface:rgba(146, 230, 181, 1); --p-decorative-three-text:rgba(0, 47, 25, 1); --p-decorative-four-icon:rgba(0, 106, 104, 1); --p-decorative-four-surface:rgba(145, 224, 214, 1); --p-decorative-four-text:rgba(0, 45, 45, 1); --p-decorative-five-icon:rgba(174, 43, 76, 1); --p-decorative-five-surface:rgba(253, 201, 208, 1); --p-decorative-five-text:rgba(79, 14, 31, 1); --p-border-radius-base:0.4rem; --p-border-radius-wide:0.8rem; --p-border-radius-full:50%; --p-card-shadow:0px 0px 5px var(--p-shadow-from-ambient-light), 0px 1px 2px var(--p-shadow-from-direct-light); --p-popover-shadow:-1px 0px 20px var(--p-shadow-from-ambient-light), 0px 1px 5px var(--p-shadow-from-direct-light); --p-modal-shadow:0px 26px 80px var(--p-shadow-from-dim-light), 0px 0px 1px var(--p-shadow-from-dim-light); --p-top-bar-shadow:0 2px 2px -1px var(--p-shadow-from-direct-light); --p-button-drop-shadow:0 1px 0 rgba(0, 0, 0, 0.05); --p-button-inner-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.2); --p-button-pressed-inner-shadow:inset 0 1px 0 rgba(0, 0, 0, 0.15); --p-override-none:none; --p-override-transparent:transparent; --p-override-one:1; --p-override-visible:visible; --p-override-zero:0; --p-override-loading-z-index:514; --p-button-font-weight:500; --p-non-null-content:''; --p-choice-size:2rem; --p-icon-size:1rem; --p-choice-margin:0.1rem; --p-control-border-width:0.2rem; --p-banner-border-default:inset 0 0.1rem 0 0 var(--p-border-neutral-subdued), inset 0 0 0 0.1rem var(--p-border-neutral-subdued); --p-banner-border-success:inset 0 0.1rem 0 0 var(--p-border-success-subdued), inset 0 0 0 0.1rem var(--p-border-success-subdued); --p-banner-border-highlight:inset 0 0.1rem 0 0 var(--p-border-highlight-subdued), inset 0 0 0 0.1rem var(--p-border-highlight-subdued); --p-banner-border-warning:inset 0 0.1rem 0 0 var(--p-border-warning-subdued), inset 0 0 0 0.1rem var(--p-border-warning-subdued); --p-banner-border-critical:inset 0 0.1rem 0 0 var(--p-border-critical-subdued), inset 0 0 0 0.1rem var(--p-border-critical-subdued); --p-badge-mix-blend-mode:luminosity; --p-thin-border-subdued:0.1rem solid var(--p-border-subdued); --p-text-field-spinner-offset:0.2rem; --p-text-field-focus-ring-offset:-0.4rem; --p-text-field-focus-ring-border-radius:0.7rem; --p-button-group-item-spacing:-0.1rem; --p-duration-1-0-0:100ms; --p-duration-1-5-0:150ms; --p-ease-in:cubic-bezier(0.5, 0.1, 1, 1); --p-ease:cubic-bezier(0.4, 0.22, 0.28, 1); --p-range-slider-thumb-size-base:1.6rem; --p-range-slider-thumb-size-active:2.4rem; --p-range-slider-thumb-scale:1.5; --p-badge-font-weight:400; --p-frame-offset:0px;)
94
+ %(background-color: rgb(246, 246, 247); color: rgb(32, 34, 35); --p-background:rgba(246, 246, 247, 1); --p-background-hovered:rgba(241, 242, 243, 1); --p-background-pressed:rgba(237, 238, 239, 1); --p-background-selected:rgba(237, 238, 239, 1); --p-surface:rgba(255, 255, 255, 1); --p-surface-neutral:rgba(228, 229, 231, 1); --p-surface-neutral-hovered:rgba(219, 221, 223, 1); --p-surface-neutral-pressed:rgba(201, 204, 208, 1); --p-surface-neutral-disabled:rgba(241, 242, 243, 1); --p-surface-neutral-subdued:rgba(246, 246, 247, 1); --p-surface-subdued:rgba(250, 251, 251, 1); --p-surface-disabled:rgba(250, 251, 251, 1); --p-surface-hovered:rgba(246, 246, 247, 1); --p-surface-pressed:rgba(241, 242, 243, 1); --p-surface-depressed:rgba(237, 238, 239, 1); --p-backdrop:rgba(0, 0, 0, 0.5); --p-overlay:rgba(255, 255, 255, 0.5); --p-shadow-from-dim-light:rgba(0, 0, 0, 0.2); --p-shadow-from-ambient-light:rgba(23, 24, 24, 0.05); --p-shadow-from-direct-light:rgba(0, 0, 0, 0.15); --p-hint-from-direct-light:rgba(0, 0, 0, 0.15); --p-on-surface-background:rgba(241, 242, 243, 1); --p-border:rgba(140, 145, 150, 1); --p-border-neutral-subdued:rgba(186, 191, 195, 1); --p-border-hovered:rgba(153, 158, 164, 1); --p-border-disabled:rgba(210, 213, 216, 1); --p-border-subdued:rgba(201, 204, 207, 1); --p-border-depressed:rgba(87, 89, 89, 1); --p-border-shadow:rgba(174, 180, 185, 1); --p-border-shadow-subdued:rgba(186, 191, 196, 1); --p-divider:rgba(225, 227, 229, 1); --p-icon:rgba(92, 95, 98, 1); --p-icon-hovered:rgba(26, 28, 29, 1); --p-icon-pressed:rgba(68, 71, 74, 1); --p-icon-disabled:rgba(186, 190, 195, 1); --p-icon-subdued:rgba(140, 145, 150, 1); --p-text:rgba(32, 34, 35, 1); --p-text-disabled:rgba(140, 145, 150, 1); --p-text-subdued:rgba(109, 113, 117, 1); --p-interactive:rgba(44, 110, 203, 1); --p-interactive-disabled:rgba(189, 193, 204, 1); --p-interactive-hovered:rgba(31, 81, 153, 1); --p-interactive-pressed:rgba(16, 50, 98, 1); --p-focused:rgba(69, 143, 255, 1); --p-surface-selected:rgba(242, 247, 254, 1); --p-surface-selected-hovered:rgba(237, 244, 254, 1); --p-surface-selected-pressed:rgba(229, 239, 253, 1); --p-icon-on-interactive:rgba(255, 255, 255, 1); --p-text-on-interactive:rgba(255, 255, 255, 1); --p-action-secondary:rgba(255, 255, 255, 1); --p-action-secondary-disabled:rgba(255, 255, 255, 1); --p-action-secondary-hovered:rgba(246, 246, 247, 1); --p-action-secondary-pressed:rgba(241, 242, 243, 1); --p-action-secondary-depressed:rgba(109, 113, 117, 1); --p-action-primary:rgba(0, 128, 96, 1); --p-action-primary-disabled:rgba(241, 241, 241, 1); --p-action-primary-hovered:rgba(0, 110, 82, 1); --p-action-primary-pressed:rgba(0, 94, 70, 1); --p-action-primary-depressed:rgba(0, 61, 44, 1); --p-icon-on-primary:rgba(255, 255, 255, 1); --p-text-on-primary:rgba(255, 255, 255, 1); --p-text-primary:rgba(0, 123, 92, 1); --p-text-primary-hovered:rgba(0, 108, 80, 1); --p-text-primary-pressed:rgba(0, 92, 68, 1); --p-surface-primary-selected:rgba(241, 248, 245, 1); --p-surface-primary-selected-hovered:rgba(179, 208, 195, 1); --p-surface-primary-selected-pressed:rgba(162, 188, 176, 1); --p-border-critical:rgba(253, 87, 73, 1); --p-border-critical-subdued:rgba(224, 179, 178, 1); --p-border-critical-disabled:rgba(255, 167, 163, 1); --p-icon-critical:rgba(215, 44, 13, 1); --p-surface-critical:rgba(254, 211, 209, 1); --p-surface-critical-subdued:rgba(255, 244, 244, 1); --p-surface-critical-subdued-hovered:rgba(255, 240, 240, 1); --p-surface-critical-subdued-pressed:rgba(255, 233, 232, 1); --p-surface-critical-subdued-depressed:rgba(254, 188, 185, 1); --p-text-critical:rgba(215, 44, 13, 1); --p-action-critical:rgba(216, 44, 13, 1); --p-action-critical-disabled:rgba(241, 241, 241, 1); --p-action-critical-hovered:rgba(188, 34, 0, 1); --p-action-critical-pressed:rgba(162, 27, 0, 1); --p-action-critical-depressed:rgba(108, 15, 0, 1); --p-icon-on-critical:rgba(255, 255, 255, 1); --p-text-on-critical:rgba(255, 255, 255, 1); --p-interactive-critical:rgba(216, 44, 13, 1); --p-interactive-critical-disabled:rgba(253, 147, 141, 1); --p-interactive-critical-hovered:rgba(205, 41, 12, 1); --p-interactive-critical-pressed:rgba(103, 15, 3, 1); --p-border-warning:rgba(185, 137, 0, 1); --p-border-warning-subdued:rgba(225, 184, 120, 1); --p-icon-warning:rgba(185, 137, 0, 1); --p-surface-warning:rgba(255, 215, 157, 1); --p-surface-warning-subdued:rgba(255, 245, 234, 1); --p-surface-warning-subdued-hovered:rgba(255, 242, 226, 1); --p-surface-warning-subdued-pressed:rgba(255, 235, 211, 1); --p-text-warning:rgba(145, 106, 0, 1); --p-border-highlight:rgba(68, 157, 167, 1); --p-border-highlight-subdued:rgba(152, 198, 205, 1); --p-icon-highlight:rgba(0, 160, 172, 1); --p-surface-highlight:rgba(164, 232, 242, 1); --p-surface-highlight-subdued:rgba(235, 249, 252, 1); --p-surface-highlight-subdued-hovered:rgba(228, 247, 250, 1); --p-surface-highlight-subdued-pressed:rgba(213, 243, 248, 1); --p-text-highlight:rgba(52, 124, 132, 1); --p-border-success:rgba(0, 164, 124, 1); --p-border-success-subdued:rgba(149, 201, 180, 1); --p-icon-success:rgba(0, 127, 95, 1); --p-surface-success:rgba(174, 233, 209, 1); --p-surface-success-subdued:rgba(241, 248, 245, 1); --p-surface-success-subdued-hovered:rgba(236, 246, 241, 1); --p-surface-success-subdued-pressed:rgba(226, 241, 234, 1); --p-text-success:rgba(0, 128, 96, 1); --p-decorative-one-icon:rgba(126, 87, 0, 1); --p-decorative-one-surface:rgba(255, 201, 107, 1); --p-decorative-one-text:rgba(61, 40, 0, 1); --p-decorative-two-icon:rgba(175, 41, 78, 1); --p-decorative-two-surface:rgba(255, 196, 176, 1); --p-decorative-two-text:rgba(73, 11, 28, 1); --p-decorative-three-icon:rgba(0, 109, 65, 1); --p-decorative-three-surface:rgba(146, 230, 181, 1); --p-decorative-three-text:rgba(0, 47, 25, 1); --p-decorative-four-icon:rgba(0, 106, 104, 1); --p-decorative-four-surface:rgba(145, 224, 214, 1); --p-decorative-four-text:rgba(0, 45, 45, 1); --p-decorative-five-icon:rgba(174, 43, 76, 1); --p-decorative-five-surface:rgba(253, 201, 208, 1); --p-decorative-five-text:rgba(79, 14, 31, 1); --p-border-radius-base:0.4rem; --p-border-radius-wide:0.8rem; --p-border-radius-full:50%; --p-card-shadow:0px 0px 5px var(--p-shadow-from-ambient-light), 0px 1px 2px var(--p-shadow-from-direct-light); --p-popover-shadow:-1px 0px 20px var(--p-shadow-from-ambient-light), 0px 1px 5px var(--p-shadow-from-direct-light); --p-modal-shadow:0px 26px 80px var(--p-shadow-from-dim-light), 0px 0px 1px var(--p-shadow-from-dim-light); --p-top-bar-shadow:0 2px 2px -1px var(--p-shadow-from-direct-light); --p-button-drop-shadow:0 1px 0 rgba(0, 0, 0, 0.05); --p-button-inner-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.2); --p-button-pressed-inner-shadow:inset 0 1px 0 rgba(0, 0, 0, 0.15); --p-override-none:none; --p-override-transparent:transparent; --p-override-one:1; --p-override-visible:visible; --p-override-zero:0; --p-override-loading-z-index:514; --p-button-font-weight:500; --p-non-null-content:''; --p-choice-size:2rem; --p-icon-size:1rem; --p-choice-margin:0.1rem; --p-control-border-width:0.2rem; --p-banner-border-default:inset 0 0.1rem 0 0 var(--p-border-neutral-subdued), inset 0 0 0 0.1rem var(--p-border-neutral-subdued); --p-banner-border-success:inset 0 0.1rem 0 0 var(--p-border-success-subdued), inset 0 0 0 0.1rem var(--p-border-success-subdued); --p-banner-border-highlight:inset 0 0.1rem 0 0 var(--p-border-highlight-subdued), inset 0 0 0 0.1rem var(--p-border-highlight-subdued); --p-banner-border-warning:inset 0 0.1rem 0 0 var(--p-border-warning-subdued), inset 0 0 0 0.1rem var(--p-border-warning-subdued); --p-banner-border-critical:inset 0 0.1rem 0 0 var(--p-border-critical-subdued), inset 0 0 0 0.1rem var(--p-border-critical-subdued); --p-badge-mix-blend-mode:luminosity; --p-thin-border-subdued:0.1rem solid var(--p-border-subdued); --p-text-field-spinner-offset:0.2rem; --p-text-field-focus-ring-offset:-0.4rem; --p-text-field-focus-ring-border-radius:0.7rem; --p-button-group-item-spacing:-0.1rem; --p-duration-1-0-0:100ms; --p-duration-1-5-0:150ms; --p-ease-in:cubic-bezier(0.5, 0.1, 1, 1); --p-ease:cubic-bezier(0.4, 0.22, 0.28, 1); --p-range-slider-thumb-size-base:1.6rem; --p-range-slider-thumb-size-active:2.4rem; --p-range-slider-thumb-scale:1.5; --p-badge-font-weight:400; --p-frame-offset:0px;)
95
+ end
96
+
97
+ def polaris_inversed_colors
98
+ %(--p-background:rgba(11, 12, 13, 1); --p-background-hovered:rgba(11, 12, 13, 1); --p-background-pressed:rgba(11, 12, 13, 1); --p-background-selected:rgba(11, 12, 13, 1); --p-surface:rgba(32, 33, 35, 1); --p-surface-neutral:rgba(49, 51, 53, 1); --p-surface-neutral-hovered:rgba(49, 51, 53, 1); --p-surface-neutral-pressed:rgba(49, 51, 53, 1); --p-surface-neutral-disabled:rgba(49, 51, 53, 1); --p-surface-neutral-subdued:rgba(68, 71, 74, 1); --p-surface-subdued:rgba(26, 28, 29, 1); --p-surface-disabled:rgba(26, 28, 29, 1); --p-surface-hovered:rgba(47, 49, 51, 1); --p-surface-pressed:rgba(62, 64, 67, 1); --p-surface-depressed:rgba(80, 83, 86, 1); --p-surface-search-field:rgba(47, 49, 51, 1); --p-backdrop:rgba(0, 0, 0, 0.5); --p-overlay:rgba(33, 33, 33, 0.5); --p-shadow-from-dim-light:rgba(255, 255, 255, 0.2); --p-shadow-from-ambient-light:rgba(23, 24, 24, 0.05); --p-shadow-from-direct-light:rgba(255, 255, 255, 0.15); --p-hint-from-direct-light:rgba(185, 185, 185, 0.2); --p-border:rgba(80, 83, 86, 1); --p-border-neutral-subdued:rgba(130, 135, 139, 1); --p-border-hovered:rgba(80, 83, 86, 1); --p-border-disabled:rgba(103, 107, 111, 1); --p-border-subdued:rgba(130, 135, 139, 1); --p-border-depressed:rgba(142, 145, 145, 1); --p-border-shadow:rgba(91, 95, 98, 1); --p-border-shadow-subdued:rgba(130, 135, 139, 1); --p-divider:rgba(69, 71, 73, 1); --p-icon:rgba(166, 172, 178, 1); --p-icon-hovered:rgba(225, 227, 229, 1); --p-icon-pressed:rgba(166, 172, 178, 1); --p-icon-disabled:rgba(84, 87, 90, 1); --p-icon-subdued:rgba(120, 125, 129, 1); --p-text:rgba(227, 229, 231, 1); --p-text-disabled:rgba(111, 115, 119, 1); --p-text-subdued:rgba(153, 159, 164, 1); --p-interactive:rgba(54, 163, 255, 1); --p-interactive-disabled:rgba(38, 98, 182, 1); --p-interactive-hovered:rgba(103, 175, 255, 1); --p-interactive-pressed:rgba(136, 188, 255, 1); --p-icon-interactive:rgba(54, 163, 255, 1); --p-focused:rgba(38, 98, 182, 1); --p-surface-selected:rgba(2, 14, 35, 1); --p-surface-selected-hovered:rgba(7, 29, 61, 1); --p-surface-selected-pressed:rgba(13, 43, 86, 1); --p-icon-on-interactive:rgba(255, 255, 255, 1); --p-text-on-interactive:rgba(255, 255, 255, 1); --p-action-secondary:rgba(77, 80, 83, 1); --p-action-secondary-disabled:rgba(32, 34, 35, 1); --p-action-secondary-hovered:rgba(84, 87, 91, 1); --p-action-secondary-pressed:rgba(96, 100, 103, 1); --p-action-secondary-depressed:rgba(123, 127, 132, 1); --p-action-primary:rgba(0, 128, 96, 1); --p-action-primary-disabled:rgba(0, 86, 64, 1); --p-action-primary-hovered:rgba(0, 150, 113, 1); --p-action-primary-pressed:rgba(0, 164, 124, 1); --p-action-primary-depressed:rgba(0, 179, 136, 1); --p-icon-on-primary:rgba(230, 255, 244, 1); --p-text-on-primary:rgba(255, 255, 255, 1); --p-text-primary:rgba(0, 141, 106, 1); --p-text-primary-hovered:rgba(0, 158, 120, 1); --p-text-primary-pressed:rgba(0, 176, 133, 1); --p-surface-primary-selected:rgba(12, 18, 16, 1); --p-surface-primary-selected-hovered:rgba(40, 48, 44, 1); --p-surface-primary-selected-pressed:rgba(54, 64, 59, 1); --p-border-critical:rgba(227, 47, 14, 1); --p-border-critical-subdued:rgba(227, 47, 14, 1); --p-border-critical-disabled:rgba(131, 23, 4, 1); --p-icon-critical:rgba(218, 45, 13, 1); --p-surface-critical:rgba(69, 7, 1, 1); --p-surface-critical-subdued:rgba(69, 7, 1, 1); --p-surface-critical-subdued-hovered:rgba(68, 23, 20, 1); --p-surface-critical-subdued-pressed:rgba(107, 16, 3, 1); --p-surface-critical-subdued-depressed:rgba(135, 24, 5, 1); --p-text-critical:rgba(233, 128, 122, 1); --p-action-critical:rgba(205, 41, 12, 1); --p-action-critical-disabled:rgba(187, 37, 10, 1); --p-action-critical-hovered:rgba(227, 47, 14, 1); --p-action-critical-pressed:rgba(250, 53, 17, 1); --p-action-critical-depressed:rgba(253, 87, 73, 1); --p-icon-on-critical:rgba(255, 248, 247, 1); --p-text-on-critical:rgba(255, 255, 255, 1); --p-interactive-critical:rgba(253, 114, 106, 1); --p-interactive-critical-disabled:rgba(254, 172, 168, 1); --p-interactive-critical-hovered:rgba(253, 138, 132, 1); --p-interactive-critical-pressed:rgba(253, 159, 155, 1); --p-border-warning:rgba(153, 112, 0, 1); --p-border-warning-subdued:rgba(153, 112, 0, 1); --p-icon-warning:rgba(104, 75, 0, 1); --p-surface-warning:rgba(153, 112, 0, 1); --p-surface-warning-subdued:rgba(77, 59, 29, 1); --p-surface-warning-subdued-hovered:rgba(82, 63, 32, 1); --p-surface-warning-subdued-pressed:rgba(87, 67, 34, 1); --p-text-warning:rgba(202, 149, 0, 1); --p-border-highlight:rgba(68, 157, 167, 1); --p-border-highlight-subdued:rgba(68, 157, 167, 1); --p-icon-highlight:rgba(44, 108, 115, 1); --p-surface-highlight:rgba(0, 105, 113, 1); --p-surface-highlight-subdued:rgba(18, 53, 57, 1); --p-surface-highlight-subdued-hovered:rgba(20, 58, 62, 1); --p-surface-highlight-subdued-pressed:rgba(24, 65, 70, 1); --p-text-highlight:rgba(162, 239, 250, 1); --p-border-success:rgba(0, 135, 102, 1); --p-border-success-subdued:rgba(0, 135, 102, 1); --p-icon-success:rgba(0, 94, 70, 1); --p-surface-success:rgba(0, 94, 70, 1); --p-surface-success-subdued:rgba(28, 53, 44, 1); --p-surface-success-subdued-hovered:rgba(31, 58, 48, 1); --p-surface-success-subdued-pressed:rgba(35, 65, 54, 1); --p-text-success:rgba(88, 173, 142, 1); --p-decorative-one-icon:rgba(255, 186, 67, 1); --p-decorative-one-surface:rgba(142, 102, 9, 1); --p-decorative-one-text:rgba(255, 255, 255, 1); --p-decorative-two-icon:rgba(245, 182, 192, 1); --p-decorative-two-surface:rgba(206, 88, 20, 1); --p-decorative-two-text:rgba(255, 255, 255, 1); --p-decorative-three-icon:rgba(0, 227, 141, 1); --p-decorative-three-surface:rgba(0, 124, 90, 1); --p-decorative-three-text:rgba(255, 255, 255, 1); --p-decorative-four-icon:rgba(0, 221, 218, 1); --p-decorative-four-surface:rgba(22, 124, 121, 1); --p-decorative-four-text:rgba(255, 255, 255, 1); --p-decorative-five-icon:rgba(244, 183, 191, 1); --p-decorative-five-surface:rgba(194, 51, 86, 1); --p-decorative-five-text:rgba(255, 255, 255, 1); --p-border-radius-slim:0.2rem; --p-border-radius-base:0.4rem; --p-border-radius-wide:0.8rem; --p-border-radius-full:50%; --p-card-shadow:0px 0px 5px var(--p-shadow-from-ambient-light), 0px 1px 2px var(--p-shadow-from-direct-light); --p-popover-shadow:-1px 0px 20px var(--p-shadow-from-ambient-light), 0px 1px 5px var(--p-shadow-from-direct-light); --p-modal-shadow:0px 26px 80px var(--p-shadow-from-dim-light), 0px 0px 1px var(--p-shadow-from-dim-light); --p-top-bar-shadow:0 2px 2px -1px var(--p-shadow-from-direct-light); --p-button-drop-shadow:0 1px 0 rgba(0, 0, 0, 0.05); --p-button-inner-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.2); --p-button-pressed-inner-shadow:inset 0 1px 0 rgba(0, 0, 0, 0.15); --p-override-none:none; --p-override-transparent:transparent; --p-override-one:1; --p-override-visible:visible; --p-override-zero:0; --p-override-loading-z-index:514; --p-button-font-weight:500; --p-non-null-content:""; --p-choice-size:2rem; --p-icon-size:1rem; --p-choice-margin:0.1rem; --p-control-border-width:0.2rem; --p-banner-border-default:inset 0 0.1rem 0 0 var(--p-border-neutral-subdued), inset 0 0 0 0.1rem var(--p-border-neutral-subdued); --p-banner-border-success:inset 0 0.1rem 0 0 var(--p-border-success-subdued), inset 0 0 0 0.1rem var(--p-border-success-subdued); --p-banner-border-highlight:inset 0 0.1rem 0 0 var(--p-border-highlight-subdued), inset 0 0 0 0.1rem var(--p-border-highlight-subdued); --p-banner-border-warning:inset 0 0.1rem 0 0 var(--p-border-warning-subdued), inset 0 0 0 0.1rem var(--p-border-warning-subdued); --p-banner-border-critical:inset 0 0.1rem 0 0 var(--p-border-critical-subdued), inset 0 0 0 0.1rem var(--p-border-critical-subdued); --p-badge-mix-blend-mode:luminosity; --p-thin-border-subdued:0.1rem solid var(--p-border-subdued); --p-text-field-spinner-offset:0.2rem; --p-text-field-focus-ring-offset:-0.4rem; --p-text-field-focus-ring-border-radius:0.7rem; --p-button-group-item-spacing:-0.1rem; --p-duration-1-0-0:100ms; --p-duration-1-5-0:150ms; --p-ease-in:cubic-bezier(0.5, 0.1, 1, 1); --p-ease:cubic-bezier(0.4, 0.22, 0.28, 1); --p-range-slider-thumb-size-base:1.6rem; --p-range-slider-thumb-size-active:2.4rem; --p-range-slider-thumb-scale:1.5; --p-badge-font-weight:400; --p-frame-offset:0px; color: rgb(227, 229, 231);)
68
99
  end
69
100
  end
70
101
  end
@@ -3,11 +3,11 @@ class TypeValidator < ActiveModel::EachValidator
3
3
  required_type = options[:with]
4
4
 
5
5
  if value.is_a?(Array)
6
- unless value.all? { |i| i.class == required_type}
6
+ unless value.all? { |i| i.instance_of?(required_type) }
7
7
  record.errors.add attribute, (options[:message] || "is not of class #{required_type}")
8
8
  end
9
9
  else
10
- unless value.class == required_type
10
+ unless value.instance_of?(required_type)
11
11
  record.errors.add attribute, (options[:message] || "is not of class #{required_type}")
12
12
  end
13
13
  end
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rails/generators/active_record'
3
+ require "rails/generators/active_record"
4
4
 
5
5
  module PolarisViewComponents
6
6
  class InstallGenerator < Rails::Generators::Base
7
- source_root File.expand_path('templates', __dir__)
7
+ source_root File.expand_path("templates", __dir__)
8
8
 
9
9
  def add_npm_package
10
10
  say "Adding NPM package", :green
@@ -14,13 +14,13 @@ module PolarisViewComponents
14
14
  def add_to_stimulus_controller
15
15
  say "Adding import to to Stimulus controller", :green
16
16
  dir_path = "app/javascript/controllers"
17
- empty_directory('app/javascript')
17
+ empty_directory("app/javascript")
18
18
  empty_directory(dir_path)
19
19
 
20
20
  file_path = "#{dir_path}/index.js"
21
21
 
22
22
  unless File.exist?(file_path)
23
- copy_file 'stimulus_index.js', file_path
23
+ copy_file "stimulus_index.js", file_path
24
24
  end
25
25
 
26
26
  append_to_file file_path do
@@ -29,7 +29,7 @@ module PolarisViewComponents
29
29
  end
30
30
 
31
31
  def show_readme
32
- readme 'README'
32
+ readme "README"
33
33
  end
34
34
  end
35
35
  end
@@ -1,5 +1,9 @@
1
1
  require "rails/engine"
2
- require "view_component/engine"
2
+ require "view_component"
3
+ require "view_component/version"
4
+ if ViewComponent::VERSION::MAJOR == 2 && ViewComponent::VERSION::MINOR < 43
5
+ require "view_component/engine"
6
+ end
3
7
 
4
8
  module Polaris
5
9
  module ViewComponents
@@ -19,11 +23,16 @@ module Polaris
19
23
  end
20
24
  end
21
25
 
26
+ initializer "polaris_view_components.importmap", before: "importmap" do |app|
27
+ if app.config.respond_to?(:importmap) && app.config.importmap.has_key?(:cache_sweepers)
28
+ app.config.importmap.cache_sweepers << Engine.root.join("app/assets/javascripts")
29
+ end
30
+ end
31
+
22
32
  initializer "polaris_view_components.helpers" do
23
33
  ActiveSupport.on_load(:action_controller_base) do
24
34
  helper Polaris::ViewHelper
25
35
  helper Polaris::UrlHelper
26
- helper Polaris::ActionHelper
27
36
  helper Polaris::ConditionalHelper
28
37
  end
29
38
  end
@@ -1,5 +1,5 @@
1
1
  module Polaris
2
2
  module ViewComponents
3
- VERSION = "0.3.3"
3
+ VERSION = "0.7.0"
4
4
  end
5
5
  end
@@ -1 +1 @@
1
- require 'polaris/view_components'
1
+ require "polaris/view_components"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polaris_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Gamble
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-10-07 00:00:00.000000000 Z
12
+ date: 2021-12-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -35,22 +35,22 @@ dependencies:
35
35
  name: view_component
36
36
  requirement: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '2.0'
41
38
  - - ">="
42
39
  - !ruby/object:Gem::Version
43
40
  version: 2.0.0
41
+ - - "<"
42
+ - !ruby/object:Gem::Version
43
+ version: '3.0'
44
44
  type: :runtime
45
45
  prerelease: false
46
46
  version_requirements: !ruby/object:Gem::Requirement
47
47
  requirements:
48
- - - "~>"
49
- - !ruby/object:Gem::Version
50
- version: '2.0'
51
48
  - - ">="
52
49
  - !ruby/object:Gem::Version
53
50
  version: 2.0.0
51
+ - - "<"
52
+ - !ruby/object:Gem::Version
53
+ version: '3.0'
54
54
  description:
55
55
  email:
56
56
  - dan@dangamble.co.uk
@@ -448,15 +448,38 @@ files:
448
448
  - app/assets/icons/polaris/WholesaleMajor.svg
449
449
  - app/assets/icons/polaris/WifiMajor.svg
450
450
  - app/assets/javascripts/polaris_view_components.js
451
+ - app/assets/javascripts/polaris_view_components/autocomplete_controller.js
452
+ - app/assets/javascripts/polaris_view_components/button_controller.js
453
+ - app/assets/javascripts/polaris_view_components/frame_controller.js
451
454
  - app/assets/javascripts/polaris_view_components/index.js
455
+ - app/assets/javascripts/polaris_view_components/modal_controller.js
456
+ - app/assets/javascripts/polaris_view_components/option_list_controller.js
457
+ - app/assets/javascripts/polaris_view_components/polaris_controller.js
458
+ - app/assets/javascripts/polaris_view_components/popover_controller.js
452
459
  - app/assets/javascripts/polaris_view_components/resource_item_controller.js
460
+ - app/assets/javascripts/polaris_view_components/scrollable_controller.js
453
461
  - app/assets/javascripts/polaris_view_components/select_controller.js
454
462
  - app/assets/javascripts/polaris_view_components/text_field_controller.js
463
+ - app/assets/javascripts/polaris_view_components/toast_controller.js
455
464
  - app/assets/stylesheets/polaris_view_components.css
456
465
  - app/assets/stylesheets/polaris_view_components.postcss.css
466
+ - app/assets/stylesheets/polaris_view_components/custom.css
457
467
  - app/assets/stylesheets/polaris_view_components/shopify_navigation.css
468
+ - app/assets/stylesheets/polaris_view_components/spacer_component.css
458
469
  - app/components/polaris/action.rb
470
+ - app/components/polaris/action_list/item_component.html.erb
471
+ - app/components/polaris/action_list/item_component.rb
472
+ - app/components/polaris/action_list/section_component.html.erb
473
+ - app/components/polaris/action_list/section_component.rb
474
+ - app/components/polaris/action_list_component.html.erb
475
+ - app/components/polaris/action_list_component.rb
459
476
  - app/components/polaris/application_component.rb
477
+ - app/components/polaris/autocomplete/action_component.rb
478
+ - app/components/polaris/autocomplete/option_component.rb
479
+ - app/components/polaris/autocomplete/section_component.html.erb
480
+ - app/components/polaris/autocomplete/section_component.rb
481
+ - app/components/polaris/autocomplete_component.html.erb
482
+ - app/components/polaris/autocomplete_component.rb
460
483
  - app/components/polaris/avatar_component.html.erb
461
484
  - app/components/polaris/avatar_component.rb
462
485
  - app/components/polaris/badge_component.html.erb
@@ -464,7 +487,9 @@ files:
464
487
  - app/components/polaris/banner_component.html.erb
465
488
  - app/components/polaris/banner_component.rb
466
489
  - app/components/polaris/base_button.rb
490
+ - app/components/polaris/base_checkbox.rb
467
491
  - app/components/polaris/base_component.rb
492
+ - app/components/polaris/base_radio_button.rb
468
493
  - app/components/polaris/button_component.html.erb
469
494
  - app/components/polaris/button_component.rb
470
495
  - app/components/polaris/button_group_component.html.erb
@@ -483,11 +508,14 @@ files:
483
508
  - app/components/polaris/checkbox_component.rb
484
509
  - app/components/polaris/choice_component.html.erb
485
510
  - app/components/polaris/choice_component.rb
486
- - app/components/polaris/choice_list/component.html.erb
487
- - app/components/polaris/choice_list/component.rb
488
511
  - app/components/polaris/choice_list_component.html.erb
489
512
  - app/components/polaris/choice_list_component.rb
490
513
  - app/components/polaris/component.rb
514
+ - app/components/polaris/data_table/cell_component.html.erb
515
+ - app/components/polaris/data_table/cell_component.rb
516
+ - app/components/polaris/data_table/column_component.rb
517
+ - app/components/polaris/data_table_component.html.erb
518
+ - app/components/polaris/data_table_component.rb
491
519
  - app/components/polaris/description_list_component.html.erb
492
520
  - app/components/polaris/description_list_component.rb
493
521
  - app/components/polaris/display_text_component.rb
@@ -501,6 +529,8 @@ files:
501
529
  - app/components/polaris/exception_list/item_component.rb
502
530
  - app/components/polaris/exception_list_component.html.erb
503
531
  - app/components/polaris/exception_list_component.rb
532
+ - app/components/polaris/filters_component.html.erb
533
+ - app/components/polaris/filters_component.rb
504
534
  - app/components/polaris/footer_help_component.html.erb
505
535
  - app/components/polaris/footer_help_component.rb
506
536
  - app/components/polaris/form_layout/group_component.html.erb
@@ -508,11 +538,21 @@ files:
508
538
  - app/components/polaris/form_layout/item_component.rb
509
539
  - app/components/polaris/form_layout_component.html.erb
510
540
  - app/components/polaris/form_layout_component.rb
541
+ - app/components/polaris/frame/save_bar_component.html.erb
542
+ - app/components/polaris/frame/save_bar_component.rb
543
+ - app/components/polaris/frame/top_bar_component.html.erb
544
+ - app/components/polaris/frame/top_bar_component.rb
545
+ - app/components/polaris/frame_component.html.erb
546
+ - app/components/polaris/frame_component.rb
511
547
  - app/components/polaris/heading_component.rb
512
548
  - app/components/polaris/headless_button.html.erb
513
549
  - app/components/polaris/headless_button.rb
514
550
  - app/components/polaris/icon_component.html.erb
515
551
  - app/components/polaris/icon_component.rb
552
+ - app/components/polaris/index_table/cell_component.rb
553
+ - app/components/polaris/index_table/column_component.rb
554
+ - app/components/polaris/index_table_component.html.erb
555
+ - app/components/polaris/index_table_component.rb
516
556
  - app/components/polaris/inline_error_component.html.erb
517
557
  - app/components/polaris/inline_error_component.rb
518
558
  - app/components/polaris/label_component.html.erb
@@ -527,31 +567,64 @@ files:
527
567
  - app/components/polaris/link_component.rb
528
568
  - app/components/polaris/list_component.html.erb
529
569
  - app/components/polaris/list_component.rb
570
+ - app/components/polaris/logo.rb
571
+ - app/components/polaris/modal/section_component.rb
572
+ - app/components/polaris/modal_component.html.erb
573
+ - app/components/polaris/modal_component.rb
574
+ - app/components/polaris/navigation/item_component.html.erb
575
+ - app/components/polaris/navigation/item_component.rb
576
+ - app/components/polaris/navigation/section_component.html.erb
577
+ - app/components/polaris/navigation/section_component.rb
578
+ - app/components/polaris/navigation_component.html.erb
579
+ - app/components/polaris/navigation_component.rb
530
580
  - app/components/polaris/new_component.rb
581
+ - app/components/polaris/option_list/checkbox_component.html.erb
582
+ - app/components/polaris/option_list/checkbox_component.rb
583
+ - app/components/polaris/option_list/option_component.rb
584
+ - app/components/polaris/option_list/radio_button_component.rb
585
+ - app/components/polaris/option_list/section_component.html.erb
586
+ - app/components/polaris/option_list/section_component.rb
587
+ - app/components/polaris/option_list_component.html.erb
588
+ - app/components/polaris/option_list_component.rb
531
589
  - app/components/polaris/page_actions_component.html.erb
532
590
  - app/components/polaris/page_actions_component.rb
533
591
  - app/components/polaris/page_component.html.erb
534
592
  - app/components/polaris/page_component.rb
535
593
  - app/components/polaris/pagination_component.html.erb
536
594
  - app/components/polaris/pagination_component.rb
595
+ - app/components/polaris/popover/pane_component.html.erb
596
+ - app/components/polaris/popover/pane_component.rb
597
+ - app/components/polaris/popover/section_component.rb
598
+ - app/components/polaris/popover_component.html.erb
599
+ - app/components/polaris/popover_component.rb
537
600
  - app/components/polaris/progress_bar_component.html.erb
538
601
  - app/components/polaris/progress_bar_component.rb
539
602
  - app/components/polaris/radio_button_component.html.erb
540
603
  - app/components/polaris/radio_button_component.rb
541
604
  - app/components/polaris/resource_item_component.html.erb
542
605
  - app/components/polaris/resource_item_component.rb
606
+ - app/components/polaris/resource_list_component.html.erb
543
607
  - app/components/polaris/resource_list_component.rb
608
+ - app/components/polaris/scrollable_component.html.erb
609
+ - app/components/polaris/scrollable_component.rb
544
610
  - app/components/polaris/select_component.html.erb
545
611
  - app/components/polaris/select_component.rb
612
+ - app/components/polaris/setting_toggle_component.html.erb
613
+ - app/components/polaris/setting_toggle_component.rb
546
614
  - app/components/polaris/shopify_navigation_component.html.erb
547
615
  - app/components/polaris/shopify_navigation_component.rb
548
616
  - app/components/polaris/skeleton_body_text_component.html.erb
549
617
  - app/components/polaris/skeleton_body_text_component.rb
618
+ - app/components/polaris/spacer_component.rb
550
619
  - app/components/polaris/spinner_component.html.erb
551
620
  - app/components/polaris/spinner_component.rb
552
621
  - app/components/polaris/stack_component.html.erb
553
622
  - app/components/polaris/stack_component.rb
554
623
  - app/components/polaris/subheading_component.rb
624
+ - app/components/polaris/tabs/tab_component.html.erb
625
+ - app/components/polaris/tabs/tab_component.rb
626
+ - app/components/polaris/tabs_component.html.erb
627
+ - app/components/polaris/tabs_component.rb
555
628
  - app/components/polaris/tag_component.html.erb
556
629
  - app/components/polaris/tag_component.rb
557
630
  - app/components/polaris/text_container_component.rb
@@ -560,8 +633,11 @@ files:
560
633
  - app/components/polaris/text_style_component.rb
561
634
  - app/components/polaris/thumbnail_component.html.erb
562
635
  - app/components/polaris/thumbnail_component.rb
636
+ - app/components/polaris/toast_component.html.erb
637
+ - app/components/polaris/toast_component.rb
638
+ - app/components/polaris/top_bar/user_menu_component.html.erb
639
+ - app/components/polaris/top_bar/user_menu_component.rb
563
640
  - app/components/polaris/visually_hidden_component.rb
564
- - app/helpers/polaris/action_helper.rb
565
641
  - app/helpers/polaris/class_name_helper.rb
566
642
  - app/helpers/polaris/conditional_helper.rb
567
643
  - app/helpers/polaris/fetch_or_fallback_helper.rb
@@ -598,7 +674,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
598
674
  - !ruby/object:Gem::Version
599
675
  version: '0'
600
676
  requirements: []
601
- rubygems_version: 3.2.22
677
+ rubygems_version: 3.2.32
602
678
  signing_key:
603
679
  specification_version: 4
604
680
  summary: ViewComponents for Polaris Design System
@@ -1,34 +0,0 @@
1
- <%= field_set_tag(nil, content_tag_options) do %>
2
- <% if @title.present? %>
3
- <%= content_tag("legend", class: "Polaris-ChoiceList__Title") do %>
4
- <%= @title %>
5
- <% end %>
6
- <% end %>
7
-
8
- <ul class="Polaris-ChoiceList__Choices">
9
- <% choice_component = @allow_multiple ? Polaris::CheckboxComponent : Polaris::RadioButtonComponent %>
10
-
11
- <% @choices.each do |choice| %>
12
- <li>
13
- <%= render choice_component.new(
14
- form: @form,
15
- attribute: @attribute,
16
- name: final_name,
17
- value: choice[:value],
18
- label: choice[:label],
19
- disabled: choice[:disabled] || @disabled,
20
- checked: choice_is_selected?(choice),
21
- help_text: choice[:help_text],
22
- children_content: choice[:children_content],
23
- input_attrs: @input_attrs,
24
- ) %>
25
- </li>
26
- <% end %>
27
- </ul>
28
-
29
- <% if @error.present? %>
30
- <div class="Polaris-ChoiceList__ChoiceError">
31
- <%= polaris_inline_error { @error } %>
32
- </div>
33
- <% end %>
34
- <% end %>
@@ -1,65 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Polaris
4
- module ChoiceList
5
- class Component < Polaris::Component
6
- def initialize(
7
- choices:,
8
- form: nil,
9
- attribute: nil,
10
- name: nil,
11
- title: '',
12
- title_hidden: false,
13
- selected: [],
14
- allow_multiple: false,
15
- error: '',
16
- disabled: false,
17
- input_attrs: {},
18
- **args
19
- )
20
- super
21
-
22
- @choices = choices
23
- @form = form
24
- @attribute = attribute
25
-
26
- @name = name
27
- @title = title
28
- @title_hidden = title_hidden
29
- @selected = selected
30
- @allow_multiple = allow_multiple
31
- @error = error
32
- @disabled = disabled
33
- @input_attrs = input_attrs
34
- end
35
-
36
- def final_name
37
- return nil if @name.nil?
38
-
39
- @allow_multiple ? "#{@name}[]" : @name
40
- end
41
-
42
- def choice_is_selected?(choice)
43
- @selected.include? choice[:value]
44
- end
45
-
46
- private
47
-
48
- def classes
49
- classes = ['Polaris-ChoiceList']
50
-
51
- classes << 'Polaris-ChoiceList--titleHidden' if @title_hidden
52
-
53
- classes
54
- end
55
-
56
- def additional_aria
57
- super
58
-
59
- {
60
- invalid: @error.present?
61
- }
62
- end
63
- end
64
- end
65
- end
@@ -1,14 +0,0 @@
1
- module Polaris
2
- module ActionHelper
3
- def render_plain_action(action)
4
- case action
5
- when Hash
6
- action = action(**action)
7
- end
8
-
9
- render Polaris::ButtonComponent.new(**action.to_h.except(:content), plain: true) do
10
- action.content
11
- end
12
- end
13
- end
14
- end