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
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.7.0
4
+ version: 0.9.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-12-20 00:00:00.000000000 Z
12
+ date: 2022-03-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -18,9 +18,6 @@ dependencies:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: 5.0.0
21
- - - "<"
22
- - !ruby/object:Gem::Version
23
- version: 8.0.0
24
21
  type: :runtime
25
22
  prerelease: false
26
23
  version_requirements: !ruby/object:Gem::Requirement
@@ -28,9 +25,6 @@ dependencies:
28
25
  - - ">="
29
26
  - !ruby/object:Gem::Version
30
27
  version: 5.0.0
31
- - - "<"
32
- - !ruby/object:Gem::Version
33
- version: 8.0.0
34
28
  - !ruby/object:Gem::Dependency
35
29
  name: view_component
36
30
  requirement: !ruby/object:Gem::Requirement
@@ -38,9 +32,6 @@ dependencies:
38
32
  - - ">="
39
33
  - !ruby/object:Gem::Version
40
34
  version: 2.0.0
41
- - - "<"
42
- - !ruby/object:Gem::Version
43
- version: '3.0'
44
35
  type: :runtime
45
36
  prerelease: false
46
37
  version_requirements: !ruby/object:Gem::Requirement
@@ -48,9 +39,6 @@ dependencies:
48
39
  - - ">="
49
40
  - !ruby/object:Gem::Version
50
41
  version: 2.0.0
51
- - - "<"
52
- - !ruby/object:Gem::Version
53
- version: '3.0'
54
42
  description:
55
43
  email:
56
44
  - dan@dangamble.co.uk
@@ -71,8 +59,10 @@ files:
71
59
  - app/assets/icons/polaris/AffiliateMajor.svg
72
60
  - app/assets/icons/polaris/AlertMinor.svg
73
61
  - app/assets/icons/polaris/AnalyticsMajor.svg
62
+ - app/assets/icons/polaris/AnalyticsMinor.svg
74
63
  - app/assets/icons/polaris/AppExtensionMinor.svg
75
64
  - app/assets/icons/polaris/AppsMajor.svg
65
+ - app/assets/icons/polaris/AppsMinor.svg
76
66
  - app/assets/icons/polaris/ArchiveMajor.svg
77
67
  - app/assets/icons/polaris/ArchiveMinor.svg
78
68
  - app/assets/icons/polaris/ArrowDownMinor.svg
@@ -91,12 +81,14 @@ files:
91
81
  - app/assets/icons/polaris/BillingStatementPoundMajor.svg
92
82
  - app/assets/icons/polaris/BillingStatementRupeeMajor.svg
93
83
  - app/assets/icons/polaris/BillingStatementYenMajor.svg
84
+ - app/assets/icons/polaris/BlockMinor.svg
94
85
  - app/assets/icons/polaris/BlockquoteMajor.svg
95
86
  - app/assets/icons/polaris/BlogMajor.svg
96
87
  - app/assets/icons/polaris/BugMajor.svg
97
88
  - app/assets/icons/polaris/ButtonCornerPillMajor.svg
98
89
  - app/assets/icons/polaris/ButtonCornerRoundedMajor.svg
99
90
  - app/assets/icons/polaris/ButtonCornerSquareMajor.svg
91
+ - app/assets/icons/polaris/ButtonMinor.svg
100
92
  - app/assets/icons/polaris/BuyButtonButtonLayoutMajor.svg
101
93
  - app/assets/icons/polaris/BuyButtonHorizontalLayoutMajor.svg
102
94
  - app/assets/icons/polaris/BuyButtonMajor.svg
@@ -152,6 +144,7 @@ files:
152
144
  - app/assets/icons/polaris/CirclePlusOutlineMinor.svg
153
145
  - app/assets/icons/polaris/CircleRightMajor.svg
154
146
  - app/assets/icons/polaris/CircleTickMajor.svg
147
+ - app/assets/icons/polaris/CircleTickMinor.svg
155
148
  - app/assets/icons/polaris/CircleTickOutlineMinor.svg
156
149
  - app/assets/icons/polaris/CircleUpMajor.svg
