-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
1,141 additions
and
16 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
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ids-spinbox-demo { | ||
display: grid; | ||
grid-template-columns: 1fr 1fr 1fr; | ||
margin-left: 16px; | ||
|
||
@media (max-width: 600px) { | ||
grid-template-columns: 1fr 1fr; | ||
} | ||
} | ||
|
||
ids-spinbox { | ||
margin-bottom: 8px; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<ids-layout-grid> | ||
<ids-text font-size="12" type="h1">Spinbox</ids-text> | ||
</ids-layout-grid> | ||
<div id="ids-spinbox-demo"> | ||
<ids-spinbox value="0" label="Basic Spinbox"></ids-spinbox> | ||
<ids-spinbox value="0" min="0" max="5" label="Enter an int from 0 to 5" placeholder="0=>5"></ids-spinbox> | ||
<ids-spinbox value="0" min="-25" max="25" step="5" label="Jumps 5 from -25 to 25" placeholder="-25=>25"></ids-spinbox> | ||
<ids-spinbox | ||
dirty-tracker value="0" | ||
min="-25" | ||
max="25" | ||
step="5" | ||
label="w/ Dirty Tracking" | ||
placeholder="Dirty" | ||
></ids-spinbox> | ||
<ids-spinbox | ||
value="0" | ||
min="-25" | ||
max="25" | ||
step="5" | ||
label="Disabled" | ||
placeholder="N/A" | ||
disabled | ||
></ids-spinbox> | ||
<ids-spinbox | ||
value="0" | ||
min="-25" | ||
max="25" | ||
step="5" | ||
label="Required" | ||
placeholder="N/A" | ||
validate="required" | ||
label-required | ||
></ids-spinbox> | ||
</div> | ||
|
Empty file.
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{{> ../layouts/head.html }} | ||
{{> example.html }} | ||
{{> ../layouts/footer.html }} |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import IdsSpinbox from '../../src/ids-spinbox'; | ||
import './demo.scss'; |
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
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# Ids Spinbox Component | ||
|
||
## Description | ||
Allows a user to input a value that goes up/down in specific intervals, and also optionally within a range of integers. | ||
|
||
## Use Cases | ||
- a normal input that goes up or down specific increments by it's nature. | ||
|
||
## Themeable Parts | ||
- `container` the overall spinbox container | ||
- `input` the spinbox center input | ||
- `button` increment/decrement buttons | ||
- `label` the label above the input | ||
- `validation` the validation message that pops up if any errors exist | ||
|
||
## Features (With Code Examples) | ||
|
||
Spinbox with a minimum and maximum | ||
|
||
```html | ||
<ids-spinbox | ||
value="0" | ||
min="0" | ||
max="5" | ||
label="Enter an int from 0 to 5" | ||
placeholder="0=>5" | ||
></ids-spinbox> | ||
``` | ||
|
||
Spinbox which increments in intervals of 5 | ||
```html | ||
<ids-spinbox | ||
value="0" | ||
min="-25" | ||
max="25" | ||
step="5" | ||
label="Jumps 5 from -25 to 25" | ||
></ids-spinbox> | ||
``` | ||
|
||
Spinbox which shows a marker with changes, and no range limits | ||
|
||
```html | ||
<ids-spinbox | ||
value="0" | ||
label="Unbounded Spinbox" | ||
dirty-marker="true" | ||
></ids-spinbox> | ||
``` | ||
|
||
Spinbox which is required to have a value set when tabbed off of or `this.handleValidation()` called. | ||
|
||
```html | ||
<ids-spinbox | ||
value="" | ||
label="Value Is Required" | ||
validation="required" | ||
></ids-spinbox> | ||
``` | ||
|
||
## Settings and Attributes | ||
|
||
`value` `{number}` the current number assigned to the step box | ||
|
||
`max` `{number}` maximum/ceiling value possible to assign to `value` | ||
|
||
`min` `{number}` minimum/floor value possible to assign to `value` | ||
|
||
`label` `{string}` label shown above the spinbox | ||
|
||
`placeholder` `{string}` text shown as a hint when user clears text on the input | ||
|
||
`validate` `{string}` validation message text; set to `required` to require validation. | ||
|
||
## Keyboard Guidelines | ||
- TAB should move off of the component to the next focusable element on page. | ||
- SHIFT + TAB should move to previous focusable element on the page. | ||
- UP/DOWN arrow keys should increment, and decrement the ids-spinbox value. | ||
|
||
## Responsive Guidelines | ||
|
||
N/A | ||
|
||
## Converting from Previous Versions | ||
|
||
TODO | ||
|
||
## Accessibility Guidelines | ||
- 1.4.3 Contrast (Minimum) - there should be enough contrast on the background which the wizard resides on in the page. | ||
- Be sure to provide labels that provide clear intent as to the representation of the value which the spinbox controls. | ||
|
||
## Regional Considerations | ||
Label text should be localized in the current language. All elements will flip to the alternate side in Right To Left mode. Consider that in some languages text may be a lot longer (German). And in some cases it cant be wrapped (Thai). For some of these cases text-ellipsis is supported. |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
# TODO for Ids-Spinbox |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { IdsElement } from '../ids-base'; | ||
|
||
export default class IdsSpinbox extends IdsElement { | ||
/** | ||
* the maximum value the spinbox' input can be set to | ||
*/ | ||
max: number | string; | ||
|
||
/** | ||
* the minimum value the spinbox' input can be set to | ||
*/ | ||
min: number | string; | ||
|
||
/** spinbox' current input value */ | ||
value: number | string; | ||
|
||
/** hint shown when a user has cleared the spinbox value */ | ||
placeholder?: string; | ||
|
||
/** label text describing the spinbox value */ | ||
label: string; | ||
|
||
/** whether the dirty tracker has been enabled */ | ||
dirtyTracker: boolean | string; | ||
|
||
/** whether or not content is interactive */ | ||
disabled: boolean | string; | ||
|
||
/** validation message text; set to `required` to require validation. */ | ||
validate?: string; | ||
} |
Oops, something went wrong.