-
Notifications
You must be signed in to change notification settings - Fork 1
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
6c4661d
commit a122f0f
Showing
8 changed files
with
429 additions
and
103 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
36 changes: 36 additions & 0 deletions
36
packages/kit/src/components/NumberField/NumberFieldControls.tsx
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 @@ | ||
import * as styles from "./NumberField.css"; | ||
import { Button } from "../Button/Button"; | ||
import { ChevronDownIcon, ChevronUpIcon } from "../../icons"; | ||
|
||
interface NumberFieldControlsProps { | ||
increment: () => void; | ||
decrement: () => void; | ||
step: number; | ||
} | ||
|
||
export function NumberFieldControls(props: NumberFieldControlsProps) { | ||
return ( | ||
<div class={styles.controlsContainer}> | ||
<Button | ||
type={"button"} | ||
variant={"ghost"} | ||
theme={"secondary"} | ||
aria-label={`Increment by ${props.step}`} | ||
class={styles.controlButton} | ||
onClick={props.increment} | ||
> | ||
<ChevronUpIcon class={styles.control} /> | ||
</Button> | ||
<Button | ||
type={"button"} | ||
variant={"ghost"} | ||
theme={"secondary"} | ||
aria-label={`Decrement by ${props.step}`} | ||
class={styles.controlButton} | ||
onClick={props.decrement} | ||
> | ||
<ChevronDownIcon class={styles.control} /> | ||
</Button> | ||
</div> | ||
); | ||
} |
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
Oops, something went wrong.