157
150
  - app/assets/icons/polaris/ClipboardMinor.svg
@@ -165,6 +158,7 @@ files:
165
158
  - app/assets/icons/polaris/ColumnWithTextMajor.svg
166
159
  - app/assets/icons/polaris/Columns2Major.svg
167
160
  - app/assets/icons/polaris/Columns3Major.svg
161
+ - app/assets/icons/polaris/Columns3Minor.svg
168
162
  - app/assets/icons/polaris/ComposeMajor.svg
169
163
  - app/assets/icons/polaris/ConfettiMajor.svg
170
164
  - app/assets/icons/polaris/ConnectMinor.svg
@@ -187,6 +181,7 @@ files:
187
181
  - app/assets/icons/polaris/DiscountAutomaticMajor.svg
188
182
  - app/assets/icons/polaris/DiscountCodeMajor.svg
189
183
  - app/assets/icons/polaris/DiscountsMajor.svg
184
+ - app/assets/icons/polaris/DiscountsMinor.svg
190
185
  - app/assets/icons/polaris/DisputeMinor.svg
191
186
  - app/assets/icons/polaris/DnsSettingsMajor.svg
192
187
  - app/assets/icons/polaris/DomainNewMajor.svg
@@ -214,6 +209,8 @@ files:
214
209
  - app/assets/icons/polaris/FeaturedCollectionMajor.svg
215
210
  - app/assets/icons/polaris/FeaturedContentMajor.svg
216
211
  - app/assets/icons/polaris/FilterMajor.svg
212
+ - app/assets/icons/polaris/FinancesMajor.svg
213
+ - app/assets/icons/polaris/FinancesMinor.svg
217
214
  - app/assets/icons/polaris/FirstOrderMajor.svg
218
215
  - app/assets/icons/polaris/FirstVisitMajor.svg
219
216
  - app/assets/icons/polaris/FlagMajor.svg
@@ -246,6 +243,7 @@ files:
246
243
  - app/assets/icons/polaris/HideMinor.svg
247
244
  - app/assets/icons/polaris/HintMajor.svg
248
245
  - app/assets/icons/polaris/HomeMajor.svg
246
+ - app/assets/icons/polaris/HomeMinor.svg
249
247
  - app/assets/icons/polaris/HorizontalDotsMinor.svg
250
248
  - app/assets/icons/polaris/IconsMajor.svg
251
249
  - app/assets/icons/polaris/IllustrationMajor.svg
@@ -282,6 +280,7 @@ files:
282
280
  - app/assets/icons/polaris/MarkFulfilledMinor.svg
283
281
  - app/assets/icons/polaris/MarkPaidMinor.svg
284
282
  - app/assets/icons/polaris/MarketingMajor.svg
283
+ - app/assets/icons/polaris/MarketingMinor.svg
285
284
  - app/assets/icons/polaris/MaximizeMajor.svg
286
285
  - app/assets/icons/polaris/MaximizeMinor.svg
287
286
  - app/assets/icons/polaris/MentionMajor.svg
@@ -305,8 +304,10 @@ files:
305
304
  - app/assets/icons/polaris/NoteMinor.svg
306
305
  - app/assets/icons/polaris/NotificationMajor.svg
307
306
  - app/assets/icons/polaris/OnlineStoreMajor.svg
307
+ - app/assets/icons/polaris/OnlineStoreMinor.svg
308
308
  - app/assets/icons/polaris/OrderStatusMinor.svg
309
309
  - app/assets/icons/polaris/OrdersMajor.svg
310
+ - app/assets/icons/polaris/OrdersMinor.svg
310
311
  - app/assets/icons/polaris/OutgoingMajor.svg
311
312
  - app/assets/icons/polaris/PackageMajor.svg
312
313
  - app/assets/icons/polaris/PageDownMajor.svg
@@ -337,9 +338,12 @@ files:
337
338
  - app/assets/icons/polaris/PrintMinor.svg
338
339
  - app/assets/icons/polaris/ProductReturnsMinor.svg
339
340
  - app/assets/icons/polaris/ProductsMajor.svg
