-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1825 from Kajabi/develop
Next version bump
- Loading branch information
Showing
23 changed files
with
1,717 additions
and
748 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
190 changes: 56 additions & 134 deletions
190
docs/app/views/examples/components/form_select/_preview.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,178 +1,100 @@ | ||
<h3 class="<%= SageClassnames::TYPE::HEADING_6 %>">Default</h3> | ||
<h2>Variants</h2> | ||
|
||
<h3>Default</h3> | ||
<p>The Default variation of the Select component is a simple HTML form element.</p> | ||
<%= sage_component SageFormSelect, { | ||
name: "Characters", | ||
id: "characters", | ||
name: "Language", | ||
id: "language", | ||
select_options: [ | ||
{ | ||
text: "-- Please Select a Character --", | ||
value: "", | ||
}, | ||
{ | ||
text: "(None Specified)", | ||
value: "", | ||
text: "de - German", | ||
value: "de", | ||
}, | ||
{ | ||
text: "Mario", | ||
value: "mario", | ||
text: "en - English", | ||
value: "en", | ||
}, | ||
{ | ||
text: "Luigi", | ||
value: "luigi", | ||
text: "es - Spanish", | ||
value: "es", | ||
}, | ||
{ | ||
text: "Princess Peach", | ||
value: "princess-peach", | ||
text: "fi - Finnish", | ||
value: "fi", | ||
}, | ||
{ | ||
text: "Daisy", | ||
value: "daisy", | ||
}, | ||
{ | ||
text: "Toad", | ||
value: "toad", | ||
text: "fr - French", | ||
value: "fr", | ||
}, | ||
], | ||
message: "This is a message" | ||
} %> | ||
|
||
<h3 class="<%= SageClassnames::TYPE::HEADING_6 %>">Error state with message and disabled option</h3> | ||
<%= sage_component SageDivider, {} %> | ||
|
||
<h3>Select with Message</h3> | ||
<p>The Select component can be used with a message to provide additional context.</p> | ||
|
||
<%= sage_component SageFormSelect, { | ||
name: "Pets", | ||
has_error: true, | ||
name: "Default Currency", | ||
select_options: [ | ||
{ | ||
text: "-- Please Select a Pet --", | ||
value: "", | ||
}, | ||
{ | ||
text: "(None Specified)", | ||
value: "", | ||
selected: true | ||
}, | ||
{ | ||
text: "Dog", | ||
value: "dog", | ||
}, | ||
{ | ||
text: "Cat", | ||
value: "cat", | ||
text: "USD - United States Dollar", | ||
value: "USD", | ||
}, | ||
{ | ||
text: "Hamster", | ||
value: "hamster", | ||
text: "AED - United Arab Emirates Dirham", | ||
value: "AED", | ||
}, | ||
{ | ||
text: "Parrot", | ||
value: "parrot", | ||
text: "AFN - Afghan Afghani", | ||
value: "AFN", | ||
}, | ||
{ | ||
text: "Spider", | ||
value: "spider", | ||
disabled: true | ||
}, | ||
{ | ||
text: "Goldfish", | ||
value: "goldfish", | ||
text: "ALL - Albanian Lek", | ||
value: "ALL", | ||
}, | ||
], | ||
message: "This is a message" | ||
message: "The default currency will be used for formatting and calculation purposes." | ||
} %> | ||
|
||
<h3 class="<%= SageClassnames::TYPE::HEADING_6 %>">Disabled (with pre-selected option)</h3> | ||
<%= sage_component SageFormSelect, { | ||
name: "Sports", | ||
disabled: true, | ||
select_options: [ | ||
{ | ||
text: "Basketball", | ||
value: "basketball" | ||
}, | ||
{ | ||
text: "Football", | ||
value: "football" | ||
}, | ||
{ | ||
text: "Lacrosse", | ||
value: "lacrosse" | ||
}, | ||
{ | ||
text: "Baseball", | ||
value: "baseball", | ||
selected: true | ||
}, | ||
{ | ||
text: "Blitzball", | ||
value: "blitzball" | ||
}, | ||
] | ||
} %> | ||
<%= sage_component SageDivider, {} %> | ||
|
||
<h3>Error State</h3> | ||
<p>The Select component can indicate an error state.</p> | ||
|
||
<h3 class="<%= SageClassnames::TYPE::HEADING_6 %>">Optgroup use</h3> | ||
<%= sage_component SageFormSelect, { | ||
name: "Sports!", | ||
name: "Text direction", | ||
has_error: true, | ||
select_options: [ | ||
{ | ||
text: "Bowling", | ||
value: "bowling", | ||
}, | ||
{ | ||
group_label: "Hand Sports", | ||
group_options: [ | ||
{ | ||
text: "Football", | ||
value: "football", | ||
}, | ||
{ | ||
text: "Basketball", | ||
value: "basketball", | ||
}, | ||
], | ||
}, | ||
{ | ||
text: "Nascar", | ||
value: "nascar", | ||
selected: true, | ||
text: "Left to right (ltr)", | ||
value: "ltr", | ||
}, | ||
{ | ||
group_label: "Foot Sports", | ||
group_options: [ | ||
{ | ||
text: "Soccer", | ||
value: "soccer", | ||
}, | ||
], | ||
text: "Right to left (rtl)", | ||
value: "rtl", | ||
}, | ||
] | ||
], | ||
message: "This field is required." | ||
} %> | ||
|
||
<script> | ||
const handleOnChange = (consoles) => { | ||
var selectedText = consoles.options[consoles.selectedIndex].innerHTML; | ||
var selectedVal = consoles.value; | ||
alert("Selected Text: " + selectedText + " Value: " + selectedVal); | ||
} | ||
</script> | ||
<h3 class="<%= SageClassnames::TYPE::HEADING_6 %>">Example on how to pass additional attributes to the component</h3> | ||
<%= sage_component SageDivider, {} %> | ||
|
||
<h3>Disabled</h3> | ||
<p>The Select component can be marked as disabled. Selects labeled as Disabled will not be submitted in forms.</p> | ||
|
||
<%= sage_component SageFormSelect, { | ||
name: "Consoles", | ||
component_attributes: { | ||
onChange: "handleOnChange(this)", | ||
"my-attribute": "hello" | ||
}, | ||
name: "Text direction", | ||
disabled: true, | ||
select_options: [ | ||
{ | ||
text: "X-Box", | ||
value: "x-box" | ||
}, | ||
{ | ||
text: "PlayStation", | ||
value: "playstation" | ||
text: "Left to right (ltr)", | ||
value: "ltr", | ||
}, | ||
{ | ||
text: "Nintendo Switch", | ||
value: "switch" | ||
text: "Right to left (rtl)", | ||
value: "rtl", | ||
}, | ||
] | ||
], | ||
message: "This field is not available until you select a language." | ||
} %> | ||
|
||
<p><strong>Note:</strong> For a fully styled dropdown selector, see the Dropdown component.</p> |
6 changes: 3 additions & 3 deletions
6
docs/app/views/examples/components/form_select/_props.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 38 additions & 19 deletions
57
docs/app/views/examples/components/loader/_preview.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,48 @@ | ||
<h2 class="<%= SageClassnames::TYPE::HEADING_6 %>">Without text</h2> | ||
<div class="sage-row"> | ||
<div class="sage-col--md-6 example__block--lg"> | ||
<h2>Variants</h2> | ||
|
||
<h3>Bar</h3> | ||
<%= sage_component SageGridRow, {} do %> | ||
<%= sage_component SageGridCol, { size: 12, css_classes: "example__block--lg" } do %> | ||
<%= sage_component SageLoader, { | ||
type: "spinner" | ||
type: "bar" | ||
} %> | ||
</div> | ||
<div class="sage-col--md-6 example__block--lg"> | ||
<%= sage_component SageLoader, { | ||
type: "success" | ||
} %> | ||
</div> | ||
</div> | ||
<hr> | ||
<h2 class="<%= SageClassnames::TYPE::HEADING_6 %>">With text</h2> | ||
<div class="sage-row"> | ||
<div class="sage-col--md-6 example__block--lg"> | ||
<% end %> | ||
<% end %> | ||
|
||
<%= sage_component SageDivider, {} %> | ||
|
||
<h3>Spinner</h3> | ||
<%= sage_component SageGridRow, {} do %> | ||
<%= sage_component SageGridCol, { size: 6, css_classes: "example__block--lg" } do %> | ||
<h2 class="<%= SageClassnames::TYPE::HEADING_6 %>">With text</h2> | ||
<%= sage_component SageLoader, { | ||
type: "spinner", | ||
text: true | ||
} %> | ||
</div> | ||
<div class="sage-col--md-6 example__block--lg"> | ||
<% end %> | ||
<%= sage_component SageGridCol, { size: 6, css_classes: "example__block--lg" } do %> | ||
<h2 class="<%= SageClassnames::TYPE::HEADING_6 %>">Without text</h2> | ||
<%= sage_component SageLoader, { | ||
type: "spinner" | ||
} %> | ||
<% end %> | ||
<% end %> | ||
|
||
<%= sage_component SageDivider, {} %> | ||
|
||
<h3>Success</h3> | ||
<%= sage_component SageGridRow, {} do %> | ||
<%= sage_component SageGridCol, { size: 6, css_classes: "example__block--lg" } do %> | ||
<h2 class="<%= SageClassnames::TYPE::HEADING_6 %>">With text</h2> | ||
<%= sage_component SageLoader, { | ||
type: "success", | ||
text: true | ||
} %> | ||
</div> | ||
</div> | ||
<% end %> | ||
<%= sage_component SageGridCol, { size: 6, css_classes: "example__block--lg" } do %> | ||
<h2 class="<%= SageClassnames::TYPE::HEADING_6 %>">Without text</h2> | ||
<%= sage_component SageLoader, { | ||
type: "success" | ||
} %> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
<tr> | ||
<td><%= md('`type`') %><%= sage_component SageBadge, { color: "published", value: "required" } %></td> | ||
<td><%= md('Determines which loader will be used; `spinner` or `success`') %></td> | ||
<td><%= md('String') %></td> | ||
<td><%= md('`nil`') %></td> | ||
<td><%= md('`fill`') %> | ||
<td><%= md('If true, will fill the space within the container.') %></td> | ||
<td><%= md('Boolean') %></td> | ||
<td><%= md('`false`') %></td> | ||
</tr> | ||
<tr> | ||
<td><%= md('`text`') %></td> | ||
<td><%= md('Includes text that aligns with the loader.') %></td> | ||
<td><%= md('Boolean') %></td> | ||
<td><%= md('`false`') %></td> | ||
</tr> | ||
<tr> | ||
<td><%= md('`type`') %><%= sage_component SageBadge, { color: "published", value: "required" } %></td> | ||
<td><%= md('Determines which loader will be used; `bar`, `spinner` or `success`') %></td> | ||
<td><%= md('String') %></td> | ||
<td><%= md('`nil`') %></td> | ||
</tr> | ||
|
Oops, something went wrong.