Skip to content

Commit a47f1ca

Browse files
samejrmatt-aitken
authored andcommitted
When max value is reached, disabled the + button
1 parent cf60c24 commit a47f1ca

File tree

1 file changed

+4
-3
lines changed
  • apps/webapp/app/routes/storybook.stepper

1 file changed

+4
-3
lines changed

apps/webapp/app/routes/storybook.stepper/route.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { MinusIcon, PlusIcon } from "@heroicons/react/20/solid";
22
import { useState, useRef, type ChangeEvent } from "react";
3+
import { Header2 } from "~/components/primitives/Headers";
34
import { cn } from "~/utils/cn";
45

56
export default function Story() {
@@ -8,9 +9,9 @@ export default function Story() {
89
const [value3, setValue3] = useState(0);
910

1011
return (
11-
<div className="grid h-full max-w-4xl place-items-center">
12+
<div className="grid h-full w-full place-items-center">
1213
<div className="flex flex-col gap-4">
13-
<h2 className="text-lg font-semibold text-text-bright">InputStepper examples</h2>
14+
<Header2>InputStepper</Header2>
1415

1516
<div className="flex flex-col gap-2">
1617
<label className="text-sm text-text-dimmed">Size: base (default), Step: 75</label>
@@ -102,7 +103,7 @@ function InputStepper({
102103
className={cn(
103104
"flex h-9 items-center rounded border border-charcoal-600 bg-tertiary transition hover:border-charcoal-550/80 hover:bg-charcoal-600/80",
104105
"has-[:focus-visible]:outline has-[:focus-visible]:outline-1 has-[:focus-visible]:outline-offset-0 has-[:focus-visible]:outline-text-link",
105-
"has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50",
106+
disabled && "cursor-not-allowed opacity-50",
106107
className
107108
)}
108109
>

0 commit comments

Comments
 (0)