341
+ - app/assets/icons/polaris/ProductsMinor.svg
340
342
  - app/assets/icons/polaris/ProfileMajor.svg
341
343
  - app/assets/icons/polaris/ProfileMinor.svg
342
344
  - app/assets/icons/polaris/PromoteMinor.svg
345
+ - app/assets/icons/polaris/QuestionMarkInverseMajor.svg
346
+ - app/assets/icons/polaris/QuestionMarkInverseMinor.svg
343
347
  - app/assets/icons/polaris/QuestionMarkMajor.svg
344
348
  - app/assets/icons/polaris/QuestionMarkMinor.svg
345
349
  - app/assets/icons/polaris/QuickSaleMajor.svg
@@ -418,6 +422,7 @@ files:
418
422
  - app/assets/icons/polaris/TickSmallMinor.svg
419
423
  - app/assets/icons/polaris/TimelineAttachmentMajor.svg
420
424
  - app/assets/icons/polaris/TipsMajor.svg
425
+ - app/assets/icons/polaris/TitleMinor.svg
421
426
  - app/assets/icons/polaris/ToolsMajor.svg
422
427
  - app/assets/icons/polaris/TransactionFeeDollarMajor.svg
423
428
  - app/assets/icons/polaris/TransactionFeeEuroMajor.svg
@@ -444,12 +449,15 @@ files:
444
449
  - app/assets/icons/polaris/ViewportWideMajor.svg
445
450
  - app/assets/icons/polaris/VocabularyMajor.svg
446
451
  - app/assets/icons/polaris/WandMajor.svg
452
+ - app/assets/icons/polaris/WandMinor.svg
447
453
  - app/assets/icons/polaris/WearableMajor.svg
448
454
  - app/assets/icons/polaris/WholesaleMajor.svg
449
455
  - app/assets/icons/polaris/WifiMajor.svg
450
456
  - app/assets/javascripts/polaris_view_components.js
451
457
  - app/assets/javascripts/polaris_view_components/autocomplete_controller.js
452
458
  - app/assets/javascripts/polaris_view_components/button_controller.js
459
+ - app/assets/javascripts/polaris_view_components/collapsible_controller.js
460
+ - app/assets/javascripts/polaris_view_components/dropzone_controller.js
453
461
  - app/assets/javascripts/polaris_view_components/frame_controller.js
454
462
  - app/assets/javascripts/polaris_view_components/index.js
455
463
  - app/assets/javascripts/polaris_view_components/modal_controller.js
@@ -461,6 +469,7 @@ files:
461
469
  - app/assets/javascripts/polaris_view_components/select_controller.js
462
470
  - app/assets/javascripts/polaris_view_components/text_field_controller.js
463
471
  - app/assets/javascripts/polaris_view_components/toast_controller.js
472
+ - app/assets/javascripts/polaris_view_components/utils.js
464
473
  - app/assets/stylesheets/polaris_view_components.css
465
474
  - app/assets/stylesheets/polaris_view_components.postcss.css
466
475
  - app/assets/stylesheets/polaris_view_components/custom.css
@@ -473,7 +482,6 @@ files:
473
482
  - app/components/polaris/action_list/section_component.rb
474
483
  - app/components/polaris/action_list_component.html.erb
475
484
  - app/components/polaris/action_list_component.rb
476
- - app/components/polaris/application_component.rb
477
485
  - app/components/polaris/autocomplete/action_component.rb
478
486
  - app/components/polaris/autocomplete/option_component.rb
479
487
  - app/components/polaris/autocomplete/section_component.html.erb
@@ -510,6 +518,7 @@ files:
510
518
  - app/components/polaris/choice_component.rb
511
519
  - app/components/polaris/choice_list_component.html.erb
512
520
  - app/components/polaris/choice_list_component.rb
521
+ - app/components/polaris/collapsible_component.rb
513
522
  - app/components/polaris/component.rb
514
523
  - app/components/polaris/data_table/cell_component.html.erb
515
524
  - app/components/polaris/data_table/cell_component.rb
@@ -519,10 +528,8 @@ files:
519
528
  - app/components/polaris/description_list_component.html.erb
