-
Notifications
You must be signed in to change notification settings - Fork 191
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
1 parent
1158138
commit 71dd399
Showing
27 changed files
with
208 additions
and
7 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,34 @@ | ||
import React from 'react' | ||
import { AnatomyWrapper, Host, Part, Slot } from './anatomy-components' | ||
|
||
const InputNumberAnatomy = () => { | ||
return ( | ||
<AnatomyWrapper> | ||
<Host name="openui-input-number"> | ||
<Part name="input"> | ||
<Slot name="input"> | ||
<Part name="value"> | ||
<Slot name="value"> | ||
<Part name="placeholder"> | ||
<Slot name="placeholder" /> | ||
</Part> | ||
</Slot> | ||
</Part> | ||
</Slot> | ||
<Part name="spinner"> | ||
<Slot name="spinner"> | ||
<Part name="spinner-button-up"> | ||
<Slot name="spinner-button-up" /> | ||
</Part> | ||
<Part name="spinner-button-down"> | ||
<Slot name="spinner-button-down" /> | ||
</Part> | ||
</Slot> | ||
</Part> | ||
</Part> | ||
</Host> | ||
</AnatomyWrapper> | ||
) | ||
} | ||
|
||
export default InputNumberAnatomy |
47 changes: 47 additions & 0 deletions
47
site/src/pages/components/inputnumber.research.explainer.mdx
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,47 @@ | ||
--- | ||
menu: Research | ||
name: Number (Explainer) | ||
pathToResearch: /components/inputnumber.research | ||
layout: ../../layouts/ComponentLayout.astro | ||
--- | ||
|
||
import InputNumberAnatomy from '../../components/input-number-anatomy.jsx' | ||
|
||
## Overview | ||
|
||
The number component is a control that allows the user to enter a number, integer or decimal. It is a variation of the text input component, but with extra validation and optionally increment/decrement controls. | ||
|
||
### Use Cases | ||
|
||
The number component is primarily leveraged to indicate a numeric value. For example, forms could use a number input to enter a quantity of items. | ||
|
||
## Design | ||
|
||
### API | ||
|
||
#### Properties | ||
|
||
| Attribute Name | Type | Default Value | Description | | ||
| ---------------- | -------- | ------------- | ---------------------------------------------------------------------------------------------------------| | ||
| `min` | `number` | `null` | The minimum valid value of the input. | | ||
| `max` | `number` | `null` | The maximum valid value of the input. | | ||
| `step` | `number` | `null` | The amount that the value changes when editing using keyboard arrows or UI. | | ||
| `value` | `number` | `null` | The value of the checkbox. | | ||
| `autofocus` | `bool` | `false` | Get focus by default. | | ||
| `disabled` | `bool` | `false` | Prevents the user from interacting with the control. Defaults to false. | | ||
| `form` | `string` | `null` | Associates the element with a form in the document whose `id` is this value. | | ||
| `name` | `string` | `""` | Specify the name of the control for purposes of form submission. | | ||
| `placeholder` | `string` | `""` | Text that appears in the form control when it has no value set | | ||
| `required` | `bool` | `false` | Indicates that the input is invalid unless checked. | | ||
| `readonly` | `bool` | `readonly` | Indicates that the input is not interactive but its value should still be submitted with the form. | | ||
|
||
### Anatomy | ||
|
||
<InputNumberAnatomy /> | ||
|
||
### Explanation | ||
|
||
The proposed anatomy of the number component is based on the existing `<input type="number">` element. Which shares the same anatomy across all desktop implementations. | ||
|
||
The spinner part of the component is not universal, for example mobile implementations of the number input do not have a spinner. However, the spinner is a useful affordance for desktop users, so it is included in the anatomy. | ||
Implementations should consider the default styles given to the spinner parts. |
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,23 @@ | ||
--- | ||
menu: Research | ||
name: Number | ||
pathToProposal: /components/inputnumber.research.explainer | ||
|
||
layout: ../../layouts/ComponentLayout.astro | ||
--- | ||
|
||
import InputNumberAnatomy from '../../components/input-number-anatomy.jsx' | ||
import Concepts from '../../components/concepts' | ||
import ComponentCoverage from '../../components/component-coverage' | ||
|
||
## Names | ||
|
||
<ComponentCoverage component="InputNumber" /> | ||
|
||
## Anatomy | ||
|
||
<InputNumberAnatomy /> | ||
|
||
## Concepts | ||
|
||
<Concepts client:load component="InputNumber" /> |
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