rails_onboarding 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/rails_onboarding/accessibility.css +12 -3
- data/app/views/layouts/rails_onboarding/application.html.erb +16 -0
- data/lib/generators/rails_onboarding/templates/onboarding.css +28 -12
- data/lib/generators/rails_onboarding/templates/rails_onboarding.rb +7 -0
- data/lib/rails_onboarding/configuration.rb +6 -0
- data/lib/rails_onboarding/configuration_validator.rb +1 -0
- data/lib/rails_onboarding/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '02148dd5e0d60a6d6ac13ba3836f0643dd29e35021d42c7fde9253ee79d041f3'
|
|
4
|
+
data.tar.gz: e7432a5a0f8ba216053bb1a465a7a66daf705db75c408942c90879e112a2b77b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1034bcf0f0e15a1f7a7b12b1bf246d182fba115bbf2ea04410e70aaedd80879911ea0a774ea194188b0ac6f4e834a381df307ab3b7cb05521fd26f52fe56cef3
|
|
7
|
+
data.tar.gz: 804e5be1c12dff7c2d218d2b08dc5b15f7850aeaae2c4073a96411174fc87e3008df2712650c834ca5af4cdcd88bcd5accda653a68b3e2a6c0934ec649a0e492
|
|
@@ -446,15 +446,24 @@
|
|
|
446
446
|
outline: none;
|
|
447
447
|
}
|
|
448
448
|
|
|
449
|
-
/* Enhanced input validation states
|
|
450
|
-
|
|
449
|
+
/* Enhanced input validation states.
|
|
450
|
+
*
|
|
451
|
+
* Restricted to controls the user actually types into. `input` on its own also
|
|
452
|
+
* matches buttons, and a submit button is permanently :valid and never shows a
|
|
453
|
+
* placeholder - so `input:valid:not(:placeholder-shown)` painted every
|
|
454
|
+
* "Let's Get Started" and "Continue" button with the success border, over the
|
|
455
|
+
* primary-coloured border .primary-action sets. Checkboxes, radios, files,
|
|
456
|
+
* ranges and colour wells are excluded too: their borders are not rendered by
|
|
457
|
+
* the native control anyway, so validity styling on them is invisible at best
|
|
458
|
+
* and misleading at worst. */
|
|
459
|
+
:where(.onboarding-container) input:not([type="submit"], [type="button"], [type="reset"], [type="image"], [type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="color"]):invalid,
|
|
451
460
|
:where(.onboarding-container) select:invalid,
|
|
452
461
|
:where(.onboarding-container) textarea:invalid {
|
|
453
462
|
border-color: var(--onboarding-danger);
|
|
454
463
|
box-shadow: inset 0 1px 2px rgba(239, 68, 68, 0.1);
|
|
455
464
|
}
|
|
456
465
|
|
|
457
|
-
:where(.onboarding-container) input:valid:not(:placeholder-shown),
|
|
466
|
+
:where(.onboarding-container) input:not([type="submit"], [type="button"], [type="reset"], [type="image"], [type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="color"]):valid:not(:placeholder-shown),
|
|
458
467
|
:where(.onboarding-container) select:valid,
|
|
459
468
|
:where(.onboarding-container) textarea:valid:not(:placeholder-shown) {
|
|
460
469
|
border-color: var(--onboarding-success);
|
|
@@ -31,6 +31,22 @@
|
|
|
31
31
|
<%= stylesheet_link_tag "application", "data-turbo-track": "reload", media: "screen" %>
|
|
32
32
|
<% end %>
|
|
33
33
|
|
|
34
|
+
<%# Host-supplied overrides, loaded last - after both the engine's own
|
|
35
|
+
stylesheets and the host's application bundle - so retheming doesn't
|
|
36
|
+
turn into a specificity fight. The install generator writes a starter
|
|
37
|
+
file to app/assets/stylesheets/rails_onboarding_custom.css, but nothing
|
|
38
|
+
loads it until custom_css_path names it (nil by default). Prefer
|
|
39
|
+
redefining the --onboarding-* design tokens there over overriding
|
|
40
|
+
individual rules: the tokens are read by every rule in the engine, so
|
|
41
|
+
one declaration recolours the whole flow.
|
|
42
|
+
|
|
43
|
+
Steps declared with `path:` render inside the *host's* layout, not this
|
|
44
|
+
one, so a host using those has to add the same tag to those layouts for
|
|
45
|
+
the theme to carry across the whole flow. %>
|
|
46
|
+
<% if RailsOnboarding.configuration.custom_css_path.present? %>
|
|
47
|
+
<%= stylesheet_link_tag RailsOnboarding.configuration.custom_css_path, media: "screen" %>
|
|
48
|
+
<% end %>
|
|
49
|
+
|
|
34
50
|
<%= javascript_include_tag "rails_onboarding/application", "data-turbo-track": "reload", defer: true %>
|
|
35
51
|
</head>
|
|
36
52
|
<body>
|
|
@@ -1,18 +1,34 @@
|
|
|
1
|
-
/* Custom onboarding styles for your application */
|
|
2
1
|
/*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Custom onboarding styles for your application.
|
|
3
|
+
*
|
|
4
|
+
* This file does nothing until you point the initializer at it:
|
|
5
|
+
*
|
|
6
|
+
* config.custom_css_path = "rails_onboarding_custom"
|
|
7
|
+
*
|
|
8
|
+
* It is then loaded last on onboarding pages - after the engine's own
|
|
9
|
+
* stylesheets and after your application bundle - so these rules win without
|
|
10
|
+
* needing extra specificity.
|
|
11
|
+
*
|
|
12
|
+
* Prefer redefining the design tokens below over overriding individual rules.
|
|
13
|
+
* Every rule in the engine reads them, so one declaration recolours the whole
|
|
14
|
+
* flow and keeps working across gem upgrades. The full list is at the top of
|
|
15
|
+
* app/assets/stylesheets/rails_onboarding/application.css.
|
|
5
16
|
*/
|
|
6
17
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/*
|
|
10
|
-
|
|
18
|
+
:root {
|
|
19
|
+
/* Brand */
|
|
20
|
+
/* --onboarding-primary: #6366f1; */
|
|
21
|
+
/* --onboarding-primary-hover: #4f46e5; */
|
|
11
22
|
|
|
12
|
-
|
|
13
|
-
/*
|
|
14
|
-
|
|
23
|
+
/* Surfaces */
|
|
24
|
+
/* --onboarding-background: #ffffff; */
|
|
25
|
+
/* --onboarding-surface: #f8fafc; */
|
|
26
|
+
/* --onboarding-surface-elevated: #ffffff; */
|
|
27
|
+
|
|
28
|
+
/* Text */
|
|
29
|
+
/* --onboarding-text: #1f2937; */
|
|
30
|
+
/* --onboarding-text-muted: #6b7280; */
|
|
15
31
|
|
|
16
|
-
|
|
17
|
-
/*
|
|
32
|
+
/* Borders */
|
|
33
|
+
/* --onboarding-border: #e5e7eb; */
|
|
18
34
|
}
|
|
@@ -14,6 +14,13 @@ RailsOnboarding.configure do |config|
|
|
|
14
14
|
config.redirect_after_completion = :root_path
|
|
15
15
|
config.redirect_after_skip = :root_path
|
|
16
16
|
|
|
17
|
+
# Asset name of a stylesheet loaded last on onboarding pages, for matching
|
|
18
|
+
# the flow to your own design. This generator wrote a starter file to
|
|
19
|
+
# app/assets/stylesheets/rails_onboarding_custom.css - nothing loads it
|
|
20
|
+
# until you uncomment the line below. Retheme by redefining the
|
|
21
|
+
# --onboarding-* tokens in that file rather than overriding rules.
|
|
22
|
+
# config.custom_css_path = "rails_onboarding_custom"
|
|
23
|
+
|
|
17
24
|
# Feature toggles
|
|
18
25
|
config.enable_tooltips = true
|
|
19
26
|
config.enable_milestones = true
|
|
@@ -47,6 +47,12 @@ module RailsOnboarding
|
|
|
47
47
|
def initialize
|
|
48
48
|
@user_class_name = "User"
|
|
49
49
|
@include_host_styles = true # Default to including host app css
|
|
50
|
+
|
|
51
|
+
# Asset name of a host stylesheet to load after everything else on
|
|
52
|
+
# onboarding pages, for retheming the flow. The install generator writes
|
|
53
|
+
# app/assets/stylesheets/rails_onboarding_custom.css; set this to
|
|
54
|
+
# "rails_onboarding_custom" to actually load it. nil = load nothing.
|
|
55
|
+
@custom_css_path = nil
|
|
50
56
|
@redirect_after_completion = :root_path
|
|
51
57
|
@redirect_after_skip = :root_path
|
|
52
58
|
@welcome_heading = "We're excited to have you here!"
|
|
@@ -54,6 +54,7 @@ module RailsOnboarding
|
|
|
54
54
|
def validate_types
|
|
55
55
|
validate_type(:user_class_name, [ String ], "user_class_name must be a String")
|
|
56
56
|
validate_type(:include_host_styles, [ TrueClass, FalseClass ], "include_host_styles must be a Boolean")
|
|
57
|
+
validate_type(:custom_css_path, [ String ], "custom_css_path must be a String")
|
|
57
58
|
validate_type(:enable_tooltips, [ TrueClass, FalseClass ], "enable_tooltips must be a Boolean")
|
|
58
59
|
validate_type(:enable_milestones, [ TrueClass, FalseClass ], "enable_milestones must be a Boolean")
|
|
59
60
|
validate_type(:enable_analytics, [ TrueClass, FalseClass ], "enable_analytics must be a Boolean")
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails_onboarding
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Lewis
|
|
@@ -282,7 +282,7 @@ licenses:
|
|
|
282
282
|
metadata:
|
|
283
283
|
allowed_push_host: https://rubygems.org
|
|
284
284
|
homepage_uri: https://github.com/bunnahabhain/rails_onboarding
|
|
285
|
-
source_code_uri: https://github.com/bunnahabhain/rails_onboarding/tree/v0.7.
|
|
285
|
+
source_code_uri: https://github.com/bunnahabhain/rails_onboarding/tree/v0.7.2
|
|
286
286
|
changelog_uri: https://github.com/bunnahabhain/rails_onboarding/blob/master/docs/CHANGELOG.md
|
|
287
287
|
rdoc_options: []
|
|
288
288
|
require_paths:
|
|
@@ -298,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
298
298
|
- !ruby/object:Gem::Version
|
|
299
299
|
version: '0'
|
|
300
300
|
requirements: []
|
|
301
|
-
rubygems_version: 4.0.
|
|
301
|
+
rubygems_version: 4.0.18
|
|
302
302
|
specification_version: 4
|
|
303
303
|
summary: Flexible onboarding engine for Rails applications
|
|
304
304
|
test_files: []
|