520
529
  - app/components/polaris/description_list_component.rb
521
530
  - app/components/polaris/display_text_component.rb
522
- - app/components/polaris/dropzone/component.html.erb
523
- - app/components/polaris/dropzone/component.rb
524
- - app/components/polaris/dropzone/controller.js
525
- - app/components/polaris/dropzone/utils.js
531
+ - app/components/polaris/dropzone_component.html.erb
532
+ - app/components/polaris/dropzone_component.rb
526
533
  - app/components/polaris/empty_state_component.html.erb
527
534
  - app/components/polaris/empty_state_component.rb
528
535
  - app/components/polaris/exception_list/item_component.html.erb
@@ -555,6 +562,7 @@ files:
555
562
  - app/components/polaris/index_table_component.rb
556
563
  - app/components/polaris/inline_error_component.html.erb
557
564
  - app/components/polaris/inline_error_component.rb
565
+ - app/components/polaris/keyboard_key_component.rb
558
566
  - app/components/polaris/label_component.html.erb
559
567
  - app/components/polaris/label_component.rb
560
568
  - app/components/polaris/labelled_component.html.erb
@@ -577,7 +585,6 @@ files:
577
585
  - app/components/polaris/navigation/section_component.rb
578
586
  - app/components/polaris/navigation_component.html.erb
579
587
  - app/components/polaris/navigation_component.rb
580
- - app/components/polaris/new_component.rb
581
588
  - app/components/polaris/option_list/checkbox_component.html.erb
582
589
  - app/components/polaris/option_list/checkbox_component.rb
583
590
  - app/components/polaris/option_list/option_component.rb
@@ -615,9 +622,12 @@ files:
615
622
  - app/components/polaris/shopify_navigation_component.rb
616
623
  - app/components/polaris/skeleton_body_text_component.html.erb
617
624
  - app/components/polaris/skeleton_body_text_component.rb
625
+ - app/components/polaris/skeleton_display_text_component.rb
626
+ - app/components/polaris/skeleton_thumbnail_component.rb
618
627
  - app/components/polaris/spacer_component.rb
619
628
  - app/components/polaris/spinner_component.html.erb
620
629
  - app/components/polaris/spinner_component.rb
630
+ - app/components/polaris/stack/item_component.rb
621
631
  - app/components/polaris/stack_component.html.erb
622
632
  - app/components/polaris/stack_component.rb
623
633
  - app/components/polaris/subheading_component.rb
@@ -639,13 +649,13 @@ files:
639
649
  - app/components/polaris/top_bar/user_menu_component.rb
640
650
  - app/components/polaris/visually_hidden_component.rb
641
651
  - app/helpers/polaris/class_name_helper.rb
642
- - app/helpers/polaris/conditional_helper.rb
643
652
  - app/helpers/polaris/fetch_or_fallback_helper.rb
644
653
  - app/helpers/polaris/form_builder.rb
645
654
  - app/helpers/polaris/option_helper.rb
646
655
  - app/helpers/polaris/url_helper.rb
647
656
  - app/helpers/polaris/view_helper.rb
648
657
  - app/validators/type_validator.rb
658
+ - config/locales/en.yml
649
659
  - lib/generators/polaris_view_components/USAGE
650
660
  - lib/generators/polaris_view_components/install_generator.rb
651
661
  - lib/generators/polaris_view_components/templates/README
