diff --git a/docs/forms/checkboxes/index.html b/docs/forms/checkboxes/index.html index de600ddd..382ee3e7 100755 --- a/docs/forms/checkboxes/index.html +++ b/docs/forms/checkboxes/index.html @@ -40,6 +40,18 @@

To create a single checkbox, add an input with a type="checkbox" attribute and a corresponding label. Set the for attribute of the label to match the ID of the input so they are semantically associated.

+
	
+<input type="checkbox" name="checkbox-1" id="checkbox-0" class="custom" />
+<label for="checkbox-0">I agree</label>
+		
+ +

This will produce a basic checkbox. The default styles will set the width of the element to 100% of the parent container.

+ + + + + +

Because checkboxes use the label element for the text displayed next to the checkbox form element, we recommend wrapping the checkbox in a fieldset element that has a legend which acts as the title for the question. Add the data-role="controlgroup" attribute to the fieldset so it can be styled in a parallel way as text inputs, selects or other form elements.

Lastly, need to wrap the fieldset in a div with data-role="controlgroup" attribute to the fieldset so it can be styled in a parallel way as text inputs, selects or other form elements.

@@ -47,11 +59,11 @@
	
 <div data-role="fieldcontain">
- 	<fieldset data-role="controlgroup">
-		<legend>Agree to the terms:</legend>
-		<input type="checkbox" name="checkbox-1" id="checkbox-1" class="custom" />
-		<label for="checkbox-1">I agree</label>
-    </fieldset>
+    <fieldset data-role="controlgroup">
+	   <legend>Agree to the terms:</legend>
+	   <input type="checkbox" name="checkbox-1" id="checkbox-1" class="custom" />
+	   <label for="checkbox-1">I agree</label>
+    </fieldset>
 </div>
 
diff --git a/docs/forms/radiobuttons/index.html b/docs/forms/radiobuttons/index.html index f4976d8e..9462ac3c 100755 --- a/docs/forms/radiobuttons/index.html +++ b/docs/forms/radiobuttons/index.html @@ -44,11 +44,48 @@

Because radio buttons use the label element for the text displayed next to the checkbox form element, we recommend wrapping the radio buttons in a fieldset element that has a legend which acts as the title for the question.

-

Lastly, need to wrap the fieldset in a div with data-role="controlgroup" attribute to the fieldset so it can be styled in a parallel way as text inputs, selects or other form elements.

+

To visually integrate multiple radio buttons into a vertically grouped button set, the framework will automatically remove all margins between buttons and round only the top and bottom corners of the set if there is a data-role="controlgroup" attribute on the container.

	
-<div data-role="fieldcontain">
-    <fieldset data-role="controlgroup">
+<fieldset data-role="controlgroup">
+	<legend>Choose a pet:</legend>
+     	<input type="radio" name="radio-choice-1" id="radio-choice-1" value="choice-1" checked="checked" />
+     	<label for="radio-choice-1">Cat</label>
+
+     	<input type="radio" name="radio-choice-1" id="radio-choice-2" value="choice-2"  />
+     	<label for="radio-choice-2">Dog</label>
+
+     	<input type="radio" name="radio-choice-1" id="radio-choice-3" value="choice-3"  />
+     	<label for="radio-choice-3">Hamster</label>
+
+     	<input type="radio" name="radio-choice-1" id="radio-choice-4" value="choice-4"  />
+     	<label for="radio-choice-4">Lizard</label>
+</fieldset>
+
+ + +

This will produce a vertically grouped radio button set. The default styles set the width of the button group to 100% of the parent container and stacks the label on a separate line.

+ + +
+ Choose a pet: + + + + + + + + + + + +
+ + +
	
+<div data-role="fieldcontain">
+    <fieldset data-role="controlgroup">
     	<legend>Choose a pet:</legend>
          	<input type="radio" name="radio-choice-1" id="radio-choice-1" value="choice-1" checked="checked" />
          	<label for="radio-choice-1">Cat</label>
@@ -62,28 +99,28 @@
          	<input type="radio" name="radio-choice-1" id="radio-choice-4" value="choice-4"  />
          	<label for="radio-choice-4">Lizard</label>
     </fieldset>
-</div>
-
+</div> + -

To visually integrate multiple radio buttons into a vertically grouped button set, the framework will automatically remove all margins between buttons and round only the top and bottom corners of the set if there is a data-role="controlgroup" attribute on the fie.

- -
-
- Choose a pet: - - - - +

To visually integrate multiple radio buttons into a vertically grouped button set, the framework will automatically remove all margins between buttons and round only the top and bottom corners of the set if there is a data-role="controlgroup" attribute on the container.

- - +
+
+ Choose a pet: + + - - -
-
+ + + + + + + +
+

Horizontal radio button sets

Radio buttons can also be used for grouped button sets only a single button can be selected at once, such as a view switcher control. To make a horizontal radio button set, add the data-type="horizontal" to the fieldset.

@@ -104,7 +141,7 @@ -

