Skip to content

Commit 14806a7

Browse files
committed
Update with dark mode, accessiblity, bug fixes, umd support
1 parent a343f39 commit 14806a7

36 files changed

+1394
-800
lines changed

CONTRIBUTING.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,22 @@
1212
## How to contribute code?
1313
Here are the basic steps to get started contributing code:
1414

15-
1. Fork the [repo](https://github.com/techlab/jquery-smartwizard/) and get development running on your computer.
16-
2. Install gulp and karma `npm install gulp-cli karma-cli -g`
17-
3. Install the npm development dependencies by the command `npm install` on the project folder (Should have NodeJS installed).
15+
1. Fork the [repo](https://github.com/techlab/jquery-smartwizard/).
16+
2. Install the dependencies, run `npm install`.
17+
3. Start the project, run `npm start`.
1818
4. Replicate the issue you're trying to fix or spec out the feature you're trying to add.
19-
5. Run `gulp watch` before start changing code. It will auto build and bundle the `.js` and `.css` files when you change.
20-
6. Change the code to fix the bug or add the feature. All changes should happen in the relevant `src/js/*.js` and `src/css/*.css` files.
21-
7. Build the code by running `npm run build` or `gulp build`.
22-
8. Run the test cases by running `npm test` or `gulp test`, you can also add more test cases based on your new change.
23-
9. Verify that your fix or feature works.
24-
10. Commit your changes with an informative description.
25-
11. Open a pull request to the [dev](https://github.com/techlab/jquery-smartwizard/tree/dev) branch of the [repo](https://github.com/techlab/jquery-smartwizard/) with your new commit and a descriptive message about what the PR does.
19+
5. Modify the code to fix the bug or to add the feature. All changes should happen in the relevant `src/js/*.js` and `src/scss/*.scss` files.
20+
6. Verify that your fix or feature works.
21+
7. Run the test cases by running `npm test`, you can also add more test cases based on your new change.
22+
8. Build the code by running `npm run build`.
23+
9. Commit your changes with an informative description.
24+
10. Open a pull request to the [dev](https://github.com/techlab/jquery-smartwizard/tree/dev) branch of the [repo](https://github.com/techlab/jquery-smartwizard/) with your new commit and a descriptive message about what the PR does.
2625

2726
Thank you for your contribution!
2827

2928
##### Notes for pull request
3029
- Follow the same code style as the library.
31-
- Run the test suites in the `test` directory first by running `npm test` or `gulp test`.
30+
- Run the test suites in the `test` directory first by running `npm test`.
3231
- Don't modify any files in the `dist` directory.
3332
- Don't alter the licence headers.
3433

README.md

Lines changed: 74 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22
#### The awesome jQuery step wizard plugin.
33

44
[![Build Status](https://travis-ci.org/techlab/jquery-smartwizard.svg?branch=master)](https://travis-ci.org/techlab/jquery-smartwizard)
5-
[![npm version](https://badge.fury.io/js/smartwizard.svg)](https://badge.fury.io/js/smartwizard)
6-
[![Latest Stable Version](https://poser.pugx.org/techlab/smartwizard/v/stable)](https://packagist.org/packages/techlab/smartwizard)
5+
[![npm version](https://badge.fury.io/js/smartwizard.svg)](https://www.npmjs.com/package/smartwizard)
6+
[![Packagist Version](https://badgen.net/packagist/v/techlab/smartwizard)](https://packagist.org/packages/techlab/smartwizard)
7+
[![Npm Downloadsl](https://badgen.net/npm/dm/smartwizard?icon=npm)](https://www.npmjs.com/package/smartwizard)
8+
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/smartwizard/badge?style=rounded)](https://www.jsdelivr.com/package/npm/smartwizard)
79
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/techlab/jquery-smartwizard/master/LICENSE)
10+
[![GitHub Repo](https://badgen.net/badge/icon/jquery-smartwizard?icon=github&label=&color=0da4d3)](https://github.com/techlab/jquery-smartwizard)
811
[![Donate on Paypal](https://img.shields.io/badge/PayPal-dipuraj-blue.svg)](https://www.paypal.me/dipuraj)
912

1013

11-
**jQuery Smart Wizard** is a step wizard plugin for jQuery.
14+
**jQuery Smart Wizard** is an accessible step wizard plugin for jQuery.
1215
Provides a neat and stylish interface for your forms, checkout screen, registration steps, etc.
1316
Easy implementation, Bootstrap compatiblity, customizable toolbars, themes, events and Ajax support are few of the features.
1417

15-
1618
+ [Homepage](http://techlaboratory.net/jquery-smartwizard)
1719
+ [Documentation](http://techlaboratory.net/jquery-smartwizard#documentation)
1820
+ [Demos](http://techlaboratory.net/jquery-smartwizard#demo)
@@ -52,37 +54,56 @@ Installation
5254
### [Composer](https://packagist.org/packages/techlab/smartwizard)
5355
composer require techlab/smartwizard
5456

57+
### [CDN - jsDelivr](https://www.jsdelivr.com/package/npm/smartwizard)
58+
```html
59+
<!-- CSS -->
60+
<link href="https://cdn.jsdelivr.net/npm/smartwizard@5/dist/css/smart_wizard_all.min.css" rel="stylesheet" type="text/css" />
61+
62+
<!-- JavaScript -->
63+
<script src="https://cdn.jsdelivr.net/npm/smartwizard@5/dist/js/jquery.smartWizard.min.js" type="text/javascript"></script>
64+
```
65+
### [CDN - UNPKG](https://unpkg.com/browse/smartwizard/)
66+
```html
67+
<!-- CSS -->
68+
<link href="https://unpkg.com/smartwizard@5/dist/css/smart_wizard_all.min.css" rel="stylesheet" type="text/css" />
69+
70+
<!-- JavaScript -->
71+
<script src="https://unpkg.com/smartwizard@5/dist/js/jquery.smartWizard.min.js" type="text/javascript"></script>
72+
```
73+
5574
### Download
5675
#### [Download from GitHub](https://github.com/techlab/jquery-smartwizard/archive/master.zip)
5776

5877
Features
5978
-----
6079

6180
- Standalone CSS
81+
- Accessible controls
6282
- Bootstrap compatible
63-
- Various themes included
64-
- Customizable CSS
83+
- Cool themes included
84+
- Dark mode
6585
- URL navigation and selection
6686
- Event support
67-
- Ajax content loading support
87+
- Ajax content support
6888
- Keyboard navigation
69-
- Auto content height adjustment
89+
- Auto height adjustment
7090
- Cool transition animations (fade/slide-horizontal/slide-vertical/slide-swing)
7191
- External anchor support
7292
- Easy to implement and minimal HTML required
7393
- Customizable toolbar, option to add extra buttons
74-
- Compatible with all jQuery versions (jQuery 1.11.1+, jQuery 2+, jQuery 3.5+)
75-
- Supports all modern browsers
7694
- Responsive design
77-
- In-built reset method
95+
- reset option
7896
- Easy navigation with step anchors and navigation buttons
97+
- Easy to implement and minimal HTML required
98+
- Supports all modern browsers
99+
- Compatible with all jQuery versions (jQuery 1.11.1+, jQuery 2+, jQuery 3.5+)
79100

80101
Usage
81102
-----
82103

83104
Include SmartWizard CSS
84105
```html
85-
<link href="../dist/css/smart_wizard_all.min.css" rel="stylesheet" type="text/css" />
106+
<link href="https://cdn.jsdelivr.net/npm/smartwizard@5/dist/css/smart_wizard_all.min.css" rel="stylesheet" type="text/css" />
86107
```
87108

88109
Include HTML (*This is the basic HTML markup for the Smart Wizard. You can customize it by adding your on steps content*).
@@ -136,7 +157,7 @@ Include jQuery (*ignore this if you have already included on the page*).
136157

137158
Include SmartWizard plugin
138159
```html
139-
<script src="../dist/js/jquery.smartWizard.min.js" type="text/javascript"></script>
160+
<script src="https://cdn.jsdelivr.net/npm/smartwizard@5/dist/js/jquery.smartWizard.min.js" type="text/javascript"></script>
140161
```
141162
Initialize the SmartWizard
142163
```html
@@ -156,45 +177,46 @@ Please see the [documentation](http://techlaboratory.net/jquery-smartwizard#docu
156177

157178
```JavaScript
158179
$('#smartwizard').smartWizard({
159-
selected: 0, // Initial selected step, 0 = first step
160-
theme: 'default', // theme for the wizard, related css need to include for other than default theme
161-
justified: true, // Nav menu justification. true/false
162-
autoAdjustHeight: true, // Automatically adjust content height
163-
cycleSteps: false, // Allows to cycle the navigation of steps
164-
backButtonSupport: true, // Enable the back button support
165-
enableURLhash: true, // Enable selection of the step based on url hash
166-
transition: {
167-
animation: 'none', // Effect on navigation, none/fade/slide-horizontal/slide-vertical/slide-swing
168-
speed: '400', // Transion animation speed
169-
easing:'' // Transition animation easing. Not supported without a jQuery easing plugin
170-
},
171-
toolbarSettings: {
172-
toolbarPosition: 'bottom', // none, top, bottom, both
173-
toolbarButtonPosition: 'right', // left, right, center
174-
showNextButton: true, // show/hide a Next button
175-
showPreviousButton: true, // show/hide a Previous button
176-
toolbarExtraButtons: [] // Extra buttons to show on toolbar, array of jQuery input/buttons elements
177-
},
178-
anchorSettings: {
179-
anchorClickable: true, // Enable/Disable anchor navigation
180-
enableAllAnchors: false, // Activates all anchors clickable all times
181-
markDoneStep: true, // Add done state on navigation
182-
markAllPreviousStepsAsDone: true, // When a step selected by url hash, all previous steps are marked done
183-
removeDoneStepOnNavigateBack: false, // While navigate back done step after active step will be cleared
184-
enableAnchorOnDoneStep: true // Enable/Disable the done steps navigation
185-
},
186-
keyboardSettings: {
187-
keyNavigation: true, // Enable/Disable keyboard navigation(left and right keys are used if enabled)
188-
keyLeft: [37], // Left key code
189-
keyRight: [39] // Right key code
190-
},
191-
lang: { // Language variables for button
192-
next: 'Next',
193-
previous: 'Previous'
194-
},
195-
disabledSteps: [], // Array Steps disabled
196-
errorSteps: [], // Highlight step with errors
197-
hiddenSteps: [] // Hidden steps
180+
selected: 0, // Initial selected step, 0 = first step
181+
theme: 'default', // theme for the wizard, related css need to include for other than default theme
182+
justified: true, // Nav menu justification. true/false
183+
darkMode:false, // Enable/disable Dark Mode if the theme supports. true/false
184+
autoAdjustHeight: true, // Automatically adjust content height
185+
cycleSteps: false, // Allows to cycle the navigation of steps
186+
backButtonSupport: true, // Enable the back button support
187+
enableURLhash: true, // Enable selection of the step based on url hash
188+
transition: {
189+
animation: 'none', // Effect on navigation, none/fade/slide-horizontal/slide-vertical/slide-swing
190+
speed: '400', // Transion animation speed
191+
easing:'' // Transition animation easing. Not supported without a jQuery easing plugin
192+
},
193+
toolbarSettings: {
194+
toolbarPosition: 'bottom', // none, top, bottom, both
195+
toolbarButtonPosition: 'right', // left, right, center
196+
showNextButton: true, // show/hide a Next button
197+
showPreviousButton: true, // show/hide a Previous button
198+
toolbarExtraButtons: [] // Extra buttons to show on toolbar, array of jQuery input/buttons elements
199+
},
200+
anchorSettings: {
201+
anchorClickable: true, // Enable/Disable anchor navigation
202+
enableAllAnchors: false, // Activates all anchors clickable all times
203+
markDoneStep: true, // Add done state on navigation
204+
markAllPreviousStepsAsDone: true, // When a step selected by url hash, all previous steps are marked done
205+
removeDoneStepOnNavigateBack: false, // While navigate back done step after active step will be cleared
206+
enableAnchorOnDoneStep: true // Enable/Disable the done steps navigation
207+
},
208+
keyboardSettings: {
209+
keyNavigation: true, // Enable/Disable keyboard navigation(left and right keys are used if enabled)
210+
keyLeft: [37], // Left key code
211+
keyRight: [39] // Right key code
212+
},
213+
lang: { // Language variables for button
214+
next: 'Next',
215+
previous: 'Previous'
216+
},
217+
disabledSteps: [], // Array Steps disabled
218+
errorSteps: [], // Highlight step with errors
219+
hiddenSteps: [] // Hidden steps
198220
});
199221
```
200222

dist/css/smart_wizard.css

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
}
5050

5151
.sw > .nav {
52-
display: -webkit-box;
5352
display: flex;
5453
flex-wrap: wrap;
5554
list-style: none;
@@ -60,10 +59,7 @@
6059

6160
@media screen and (max-width: 640px) {
6261
.sw > .nav {
63-
-webkit-box-orient: vertical !important;
64-
-webkit-box-direction: normal !important;
6562
flex-direction: column !important;
66-
-webkit-box-flex: 1;
6763
flex: 1 auto;
6864
}
6965
}
@@ -72,12 +68,10 @@
7268
display: block;
7369
padding: .5rem 1rem;
7470
text-decoration: none;
75-
outline: 0 !important;
7671
}
7772

7873
.sw > .nav .nav-link:hover, .sw > .nav .nav-link:active, .sw > .nav .nav-link:focus {
7974
text-decoration: none;
80-
outline: 0 !important;
8175
}
8276

8377
.sw > .nav .nav-link::-moz-focus-inner {
@@ -96,11 +90,15 @@
9690

9791
.sw.sw-justified > .nav > li, .sw.sw-justified > .nav .nav-link {
9892
flex-basis: 0;
99-
-webkit-box-flex: 1;
10093
flex-grow: 1;
10194
text-align: center;
10295
}
10396

97+
.sw.sw-dark {
98+
color: rgba(255, 255, 255, 0.95);
99+
background: #000;
100+
}
101+
104102
.sw.sw-loading {
105103
-webkit-user-select: none;
106104
-moz-user-select: none;
@@ -119,7 +117,6 @@
119117
width: 100%;
120118
background: rgba(255, 255, 255, 0.7);
121119
z-index: 2;
122-
-webkit-transition: all .2s ease;
123120
transition: all .2s ease;
124121
}
125122

@@ -141,24 +138,20 @@
141138

142139
@-webkit-keyframes spin {
143140
0% {
144-
-webkit-transform: rotate(0deg);
145141
transform: rotate(0deg);
146142
}
147143

148144
100% {
149-
-webkit-transform: rotate(360deg);
150145
transform: rotate(360deg);
151146
}
152147
}
153148

154149
@keyframes spin {
155150
0% {
156-
-webkit-transform: rotate(0deg);
157151
transform: rotate(0deg);
158152
}
159153

160154
100% {
161-
-webkit-transform: rotate(360deg);
162155
transform: rotate(360deg);
163156
}
164157
}
@@ -195,14 +188,11 @@
195188
content: "";
196189
position: absolute;
197190
height: 2px;
198-
width: 100%;
191+
width: 0;
199192
left: 0px;
200193
bottom: -1px;
201194
background: #999999;
202-
-webkit-transition: all 250ms ease 0s;
203-
transition: all 250ms ease 0s;
204-
-webkit-transform: scale(0);
205-
transform: scale(0);
195+
transition: all .35s ease .15s;
206196
}
207197

208198
.sw-theme-default > .nav .nav-link.inactive {
@@ -217,8 +207,7 @@
217207

218208
.sw-theme-default > .nav .nav-link.active::after {
219209
background: #17a2b8 !important;
220-
-webkit-transform: scale(1);
221-
transform: scale(1);
210+
width: 100%;
222211
}
223212

224213
.sw-theme-default > .nav .nav-link.done {
@@ -228,17 +217,17 @@
228217

229218
.sw-theme-default > .nav .nav-link.done::after {
230219
background: #5cb85c;
231-
-webkit-transform: scale(1);
232-
transform: scale(1);
220+
width: 100%;
233221
}
234222

235223
.sw-theme-default > .nav .nav-link.disabled {
236-
color: #f9f9f9 !important;
224+
color: #dddddd !important;
237225
cursor: not-allowed;
238226
}
239227

240228
.sw-theme-default > .nav .nav-link.disabled::after {
241-
background: #f9f9f9;
229+
background: #dddddd;
230+
width: 100%;
242231
}
243232

244233
.sw-theme-default > .nav .nav-link.danger {
@@ -248,4 +237,5 @@
248237

249238
.sw-theme-default > .nav .nav-link.danger::after {
250239
background: #d9534f;
240+
width: 100%;
251241
}

0 commit comments

Comments
 (0)