@@ -1,35 +0,0 @@
1
- class Polaris::ApplicationComponent < ViewComponent::Base
2
- include ActiveModel::Validations
3
-
4
- def initialize(data: {}, aria: {}, html_options: {}, **args)
5
- @data = data
6
- @aria = aria
7
- @html_options = html_options
8
- end
9
-
10
- private
11
-
12
- def classes
13
- []
14
- end
15
-
16
- def additional_data
17
- {}
18
- end
19
-
20
- def additional_aria
21
- {}
22
- end
23
-
24
- def content_tag_options
25
- {
26
- class: classes.compact,
27
- data: @data.merge(additional_data),
28
- aria: @aria.merge(additional_aria)
29
- }.merge(@html_options)
30
- end
31
-
32
- def before_render
33
- validate!
34
- end
35
- end
@@ -1,72 +0,0 @@
1
- <%= render Polaris::Labelled::Component.new(**labelled_attrs) do %>
2
- <%= content_tag('div', content_tag_options) do %>
3
- <div
4
- class="Polaris-DropZone__Overlay Polaris-VisuallyHidden"
5
- data-polaris--dropzone-target="overlay"
6
- >
7
- <%= polaris_stack(vertical: true, spacing: :tight) do |stack| %>
8
- <% stack.item do %>
9
- <%= polaris_icon(color: :primary) do %>
10
- <svg viewBox="0 0 20 20" class="Polaris-Icon__Svg" focusable="false" aria-hidden="true">
11
- <path d="M2 2h1V0H1.5A1.5 1.5 0 000 1.5V3h2V2zM5 2h3V0H5v2zM13 2h-3V0h3v2zM0 5v3h2V5H0zM0 10v3h2v-3H0zM18 5h-2v3h2V5zM5 18h3v-2H5v2zM0 17a1 1 0 001 1h2v-2H2v-1H0v2zM16 3V2h-1V0h1.5A1.5 1.5 0 0118 1.5V3h-2z" />
12
-
13
- <path d="M10.814 14H5.5A1.5 1.5 0 014 12.5v-7A1.5 1.5 0 015.5 4h7A1.5 1.5 0 0114 5.5v5.314l5.512 2.506a.832.832 0 01.028 1.501l-2.898 1.45a.832.832 0 00-.372.371l-1.449 2.898a.832.832 0 01-1.501-.028L10.814 14zm-.909-2l-.828-1.821c-.318-.7.402-1.42 1.102-1.102L12 9.905V6H6v6h3.905z" />
14
- </svg>
15
- <% end %>
16
- <% end %>
17
-
18
- <% stack.item do %>
19
- <%= polaris_display_text(size: :small) do %>
20
- <%= @overlay_text %>
21
- <% end %>
22
- <% end %>
23
- <% end %>
24
- </div>
25
-
26
- <div class="Polaris-DropZone__Container" data-polaris--dropzone-target="container">
27
- <div class="Polaris-DropZone-FileUpload" data-polaris--dropzone-target="fileUpload">
28
- <%= polaris_stack(vertical: true) do |stack| %>
29
- <% stack.item do %>
30
- <img width="40" src="data:image/svg+xml,%3csvg fill='none' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M20 10a10 10 0 11-20 0 10 10 0 0120 0zM5.3 8.3l4-4a1 1 0 011.4 0l4 4a1 1 0 01-1.4 1.4L11 7.4V15a1 1 0 11-2 0V7.4L6.7 9.7a1 1 0 01-1.4-1.4z' fill='%235C5F62'/%3e%3c/svg%3e" alt="">
31
- <% end %>
32
-
33
- <% stack.item do %>
34
- <div class="Polaris-DropZone-FileUpload__Button">Add file</div>
35
- <% end %>
36
-
37
- <% stack.item do %>
38
- <%= polaris_text_style(variation: :subdued) do %>
39
- or drop files to upload
40
- <% end %>
41
- <% end %>
42
- <% end %>
43
- </div>
44
- </div>
45
-
46
- <%= polaris_visually_hidden do %>
47
- <%= @form.file_field(@attribute, input_attrs) %>
48
- <% end %>
49
-
50
- <template data-polaris--dropzone-target="itemsTemplate">
51
- <%= polaris_stack(vertical: true, data: { rendered: '' }) do %>
52
- <span class="target"></span>
53
- <% end %>
54
- </template>
55
-
56
- <template data-polaris--dropzone-target="itemTemplate">
57
- <div class="Polaris-Stack__Item">
58
- <%= polaris_stack(alignment: :center) do |stack| %>
59
- <% stack.item do %>
60
- <%# polaris_thumnail(source: "TODO", size: :small) %>
61
- <% end %>
62
-
63
- <% stack.item do %>
64
- <div class="content">
65
- <%= polaris_caption_component { "TODO" } %>
66
- </div>
67
- <% end %>
68
- <% end %>
69
- </div>
70
- </template>
71
- <% end %>
72
- <% end %>
@@ -1,128 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Polaris
4
- module Dropzone
5
- class Component < Polaris::Component
6
- ALLOWED_TYPES = %w[file image]
7
-
8
- validates :type, inclusion: {in: ALLOWED_TYPES, message: "%{value} is not a valid type"}
9
- validates :label_action, type: Action, allow_nil: true
10
-
11
- # TODO
12
- # Options missing:
13
- # - open_file_dialog
14
- # - overlay
15
- # - overlay_text
16
- # - Size CSS Class
17
- # - Doesn't take into account an initial load with files
18
-
19
- attr_reader :label_action, :type
20
-
21
- def initialize(
22
- form:,
23
- attribute:,
24
- accept: "",
25
- active: false,
26
- allow_multiple: true,
27
- disabled: false,
28
- drop_on_page: false,
29
- error: false,
30
- error_overlay_text: "",
31
- id: "",
32
- label: "",
33
- label_action: nil,
34
- label_hidden: false,
35
- overlay_text: "Drop file to upload",
36
- outline: true,
37
- type: "file",
38
- **args
39
- )
40
- super
41
-
42
- @form = form
43
- @attribute = attribute
44
- @accept = accept
45
- @active = active
46
- @allow_multiple = allow_multiple
47
- @disabled = disabled
48
- @drop_on_page = drop_on_page
49
- @error = error
50
- @error_overlay_text = error_overlay_text
51
- @id = id
52
- @label = label
53
- @label_action = label_action
54
- @label_hidden = label_hidden
55
- @overlay_text = overlay_text
56
- @outline = outline
57
- @type = type
58
- end
59
-
60
- def labelled_attrs
61
- {
62
- form: @form,
63
- attribute: @attribute,
64
- error: @error,
65
- label: @label,
66
- label_hidden: @label_hidden,
67
- index: @index,
68
- action: @label_action
69
- }
70
- end
71
-
72
- def input_attrs
73
- {
74
- accept: @accept,
75
- disabled: @disabled,
76
- type: "file",
77
- multiple: @allow_multiple,
78
- data: {
79
- action: "focus->polaris--dropzone#onFocus blur->polaris--dropzone#onBlur change->polaris--dropzone#onChange",
80
- 'polaris--dropzone-target': "input"
81
- }
82
- }
83
- end
84
-
85
- private
86
-
87
- def additional_aria
88
- {
89
- disabled: @disabled.to_s
90
- }
91
- end
92
-
93
- def additional_data
94
- {
95
- controller: "polaris--dropzone",
96
- action: "click->polaris--dropzone#onClick #{drop_actions}",
97
- 'polaris--dropzone-accept-value': @accept,
98
- 'polaris--dropzone-allowMultiple-value': @allow_multiple.to_s,
99
- 'polaris--dropzone-disabled-value': @disabled.to_s,
100
- 'polaris--dropzone-focused-value': "false",
101
- 'polaris--dropzone-drop-on-page-value': "false"
102
- }
103
- end
104
-
105
- def drop_actions
106
- event_scope = @drop_on_page ? "@document" : ""
107
-
108
- [
109
- "drop#{event_scope}->polaris--dropzone#onDrop",
110
- "dragover#{event_scope}->polaris--dropzone#onDragOver",
111
- "dragenter#{event_scope}->polaris--dropzone#onDragEnter",
112
- "dragleave#{event_scope}->polaris--dropzone#onDragLeave"
113
- ].join(" ")
114
- end
115
-
116
- def classes
117
- classes = %w[Polaris-DropZone Polaris-DropZone--sizeExtraLarge]
118
-
119
- classes << "Polaris-DropZone--isDisabled" if @disabled
120
- classes << "Polaris-DropZone--isDisabled" if @disabled
121
- classes << "Polaris-DropZone--hasError" if @error.present?
122
- classes << "Polaris-DropZone--hasOutline" if @outline
123
-
124
- classes
125
- end
126
- end
127
- end
128
- end