The framework will float the labels so they sit side-by-side on a line, hide the radio button icons and only round the left and right edges of the group.

+

The framework will float the labels so they sit side-by-side on a line, hides the radio button icons and only round the left and right edges of the group.

diff --git a/docs/forms/search/index.html b/docs/forms/search/index.html index 66635876..8808ddd4 100755 --- a/docs/forms/search/index.html +++ b/docs/forms/search/index.html @@ -35,25 +35,37 @@

Search inputs are a new HTML type that is styled with pill-shaped corners and adds a "x" icon to clear the field once you start typing. Start with an input with a type="search" attribute in your markup.

-

Set the for attribute of the label to match the ID of the input so they are semantically associated and wrap them in a div with the data-role="fieldcontain" attribute to group them.

+

Set the for attribute of the label to match the ID of the input so they are semantically associated. It's possible to accessibly hide the label if it's not desired in the page layout, but we require that it is present in the markup for semantic and accessibility reasons.

+ +
	
+<label for="search-basic">Search Input:</label>
+<input type="search" name="search" id="searc-basic" value="" />
+				
+ +

This will produce a basic search input. The default styles set the width of the input to 100% of the parent container and stacks the label on a separate line.

+ + + + +

Optionally wrap the search input in a container with the data-role="fieldcontain" attribute to help visually group it in a longer form.

	
-<div data-role="fieldcontain">
-    <label for="search">Search Input:</label>
+<div data-role="fieldcontain">
+    <label for="search">Search Input:</label>
     <input type="search" name="password" id="search" value="" />
-</div>
-
+</div> + -

The search input is displayed like this:

+

The search input is now displayed like this:

- +

Themed variation:

- +
diff --git a/docs/forms/selects/index.html b/docs/forms/selects/index.html index 22284d71..69190e5c 100644 --- a/docs/forms/selects/index.html +++ b/docs/forms/selects/index.html @@ -38,23 +38,45 @@

By default, the framework leverages the native OS options menu to use with the custom button. When the button is clicked, the native OS menu will open. When a value is selected and the menu closes, the custom button's text is updated to match the selected value.

-

To add a select menu to your page, start with a standard select element populated with a set of option elements. Set the for attribute of the label to match the ID of the select so they are semantically associated. Wrap them in a div with the data-role="fieldcontain" attribute to help visually group it in a longer form.

+

To add a select menu to your page, start with a standard select element populated with a set of option elements. Set the for attribute of the label to match the ID of the select so they are semantically associated. It's possible to accessibly hide the label if it's not desired in the page layout, but we require that it is present in the markup for semantic and accessibility reasons.

+ +

The framework will find all select elements and automatically enhance them into select menus, no need to apply a data-role attribute. To prevent the automatic enhancement of a select, add data-role="none" attribute to the select.

+ +

+<label for="select-choice-0" class="select">Shipping method:</label>
+<select name="select-choice-0" id="select-choice-1">
+   <option value="standard">Standard: 7 day</option>
+   <option value="rush">Rush: 3 days</option>
+   <option value="express">Express: next day</option>
+   <option value="overnight">Overnight</option>
+</select>
+			
-

The framework will find all select elements and automatically enhance them into select menus. The markup for a select grouped in a field container:

+

This will produce a basic select menu. The default styles set the width of the input to 100% of the parent container and stacks the label on a separate line.

+ + + + +

Optionally wrap the selects in a container with the data-role="fieldcontain" attribute to help visually group it in a longer form.


-<div data-role="fieldcontain">
-   <label for="select-choice-1" class="select">Shipping method:</label>
+<div data-role="fieldcontain">
+   <label for="select-choice-1" class="select">Shipping method:</label>
    <select name="select-choice-1" id="select-choice-1">
       <option value="standard">Standard: 7 day</option>
       <option value="rush">Rush: 3 days</option>
       <option value="express">Express: next day</option>
       <option value="overnight">Overnight</option>
    </select>
-</div>
-
+</div> + -

produces this select menu:

+

The select input is now displayed like this:

diff --git a/docs/forms/slider/index.html b/docs/forms/slider/index.html index 11bb17ce..87c8503e 100644 --- a/docs/forms/slider/index.html +++ b/docs/forms/slider/index.html @@ -36,19 +36,33 @@

To add a slider widget to your page, use a standard input with the type="range" attribute. The input's value is used to configure the starting position of the handle and the value populated in the text input. Specify min and max attribute values to set the slider's range. The framework will parse these attributes to configure the slider widget.

As you drag the slider's handle, the framework will update the native input's value (and vice-versa) so they are always in sync; this ensures that the value is submitted with the form.

-

Set the for attribute of the label to match the ID of the input so they are semantically associated and wrap them in a div with the data-role="fieldcontain" attribute to group them.

- +

Set the for attribute of the label to match the ID of the input so they are semantically associated. It's possible to accessibly hide the label if it's not desired in the page layout, but we require that it is present in the markup for semantic and accessibility reasons.

+ +

