shopify_app 13.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +7 -0
  2. data/.babelrc +5 -0
  3. data/.github/CODEOWNERS +1 -0
  4. data/.github/ISSUE_TEMPLATE.md +14 -0
  5. data/.github/PULL_REQUEST_TEMPLATE.md +6 -0
  6. data/.github/probots.yml +2 -0
  7. data/.github/workflows/rubocop.yml +28 -0
  8. data/.gitignore +16 -0
  9. data/.nvmrc +1 -0
  10. data/.rubocop.yml +17 -0
  11. data/.ruby-version +1 -0
  12. data/.travis.yml +28 -0
  13. data/CHANGELOG.md +505 -0
  14. data/Gemfile +11 -0
  15. data/LICENSE +19 -0
  16. data/README.md +620 -0
  17. data/Rakefile +7 -0
  18. data/SECURITY.md +59 -0
  19. data/app/assets/images/storage_access.svg +2 -0
  20. data/app/assets/javascripts/shopify_app/enable_cookies.js +3 -0
  21. data/app/assets/javascripts/shopify_app/itp_helper.js +40 -0
  22. data/app/assets/javascripts/shopify_app/partition_cookies.js +8 -0
  23. data/app/assets/javascripts/shopify_app/redirect.js +33 -0
  24. data/app/assets/javascripts/shopify_app/request_storage_access.js +3 -0
  25. data/app/assets/javascripts/shopify_app/storage_access.js +153 -0
  26. data/app/assets/javascripts/shopify_app/storage_access_redirect.js +17 -0
  27. data/app/assets/javascripts/shopify_app/top_level.js +2 -0
  28. data/app/assets/javascripts/shopify_app/top_level_interaction.js +11 -0
  29. data/app/controllers/concerns/shopify_app/authenticated.rb +16 -0
  30. data/app/controllers/concerns/shopify_app/require_known_shop.rb +39 -0
  31. data/app/controllers/shopify_app/authenticated_controller.rb +8 -0
  32. data/app/controllers/shopify_app/callback_controller.rb +140 -0
  33. data/app/controllers/shopify_app/extension_verification_controller.rb +15 -0
  34. data/app/controllers/shopify_app/sessions_controller.rb +184 -0
  35. data/app/controllers/shopify_app/webhooks_controller.rb +37 -0
  36. data/app/views/shopify_app/partials/_button_styles.html.erb +104 -0
  37. data/app/views/shopify_app/partials/_card_styles.html.erb +33 -0
  38. data/app/views/shopify_app/partials/_empty_state_styles.html.erb +129 -0
  39. data/app/views/shopify_app/partials/_layout_styles.html.erb +167 -0
  40. data/app/views/shopify_app/partials/_typography_styles.html.erb +35 -0
  41. data/app/views/shopify_app/sessions/enable_cookies.html.erb +75 -0
  42. data/app/views/shopify_app/sessions/new.html.erb +123 -0
  43. data/app/views/shopify_app/sessions/request_storage_access.html.erb +68 -0
  44. data/app/views/shopify_app/sessions/top_level_interaction.html.erb +64 -0
  45. data/app/views/shopify_app/shared/redirect.html.erb +23 -0
  46. data/config/locales/cs.yml +23 -0
  47. data/config/locales/da.yml +20 -0
  48. data/config/locales/de.yml +22 -0
  49. data/config/locales/en.yml +15 -0
  50. data/config/locales/es.yml +22 -0
  51. data/config/locales/fi.yml +20 -0
  52. data/config/locales/fr.yml +23 -0
  53. data/config/locales/hi.yml +23 -0
  54. data/config/locales/it.yml +21 -0
  55. data/config/locales/ja.yml +17 -0
  56. data/config/locales/ko.yml +19 -0
  57. data/config/locales/ms.yml +22 -0
  58. data/config/locales/nb.yml +21 -0
  59. data/config/locales/nl.yml +21 -0
  60. data/config/locales/pl.yml +21 -0
  61. data/config/locales/pt-BR.yml +21 -0
  62. data/config/locales/pt-PT.yml +22 -0
  63. data/config/locales/sv.yml +21 -0
  64. data/config/locales/th.yml +20 -0
  65. data/config/locales/tr.yml +22 -0
  66. data/config/locales/zh-CN.yml +16 -0
  67. data/config/locales/zh-TW.yml +16 -0
  68. data/config/routes.rb +23 -0
  69. data/docs/Quickstart.md +93 -0
  70. data/docs/Releasing.md +18 -0
  71. data/docs/Troubleshooting.md +16 -0
  72. data/docs/install-on-dev-shop.png +0 -0
  73. data/docs/test-your-app.png +0 -0
  74. data/images/app-proxy-screenshot.png +0 -0
  75. data/karma.conf.js +44 -0
  76. data/lib/generators/shopify_app/add_after_authenticate_job/add_after_authenticate_job_generator.rb +47 -0
  77. data/lib/generators/shopify_app/add_after_authenticate_job/templates/after_authenticate_job.rb +11 -0
  78. data/lib/generators/shopify_app/add_marketing_activity_extension/add_marketing_activity_extension_generator.rb +40 -0
  79. data/lib/generators/shopify_app/add_marketing_activity_extension/templates/marketing_activities_controller.rb +62 -0
  80. data/lib/generators/shopify_app/add_webhook/add_webhook_generator.rb +69 -0
  81. data/lib/generators/shopify_app/add_webhook/templates/webhook_job.rb.tt +13 -0
  82. data/lib/generators/shopify_app/app_proxy_controller/app_proxy_controller_generator.rb +26 -0
  83. data/lib/generators/shopify_app/app_proxy_controller/templates/app_proxy_controller.rb +8 -0
  84. data/lib/generators/shopify_app/app_proxy_controller/templates/app_proxy_route.rb +11 -0
  85. data/lib/generators/shopify_app/app_proxy_controller/templates/index.html.erb +19 -0
  86. data/lib/generators/shopify_app/authenticated_controller/authenticated_controller_generator.rb +15 -0
  87. data/lib/generators/shopify_app/authenticated_controller/templates/authenticated_controller.rb +5 -0
  88. data/lib/generators/shopify_app/controllers/controllers_generator.rb +30 -0
  89. data/lib/generators/shopify_app/home_controller/home_controller_generator.rb +26 -0
  90. data/lib/generators/shopify_app/home_controller/templates/home_controller.rb +8 -0
  91. data/lib/generators/shopify_app/home_controller/templates/index.html.erb +21 -0
  92. data/lib/generators/shopify_app/install/install_generator.rb +83 -0
  93. data/lib/generators/shopify_app/install/templates/_flash_messages.html.erb +3 -0
  94. data/lib/generators/shopify_app/install/templates/embedded_app.html.erb +41 -0
  95. data/lib/generators/shopify_app/install/templates/flash_messages.js +24 -0
  96. data/lib/generators/shopify_app/install/templates/omniauth.rb +3 -0
  97. data/lib/generators/shopify_app/install/templates/session_store.rb +4 -0
  98. data/lib/generators/shopify_app/install/templates/shopify_app.js +15 -0
  99. data/lib/generators/shopify_app/install/templates/shopify_app.rb.tt +15 -0
  100. data/lib/generators/shopify_app/install/templates/shopify_app_index.js +2 -0
  101. data/lib/generators/shopify_app/install/templates/shopify_provider.rb +20 -0
  102. data/lib/generators/shopify_app/install/templates/user_agent.rb +6 -0
  103. data/lib/generators/shopify_app/rotate_shopify_token_job/rotate_shopify_token_job_generator.rb +16 -0
  104. data/lib/generators/shopify_app/rotate_shopify_token_job/templates/rotate_shopify_token.rake +17 -0
  105. data/lib/generators/shopify_app/rotate_shopify_token_job/templates/rotate_shopify_token_job.rb +42 -0
  106. data/lib/generators/shopify_app/routes/routes_generator.rb +32 -0
  107. data/lib/generators/shopify_app/routes/templates/routes.rb +12 -0
  108. data/lib/generators/shopify_app/shop_model/shop_model_generator.rb +43 -0
  109. data/lib/generators/shopify_app/shop_model/templates/db/migrate/create_shops.erb +15 -0
  110. data/lib/generators/shopify_app/shop_model/templates/shop.rb +8 -0
  111. data/lib/generators/shopify_app/shop_model/templates/shops.yml +3 -0
  112. data/lib/generators/shopify_app/shopify_app_generator.rb +18 -0
  113. data/lib/generators/shopify_app/user_model/templates/db/migrate/create_users.erb +16 -0
  114. data/lib/generators/shopify_app/user_model/templates/user.rb +8 -0
  115. data/lib/generators/shopify_app/user_model/templates/users.yml +4 -0
  116. data/lib/generators/shopify_app/user_model/user_model_generator.rb +43 -0
  117. data/lib/generators/shopify_app/views/views_generator.rb +30 -0
  118. data/lib/shopify_app.rb +61 -0
  119. data/lib/shopify_app/configuration.rb +94 -0
  120. data/lib/shopify_app/controller_concerns/app_proxy_verification.rb +38 -0
  121. data/lib/shopify_app/controller_concerns/csrf_protection.rb +15 -0
  122. data/lib/shopify_app/controller_concerns/embedded_app.rb +20 -0
  123. data/lib/shopify_app/controller_concerns/itp.rb +45 -0
  124. data/lib/shopify_app/controller_concerns/localization.rb +23 -0
  125. data/lib/shopify_app/controller_concerns/login_protection.rb +231 -0
  126. data/lib/shopify_app/controller_concerns/payload_verification.rb +24 -0
  127. data/lib/shopify_app/controller_concerns/webhook_verification.rb +23 -0
  128. data/lib/shopify_app/engine.rb +25 -0
  129. data/lib/shopify_app/jobs/scripttags_manager_job.rb +16 -0
  130. data/lib/shopify_app/jobs/webhooks_manager_job.rb +16 -0
  131. data/lib/shopify_app/managers/scripttags_manager.rb +78 -0
  132. data/lib/shopify_app/managers/webhooks_manager.rb +62 -0
  133. data/lib/shopify_app/middleware/jwt_middleware.rb +42 -0
  134. data/lib/shopify_app/middleware/same_site_cookie_middleware.rb +34 -0
  135. data/lib/shopify_app/session/in_memory_session_store.rb +31 -0
  136. data/lib/shopify_app/session/in_memory_shop_session_store.rb +14 -0
  137. data/lib/shopify_app/session/in_memory_user_session_store.rb +14 -0
  138. data/lib/shopify_app/session/jwt.rb +61 -0
  139. data/lib/shopify_app/session/null_user_session_store.rb +22 -0
  140. data/lib/shopify_app/session/session_repository.rb +56 -0
  141. data/lib/shopify_app/session/session_storage.rb +20 -0
  142. data/lib/shopify_app/session/shop_session_storage.rb +42 -0
  143. data/lib/shopify_app/session/user_session_storage.rb +42 -0
  144. data/lib/shopify_app/test_helpers/all.rb +2 -0
  145. data/lib/shopify_app/test_helpers/webhook_verification_helper.rb +17 -0
  146. data/lib/shopify_app/utils.rb +24 -0
  147. data/lib/shopify_app/version.rb +4 -0
  148. data/package-lock.json +7177 -0
  149. data/package.json +28 -0
  150. data/service.yml +7 -0
  151. data/shipit.rubygems.yml +4 -0
  152. data/shopify_app.gemspec +37 -0
  153. data/translation.yml +7 -0
  154. data/webpack.config.js +24 -0
  155. data/yarn.lock +5263 -0
  156. metadata +420 -0
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ShopifyApp
4
+ class ExtensionVerificationController < ActionController::Base
5
+ include ShopifyApp::PayloadVerification
6
+ protect_from_forgery with: :null_session
7
+ before_action :verify_request
8
+
9
+ private
10
+
11
+ def verify_request
12
+ head(:unauthorized) unless hmac_valid?(request.body.read)
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,184 @@
1
+ # frozen_string_literal: true
2
+ module ShopifyApp
3
+ class SessionsController < ActionController::Base
4
+ include ShopifyApp::LoginProtection
5
+
6
+ layout false, only: :new
7
+
8
+ after_action only: [:new, :create] do |controller|
9
+ controller.response.headers.except!('X-Frame-Options')
10
+ end
11
+
12
+ def new
13
+ authenticate if sanitized_shop_name.present?
14
+ end
15
+
16
+ def create
17
+ authenticate
18
+ end
19
+
20
+ def enable_cookies
21
+ return unless validate_shop_presence
22
+
23
+ render(:enable_cookies, layout: false, locals: {
24
+ does_not_have_storage_access_url: top_level_interaction_path(
25
+ shop: sanitized_shop_name,
26
+ return_to: params[:return_to]
27
+ ),
28
+ has_storage_access_url: login_url_with_optional_shop(top_level: true),
29
+ app_target_url: granted_storage_access_path(
30
+ shop: sanitized_shop_name,
31
+ return_to: params[:return_to]
32
+ ),
33
+ current_shopify_domain: current_shopify_domain,
34
+ })
35
+ end
36
+
37
+ def top_level_interaction
38
+ @url = login_url_with_optional_shop(top_level: true)
39
+ validate_shop_presence
40
+ end
41
+
42
+ def granted_storage_access
43
+ return unless validate_shop_presence
44
+
45
+ session['shopify.granted_storage_access'] = true
46
+
47
+ copy_return_to_param_to_session
48
+
49
+ redirect_to(return_address_with_params({ shop: @shop }))
50
+ end
51
+
52
+ def destroy
53
+ reset_session
54
+ flash[:notice] = I18n.t('.logged_out')
55
+ redirect_to(login_url_with_optional_shop)
56
+ end
57
+
58
+ private
59
+
60
+ def authenticate
61
+ return render_invalid_shop_error unless sanitized_shop_name.present?
62
+ session['shopify.omniauth_params'] = { shop: sanitized_shop_name }
63
+
64
+ copy_return_to_param_to_session
65
+
66
+ set_user_tokens_option
67
+
68
+ if user_agent_can_partition_cookies
69
+ authenticate_with_partitioning
70
+ else
71
+ authenticate_normally
72
+ end
73
+ end
74
+
75
+ def authenticate_normally
76
+ if request_storage_access?
77
+ redirect_to_request_storage_access
78
+ elsif authenticate_in_context?
79
+ authenticate_in_context
80
+ else
81
+ authenticate_at_top_level
82
+ end
83
+ end
84
+
85
+ def authenticate_with_partitioning
86
+ if session['shopify.cookies_persist']
87
+ clear_top_level_oauth_cookie
88
+ authenticate_in_context
89
+ else
90
+ set_top_level_oauth_cookie
91
+ enable_cookie_access
92
+ end
93
+ end
94
+
95
+ # rubocop:disable Lint/SuppressedException
96
+ def set_user_tokens_option
97
+ if shop_session.blank?
98
+ session[:user_tokens] = false
99
+ return
100
+ end
101
+
102
+ session[:user_tokens] = ShopifyApp::SessionRepository.user_storage.present?
103
+
104
+ ShopifyAPI::Session.temp(
105
+ domain: shop_session.domain,
106
+ token: shop_session.token,
107
+ api_version: shop_session.api_version
108
+ ) do
109
+ ShopifyAPI::Metafield.find(:token_validity_bogus_check)
110
+ end
111
+ rescue ActiveResource::UnauthorizedAccess
112
+ session[:user_tokens] = false
113
+ rescue StandardError
114
+ end
115
+ # rubocop:enable Lint/SuppressedException
116
+
117
+ def validate_shop_presence
118
+ @shop = sanitized_shop_name
119
+ unless @shop
120
+ render_invalid_shop_error
121
+ return false
122
+ end
123
+
124
+ true
125
+ end
126
+
127
+ def copy_return_to_param_to_session
128
+ session[:return_to] = RedirectSafely.make_safe(params[:return_to], '/') if params[:return_to]
129
+ end
130
+
131
+ def render_invalid_shop_error
132
+ flash[:error] = I18n.t('invalid_shop_url')
133
+ redirect_to(return_address)
134
+ end
135
+
136
+ def enable_cookie_access
137
+ fullpage_redirect_to(enable_cookies_path(
138
+ shop: sanitized_shop_name,
139
+ return_to: session[:return_to]
140
+ ))
141
+ end
142
+
143
+ def authenticate_in_context
144
+ redirect_to("#{main_app.root_path}auth/shopify")
145
+ end
146
+
147
+ def authenticate_at_top_level
148
+ fullpage_redirect_to(login_url_with_optional_shop(top_level: true))
149
+ end
150
+
151
+ def authenticate_in_context?
152
+ return true unless ShopifyApp.configuration.embedded_app?
153
+ params[:top_level]
154
+ end
155
+
156
+ def request_storage_access?
157
+ return false unless ShopifyApp.configuration.embedded_app?
158
+ return false if params[:top_level]
159
+ return false if user_agent_is_mobile
160
+ return false if user_agent_is_pos
161
+
162
+ !session['shopify.granted_storage_access']
163
+ end
164
+
165
+ def redirect_to_request_storage_access
166
+ render(
167
+ :request_storage_access,
168
+ layout: false,
169
+ locals: {
170
+ does_not_have_storage_access_url: top_level_interaction_path(
171
+ shop: sanitized_shop_name,
172
+ return_to: session[:return_to]
173
+ ),
174
+ has_storage_access_url: login_url_with_optional_shop(top_level: true),
175
+ app_target_url: granted_storage_access_path(
176
+ shop: sanitized_shop_name,
177
+ return_to: session[:return_to]
178
+ ),
179
+ current_shopify_domain: current_shopify_domain,
180
+ }
181
+ )
182
+ end
183
+ end
184
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+ module ShopifyApp
3
+ class MissingWebhookJobError < StandardError; end
4
+
5
+ class WebhooksController < ActionController::Base
6
+ include ShopifyApp::WebhookVerification
7
+
8
+ def receive
9
+ params.permit!
10
+ job_args = { shop_domain: shop_domain, webhook: webhook_params.to_h }
11
+ webhook_job_klass.perform_later(job_args)
12
+ head(:ok)
13
+ end
14
+
15
+ private
16
+
17
+ def webhook_params
18
+ params.except(:controller, :action, :type)
19
+ end
20
+
21
+ def webhook_job_klass
22
+ webhook_job_klass_name.safe_constantize || raise(ShopifyApp::MissingWebhookJobError)
23
+ end
24
+
25
+ def webhook_job_klass_name(type = webhook_type)
26
+ [webhook_namespace, "#{type}_job"].compact.join('/').classify
27
+ end
28
+
29
+ def webhook_type
30
+ params[:type]
31
+ end
32
+
33
+ def webhook_namespace
34
+ ShopifyApp.configuration.webhook_jobs_namespace
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,104 @@
1
+ <style>
2
+ .Polaris-Button {
3
+ fill:#637381;
4
+ position:relative;
5
+ display:-webkit-inline-box;
6
+ display:-ms-inline-flexbox;
7
+ display:inline-flex;
8
+ -webkit-box-align:center;
9
+ -ms-flex-align:center;
10
+ align-items:center;
11
+ -webkit-box-pack:center;
12
+ -ms-flex-pack:center;
13
+ justify-content:center;
14
+ min-height:3.6rem;
15
+ min-width:3.6rem;
16
+ margin:0;
17
+ padding:0.7rem 1.6rem;
18
+ background:linear-gradient(to bottom, white, #f9fafb);
19
+ border:1px solid #c4cdd5;
20
+ box-shadow:0 1px 0 0 rgba(22, 29, 37, 0.05);
21
+ border-radius:3px;
22
+ line-height:1;
23
+ color:#212b36;
24
+ text-align:center;
25
+ cursor:pointer;
26
+ -webkit-user-select:none;
27
+ -moz-user-select:none;
28
+ -ms-user-select:none;
29
+ user-select:none;
30
+ text-decoration:none;
31
+ transition-property:background, border, box-shadow;
32
+ transition-duration:200ms;
33
+ transition-timing-function:cubic-bezier(0.64, 0, 0.35, 1);
34
+ }
35
+
36
+ .Polaris-Button:hover {
37
+ background:linear-gradient(to bottom, #f9fafb, #f4f6f8);
38
+ border-color:#c4cdd5;
39
+ }
40
+
41
+ .Polaris-Button:focus {
42
+ border-color:#5c6ac4;
43
+ outline:0;
44
+ box-shadow:0 0 0 1px #5c6ac4;
45
+ }
46
+
47
+ .Polaris-Button:active {
48
+ background:linear-gradient(to bottom, #f4f6f8, #f4f6f8);
49
+ border-color:#c4cdd5;
50
+ box-shadow:0 0 0 0 transparent, inset 0 1px 1px 0 rgba(99, 115, 129, 0.1), inset 0 1px 4px 0 rgba(99, 115, 129, 0.2);
51
+ }
52
+
53
+ .Polaris-Button__Content {
54
+ font-size:1.5rem;
55
+ font-weight:400;
56
+ line-height:1.6rem;
57
+ text-transform:initial;
58
+ letter-spacing:initial;
59
+ position:relative;
60
+ display:-webkit-box;
61
+ display:-ms-flexbox;
62
+ display:flex;
63
+ -webkit-box-pack:center;
64
+ -ms-flex-pack:center;
65
+ justify-content:center;
66
+ -webkit-box-align:center;
67
+ -ms-flex-align:center;
68
+ align-items:center;
69
+ min-width:1px;
70
+ min-height:1px;
71
+ }
72
+
73
+ @media (min-width: 40em) {
74
+ .Polaris-Button__Content {
75
+ font-size:1.4rem;
76
+ }
77
+ }
78
+
79
+ .Polaris-Button--primary {
80
+ background:linear-gradient(to bottom, #6371c7, #5563c1);
81
+ border-color:#3f4eae;
82
+ box-shadow:inset 0 1px 0 0 #6774c8, 0 1px 0 0 rgba(22, 29, 37, 0.05), 0 0 0 0 transparent;
83
+ color:white;
84
+ fill:white;
85
+ }
86
+
87
+ .Polaris-Button--primary:hover {
88
+ background:linear-gradient(to bottom, #5c6ac4, #4959bd);
89
+ border-color:#3f4eae;
90
+ color:white;
91
+ text-decoration:none;
92
+ }
93
+
94
+ .Polaris-Button--primary:focus {
95
+ border-color:#202e78;
96
+ box-shadow:inset 0 1px 0 0 #6f7bcb, 0 1px 0 0 rgba(22, 29, 37, 0.05), 0 0 0 1px #202e78;
97
+ }
98
+
99
+ .Polaris-Button--primary:active {
100
+ background:linear-gradient(to bottom, #3f4eae, #3f4eae);
101
+ border-color:#38469b;
102
+ box-shadow:inset 0 0 0 0 transparent, 0 1px 0 0 rgba(22, 29, 37, 0.05), 0 0 1px 0 #38469b;
103
+ }
104
+ </style>
@@ -0,0 +1,33 @@
1
+ <style>
2
+ .Polaris-Card {
3
+ overflow:hidden;
4
+ background-color:white;
5
+ box-shadow:0 0 0 1px rgba(63, 63, 68, 0.05), 0 1px 3px 0 rgba(63, 63, 68, 0.15);
6
+ }
7
+
8
+ .Polaris-Card + .Polaris-Card {
9
+ margin-top:2rem;
10
+ }
11
+
12
+ @media (min-width: 30.625em) {
13
+ .Polaris-Card {
14
+ border-radius:3px;
15
+ }
16
+ }
17
+
18
+ .Polaris-Card__Header {
19
+ padding:2rem 2rem 0;
20
+ }
21
+
22
+ .Polaris-Card__Section {
23
+ padding:2rem;
24
+ }
25
+
26
+ .Polaris-Card__Section + .Polaris-Card__Section {
27
+ border-top:1px solid #dfe3e8;
28
+ }
29
+
30
+ .Polaris-Card__Section--subdued {
31
+ background-color:#f9fafb;
32
+ }
33
+ </style>
@@ -0,0 +1,129 @@
1
+ <style>
2
+ .Polaris-EmptyState {
3
+ display:-webkit-box;
4
+ display:-ms-flexbox;
5
+ display:flex;
6
+ -webkit-box-orient:vertical;
7
+ -webkit-box-direction:normal;
8
+ -ms-flex-direction:column;
9
+ flex-direction:column;
10
+ -webkit-box-align:center;
11
+ -ms-flex-align:center;
12
+ align-items:center;
13
+ width:100%;
14
+ margin:2rem auto 0 auto;
15
+ padding:2rem 0;
16
+ max-width:99.8rem;
17
+ }
18
+
19
+ @media (min-width: 46.5em) {
20
+ .Polaris-EmptyState--imageContained .Polaris-EmptyState__Image {
21
+ position:initial;
22
+ width:100%;
23
+ }
24
+ }
25
+
26
+ .Polaris-EmptyState__Section {
27
+ position:relative;
28
+ display:-webkit-box;
29
+ display:-ms-flexbox;
30
+ display:flex;
31
+ -webkit-box-orient:vertical;
32
+ -webkit-box-direction:normal;
33
+ -ms-flex-direction:column;
34
+ flex-direction:column;
35
+ -webkit-box-flex:1;
36
+ -ms-flex:1 1 auto;
37
+ flex:1 1 auto;
38
+ width:100%;
39
+ }
40
+
41
+ @media (min-width: 46.5em) {
42
+ .Polaris-EmptyState__Section {
43
+ left:2rem;
44
+ -webkit-box-orient:horizontal;
45
+ -webkit-box-direction:normal;
46
+ -ms-flex-direction:row;
47
+ flex-direction:row;
48
+ -webkit-box-align:center;
49
+ -ms-flex-align:center;
50
+ align-items:center;
51
+ }
52
+ }
53
+
54
+ .Polaris-EmptyState__ImageContainer,
55
+ .Polaris-EmptyState__DetailsContainer {
56
+ -webkit-box-flex:1;
57
+ -ms-flex:1 1 auto;
58
+ flex:1 1 auto;
59
+ padding:0;
60
+ margin:0;
61
+ }
62
+
63
+ @media (min-width: 46.5em) {
64
+ .Polaris-EmptyState__ImageContainer,
65
+ .Polaris-EmptyState__DetailsContainer {
66
+ -ms-flex-preferred-size:50%;
67
+ flex-basis:50%;
68
+ }
69
+ }
70
+
71
+ @media (max-width: 30.625em) {
72
+ .Polaris-EmptyState__ImageContainer,
73
+ .Polaris-EmptyState__DetailsContainer {
74
+ overflow-x:hidden;
75
+ }
76
+ }
77
+
78
+ .Polaris-EmptyState__Details {
79
+ position:relative;
80
+ z-index:10;
81
+ padding:0 1.6rem;
82
+ width:33.6rem;
83
+ }
84
+
85
+ @media (min-width: 30.625em) {
86
+ .Polaris-EmptyState__Details {
87
+ padding:0;
88
+ }
89
+ }
90
+
91
+ .Polaris-EmptyState__Content {
92
+ font-size:1.6rem;
93
+ font-weight:400;
94
+ line-height:2.4rem;
95
+ color:#637381;
96
+ }
97
+
98
+ @media (min-width: 40em) {
99
+ .Polaris-EmptyState__Content {
100
+ font-size:2rem;
101
+ line-height:2.8rem;
102
+ }
103
+ }
104
+
105
+ .Polaris-EmptyState__Actions {
106
+ margin-top:1.6rem;
107
+ }
108
+
109
+ .Polaris-EmptyState__Image {
110
+ display: none;
111
+ }
112
+
113
+ @media (min-width: 30.625em) {
114
+ .Polaris-EmptyState__Image {
115
+ display: block;
116
+ margin-left:-60%;
117
+ margin-top:-30%;
118
+ width:200%;
119
+ }
120
+ }
121
+
122
+ @media (min-width: 46.5em) {
123
+ .Polaris-EmptyState__Image {
124
+ margin-top:0;
125
+ margin-left:-90%;
126
+ width:200%;
127
+ }
128
+ }
129
+ </style>