polaris_view_components 0.3.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/{javascript → assets/javascripts}/polaris_view_components/index.js +0 -0
  4. data/app/{javascript → assets/javascripts}/polaris_view_components/resource_item_controller.js +0 -0
  5. data/app/assets/javascripts/polaris_view_components/select_controller.js +14 -0
  6. data/app/{javascript → assets/javascripts}/polaris_view_components/text_field_controller.js +0 -0
  7. data/app/assets/javascripts/polaris_view_components.js +6 -4
  8. data/app/assets/stylesheets/polaris_view_components/custom.css +43 -0
  9. data/app/assets/stylesheets/{shopify_navigation.css → polaris_view_components/shopify_navigation.css} +0 -4
  10. data/app/assets/stylesheets/polaris_view_components/spacer_component.css +39 -0
  11. data/app/assets/stylesheets/polaris_view_components.css +2214 -3
  12. data/app/assets/stylesheets/polaris_view_components.postcss.css +4 -0
  13. data/app/components/polaris/card/header_component.rb +0 -2
  14. data/app/components/polaris/card/section_component.rb +5 -1
  15. data/app/components/polaris/card_component.rb +0 -2
  16. data/app/components/polaris/data_table/cell_component.html.erb +18 -0
  17. data/app/components/polaris/data_table/cell_component.rb +49 -0
  18. data/app/components/polaris/data_table/column_component.rb +19 -0
  19. data/app/components/polaris/data_table_component.html.erb +77 -0
  20. data/app/components/polaris/data_table_component.rb +42 -0
  21. data/app/components/polaris/dropzone/component.rb +0 -2
  22. data/app/components/polaris/empty_state_component.html.erb +16 -11
  23. data/app/components/polaris/empty_state_component.rb +1 -0
  24. data/app/components/polaris/filters_component.html.erb +13 -0
  25. data/app/components/polaris/filters_component.rb +38 -0
  26. data/app/components/polaris/index_table/cell_component.rb +22 -0
  27. data/app/components/polaris/index_table/column_component.rb +13 -0
  28. data/app/components/polaris/index_table_component.html.erb +28 -0
  29. data/app/components/polaris/index_table_component.rb +25 -0
  30. data/app/components/polaris/inline_error_component.html.erb +2 -2
  31. data/app/components/polaris/inline_error_component.rb +7 -1
  32. data/app/components/polaris/layout/section.rb +2 -0
  33. data/app/components/polaris/link_component.rb +3 -1
  34. data/app/components/polaris/page_actions_component.rb +15 -1
  35. data/app/components/polaris/resource_list_component.html.erb +10 -0
  36. data/app/components/polaris/resource_list_component.rb +2 -8
  37. data/app/components/polaris/select_component.rb +7 -2
  38. data/app/components/polaris/spacer_component.rb +50 -0
  39. data/app/components/polaris/stack_component.rb +1 -1
  40. data/app/components/polaris/tag_component.rb +2 -2
  41. data/app/components/polaris/text_style_component.rb +9 -0
  42. data/app/helpers/polaris/form_builder.rb +27 -2
  43. data/app/helpers/polaris/view_helper.rb +15 -3
  44. data/lib/polaris/view_components/engine.rb +0 -1
  45. data/lib/polaris/view_components/version.rb +1 -1
  46. metadata +23 -11
  47. data/app/assets/stylesheets/polaris@6.6.0.css +0 -4104
  48. data/app/components/polaris/choice_list/component.html.erb +0 -34
  49. data/app/components/polaris/choice_list/component.rb +0 -65
  50. data/app/helpers/polaris/action_helper.rb +0 -14
  51. data/app/javascript/polaris_view_components/select_controller.js +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a5ea3551cd4f15d29b3618b2cc565059b91f9415c2b3e2ff47573c9d8eebc588
4
- data.tar.gz: bd815ab2b3bd738e7541686b8047cf159638e2aec83ab02d4dd7e803ff455d13
3
+ metadata.gz: a4ecf6c373c0c3a1188d677df7da49034a9094392ce74b0bac9e72780b1a851a
4
+ data.tar.gz: 836ebef4a9e97c359d4bf36e4ae497d673a6579de232c0a82f6cf12d4f33e3d9
5
5
  SHA512:
6
- metadata.gz: 161b1fc626ca532956a4cd600dfcfd24d02e4c833e2622f7467fd0f3e526de317c321270c785b513cca0740c2660ed699e3893e9748c06a172330ef00d0ca35d
7
- data.tar.gz: e93f7fa5dff2007c34163999e6630ebb77107dc13f1ded4032c09df947b6664c3a61befa7f06e20dc85099060c86ad3bb3a0d5970acd599305ce85789a53b7b7
6
+ metadata.gz: add02e909f36a997d49d261b3960ad41636001dbb4a6beea5f1652a7bfadab94d9bb2e07cefc5618f652bbdd431934ceb11da59388d0523d75686bbdddc7723e
7
+ data.tar.gz: cdd86e17c2a970aae8e5fec22cb296eae4cd1df572dee371978d0b02450cf6185c30c5a891db0943b62f1f114b593a2a3e890840362c1c1efc9da6087c663dd7
data/README.md CHANGED
@@ -85,7 +85,7 @@ In addition to the dependencies declared in the `gemspec`, Polaris ViewComponent
85
85
  To get started:
86
86
 
87
87
  1. Run: `bundle install`
88
- 2. Run: `foreman start`
88
+ 2. Run: `bin/dev`
89
89
 
90
90
  It will open demo app with component previews on `localhost:4000`. You can change components and they will be updated on page reload. Component previews located in `demo/test/components/previews`.
91
91
 
@@ -0,0 +1,14 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+
3
+ export default class extends Controller {
4
+ static targets = ["select", "selectedOption"]
5
+
6
+ connect() {
7
+ this.update()
8
+ }
9
+
10
+ update() {
11
+ const option = this.selectTarget.options[this.selectTarget.selectedIndex]
12
+ this.selectedOptionTarget.innerText = option.text
13
+ }
14
+ }
@@ -13,10 +13,12 @@ class ResourceItem extends Controller {
13
13
  }
14
14
 
15
15
  class Select extends Controller {
16
- static targets=[ "selectedOption" ];
17
- update(event) {
18
- const select = event.currentTarget;
19
- const option = select.options[select.selectedIndex];
16
+ static targets=[ "select", "selectedOption" ];
17
+ connect() {
18
+ this.update();
19
+ }
20
+ update() {
21
+ const option = this.selectTarget.options[this.selectTarget.selectedIndex];
20
22
  this.selectedOptionTarget.innerText = option.text;
21
23
  }
22
24
  }
@@ -0,0 +1,43 @@
1
+ /* Add missing 1/4 section for layout */
2
+ @media (min-width: 30.625em) {
3
+ .Polaris-Layout__Section--oneFourth {
4
+ flex: 1 1 20rem;
5
+ min-width: 0;
6
+ }
7
+ }
8
+
9
+ /* Fix Tag removal link */
10
+ a.Polaris-Tag__Button {
11
+ height: auto;
12
+ }
13
+
14
+ /* Remove underline for sort link */
15
+
16
+ .Polaris-DataTable__Cell--sortable a {
17
+ text-decoration: none;
18
+ }
19
+
20
+ /* CardSection borders */
21
+ .Polaris-Card__Section--borderTop {
22
+ border-top: 0.1rem solid var(--p-divider);
23
+ }
24
+ .Polaris-Card__Section--borderBottom {
25
+ border-bottom: 0.1rem solid var(--p-divider);
26
+ }
27
+
28
+ /* IndexTable */
29
+
30
+ /* TODO: Remove after upgrade to Polaris 7.0.0 */
31
+ .Polaris-IndexTable__TableRow.Polaris-IndexTable__TableRow--unclickable {
32
+ cursor: auto;
33
+ }
34
+
35
+ /* TestStyle sizes */
36
+ .Polaris-TextStyle--sizeSmall {
37
+ font-size: 1.25rem;
38
+ }
39
+
40
+ /* Remove box-shadow from buttons and links */
41
+ .Polaris-Button::after, .Polaris-Button:focus::after, .Polaris-Breadcrumbs__Breadcrumb::after {
42
+ box-shadow: none !important;
43
+ }
@@ -106,10 +106,6 @@
106
106
  border-bottom: .3rem solid var(--p-action-primary)
107
107
  }
108
108
 
109
- .shp-Navigation_Link:focus {
110
- box-shadow: inset 0 0 2px 0 rgba(92, 106, 196, .8), 0 0 2px 0 rgba(92, 106, 196, .8)
111
- }
112
-
113
109
  .shp-Navigation_Link:focus .shp-Navigation_LinkText {
114
110
  font-weight: 400;
115
111
  color: var(--p-text)
@@ -0,0 +1,39 @@
1
+ /* Vertical */
2
+ .Polaris-Spacer--verticalSpacingExtraTight {
3
+ height: 4px;
4
+ }
5
+ .Polaris-Spacer--verticalSpacingTight {
6
+ height: 8px;
7
+ }
8
+ .Polaris-Spacer--verticalSpacingBaseTight {
9
+ height: 12px;
10
+ }
11
+ .Polaris-Spacer--verticalSpacingBase {
12
+ height: 16px;
13
+ }
14
+ .Polaris-Spacer--verticalSpacingLoose {
15
+ height: 20px;
16
+ }
17
+ .Polaris-Spacer--verticalSpacingExtraLoose {
18
+ height: 32px;
19
+ }
20
+
21
+ /* Horizontal */
22
+ .Polaris-Spacer--horizontalSpacingExtraTight {
23
+ width: 4px;
24
+ }
25
+ .Polaris-Spacer--horizontalSpacingTight {
26
+ width: 8px;
27
+ }
28
+ .Polaris-Spacer--horizontalSpacingBaseTight {
29
+ width: 12px;
30
+ }
31
+ .Polaris-Spacer--horizontalSpacingBase {
32
+ width: 16px;
33
+ }
34
+ .Polaris-Spacer--horizontalSpacingLoose {
35
+ width: 20px;
36
+ }
37
+ .Polaris-Spacer--horizontalSpacingExtraLoose {
38
+ width: 32px;
39
+ }