-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UnitControl component: Refactor utils module to TypeScript (#35138)
* UnitControl: Refactor utils to TypeScript Co-authored-by: Marco Ciampini <[email protected]>
- Loading branch information
1 parent
fdf9057
commit 608a105
Showing
4 changed files
with
157 additions
and
66 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
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,26 @@ | ||
export type Value = number | string; | ||
|
||
export type WPUnitControlUnit = { | ||
/** | ||
* The value for the unit, used in a CSS value (e.g `px`). | ||
*/ | ||
value: string; | ||
/** | ||
* The label used in a dropdown selector for the unit. | ||
*/ | ||
label: string; | ||
/** | ||
* Default value for the unit, used when switching units. | ||
*/ | ||
default?: Value; | ||
/** | ||
* An accessible label used by screen readers. | ||
*/ | ||
a11yLabel?: string; | ||
/** | ||
* A step value used when incrementing/decrementing the value. | ||
*/ | ||
step?: number; | ||
}; | ||
|
||
export type WPUnitControlUnitList = Array< WPUnitControlUnit > | false; |
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