The framework will find all inputs elements with a type="range" and automatically enhance them into a slider with an accompanying input, no need to apply a data-role attribute. To prevent the automatic enhancement of this input into a slider, add data-role="none" attribute to the input.

and wrap them in a div with the data-role="fieldcontain" attribute to group them.

+

-<div data-role="fieldcontain">
-   <label for="slider">Input slider:</label>
-   <input type="range" name="slider" id="slider" value="25" min="0" max="100"  />
-</div>
+   <label for="slider-0">Input slider:</label>
+   <input type="range" name="slider" id="slider-0" value="25" min="0" max="100"  />
 
-

The default slider is displayed like this:

+

The default slider is displayed like this:

+ + + +

Optionally wrap the slider markup in a container with the data-role="fieldcontain" attribute to help visually group it in a longer form.

+ + +

+<div data-role="fieldcontain">
+   <label for="slider">Input slider:</label>
+   <input type="range" name="slider" id="slider" value="25" min="0" max="100"  />
+</div>
+
+ +

The slider is now be is displayed like this:

- +

Sliders also respond to key commands. Right Arrow, Up Arrow, and Page Up keys increase the value; Left Arrow, Down Arrow, and Page Down keys decrease it. To move the slider to its minimum or maximum value, use the Home or End key, respectively.

@@ -61,6 +75,22 @@ $('input').slider(); + +

Theming the slider

+

To set the theme swatch for the slider, add a data-theme attribute to the input which will apply the theme to both the input, handle and track. The track swatch can be set separately by adding the data-track-theme attribute to apply the down state version of the selected button swatch.

+ +

+<div data-role="fieldcontain">
+	<label for="slider-2">Input slider:</label>
+	<input type="range" name="slider-2" id="slider-1" value="25" min="0" max="100" data-theme="a" data-track-theme="b" />
+</div>
+		
+ +

This will produce a themed slider:

+
+ + +
diff --git a/docs/forms/switch/index.html b/docs/forms/switch/index.html index 3a247589..67aa52e2 100644 --- a/docs/forms/switch/index.html +++ b/docs/forms/switch/index.html @@ -35,27 +35,78 @@

A binary "flip" switch is a common UI element on mobile devices that is used for binary on/off or true/false data input. You can either drag the flip handle like a slider or tap one side of the switch.

-

To create a flip toggle, start with a select with two options. The first option will be styled as the "on" state switch and the second will be styled as the "off" state so write your options accordingly. Set the for attribute of the label to match the ID of the input so they are semantically associated and wrap them in a div with the data-role="fieldcontain" attribute to group them.

- +

To create a flip toggle, start with a select with two options. The first option will be styled as the "on" state switch and the second will be styled as the "off" state so write your options accordingly.

+ +

Set the for attribute of the label to match the ID of the input so they are semantically associated. It's possible to accessibly hide the label if it's not desired in the page layout, but we require that it is present in the markup for semantic and accessibility reasons.

+
	
-<div data-role="fieldcontain">
-	<label for="slider">Select slider:</label>
-	<select name="slider" id="slider" data-role="slider">
-		<option value="off">Off</option>
-		<option value="on">On</option>
-	</select> 
-</div>
+<label for="flip-a">Select slider:</label>
+<select name="slider" id="flip-a" data-role="slider">
+	<option value="off">Off</option>
+	<option value="on">On</option>
+</select> 
 
-

The flip toggle switch is displayed like this:

-
- - + +

Optionally wrap the switch markup in a container with the data-role="fieldcontain" attribute to help visually group it in a longer form.

+ +
	
+<div data-role="fieldcontain">
+<label for="flip-b">Flip switch:</label>
+	<select name="slider" id="flip-b" data-role="slider">
+		<option value="no">No</option>
+		<option value="yes">Yes</option>
+	</select> 
+</div>
+
+

The flip toggle switch is now displayed like this:

+
+ +
- + +

Theming the flip switch

+ +

Like all form elements, this widget will automatically inherit the theme from it's parent container. TO choose a specific theme color swatch, specify the data-theme attribute on the select and specify a swatch letter.

+ +
	
+<div data-role="fieldcontain">
+	<label for="flip-c">Flip switch:</label>
+	<select name="slider" id="flip-c" data-role="slider" data-theme="a">
+		<option value="no">No</option>
+		<option value="yes">Yes</option>
+	</select> 
+</div>
+
+

This results in a switch with the A swatch colors for the handle. Note that the lefthand "on" state gets the active state color.

+
+ + +
+ +

Here is a E swatch variation:

+
+ + +
+

Calling the switch plugin

This plugin will auto initialize on any page that contains a select with the data-role="slider" attribute. However, if needed you can directly call the slider plugin on any selector, just like any jQuery plugin:

diff --git a/docs/forms/textinputs/index.html b/docs/forms/textinputs/index.html index f3cd246b..b3f7a6f8 100755 --- a/docs/forms/textinputs/index.html +++ b/docs/forms/textinputs/index.html @@ -25,7 +25,7 @@
-

Text inputs

+

Text inputs & Textareas