Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
0764168
feat(number-field): init structure
wingkwong Dec 15, 2024
2101db4
Merge branch 'canary' into feat/eng-363
wingkwong Dec 20, 2024
0bfd74d
feat(deps): add `@nextui-org/button` & `@react-types/button`
wingkwong Dec 21, 2024
914783f
feat(theme): export number-field
wingkwong Dec 21, 2024
18d7139
feat(number-field): storybook init structure
wingkwong Dec 21, 2024
4dff6f1
feat(number-field): add NumberFieldHorizontalStepper
wingkwong Dec 21, 2024
d3ba207
feat(number-field): add NumberFieldHorizontalStepper
wingkwong Dec 21, 2024
e9b3049
feat(theme): init number field theme
wingkwong Dec 21, 2024
a8a7a77
feat(number-field): number-field draft
wingkwong Dec 21, 2024
9a9cb46
refactor(number-field): revise stepper icons
wingkwong Dec 21, 2024
5b55991
feat(shared-icons): add ChevronLeftIcon
wingkwong Dec 21, 2024
52d3673
feat(theme): stepperButton styles
wingkwong Dec 21, 2024
b67320d
feat(theme): number-field styles
wingkwong Dec 22, 2024
37b06be
fix(number-field): label layout
wingkwong Dec 22, 2024
31b971c
Merge branch 'canary' into feat/eng-363
wingkwong Dec 24, 2024
3adda56
feat(number-field): vertical stepper wrapper
wingkwong Dec 24, 2024
734af76
feat(number-field): use-number-field (wip)
wingkwong Dec 24, 2024
7f49f00
feat(number-field): add data-direction
wingkwong Dec 24, 2024
f3f8057
feat(theme): center the text if it is horizontal stepper
wingkwong Dec 24, 2024
0ddddd6
feat(number-field): add HorizontalStepper
wingkwong Dec 24, 2024
2cc8470
feat(number-field): add HideStepper
wingkwong Dec 24, 2024
79d2cbc
chore(number-field): revise minValue & defaultValue
wingkwong Dec 24, 2024
c82faa6
feat(docs): init number field structure
wingkwong Dec 24, 2024
823bc99
fix(theme): outside-left styles
wingkwong Dec 24, 2024
14e284b
Merge branch 'canary' into feat/eng-363
wingkwong Dec 27, 2024
8d54dab
refactor(theme): remove labelPlacement styles
wingkwong Dec 27, 2024
5998dea
refactor(number-field): remove labelContent logic
wingkwong Dec 27, 2024
7d17aef
refactor(number-field): remove labelPlacement args
wingkwong Dec 27, 2024
3f5d8f0
Merge branch 'canary' into feat/eng-363
wingkwong Dec 28, 2024
0ad45c8
feat(number-field): helper text
wingkwong Dec 28, 2024
6f42342
feat(number-field): revise number field stories
wingkwong Dec 28, 2024
68fd5be
feat(number-field): description
wingkwong Dec 28, 2024
8fca2bc
refactor(number-field): revise number field stories
wingkwong Dec 28, 2024
9897a56
feat(theme): numberFieldLabelClasses
wingkwong Dec 28, 2024
d085088
fix(number-field): incorrect button props
wingkwong Dec 28, 2024
61c991e
fix(number-field): typing issue on stepper buttons
wingkwong Dec 28, 2024
ad56507
Merge branch 'canary' into feat/eng-363
wingkwong Dec 31, 2024
2f78e9c
chore(number-field): add aria-label
wingkwong Dec 31, 2024
04e6bc9
refactor(number-field): merge props
wingkwong Dec 31, 2024
29c32bf
fix(number-field): pass originalProps instead
wingkwong Dec 31, 2024
2da4d9c
chore(number-field): revise Required story args
wingkwong Dec 31, 2024
1c3d416
feat(number-field): add WithStepValue & WithWheelDisabled & revise st…
wingkwong Jan 1, 2025
9af3f4b
chore(number-field): add label to Required
wingkwong Jan 1, 2025
1c3858a
feat(docs): number-field doc page
wingkwong Jan 1, 2025
5448878
fix(number-field): typing issue
wingkwong Jan 1, 2025
b7028a6
fix(number-field): test cases
wingkwong Jan 1, 2025
ed783f3
fix(number-field): user.keyboard & defaultValue
wingkwong Jan 1, 2025
02ff389
fix(number-field): should work with defaultValues
wingkwong Jan 1, 2025
c628b0c
chore(number-field): add type: number
wingkwong Jan 1, 2025
fb82263
chore(number-field): remove hidden related code
wingkwong Jan 1, 2025
59433b0
fix(number-field): numeric value
wingkwong Jan 1, 2025
498e02d
chore(changeset): add changeset
wingkwong Jan 1, 2025
439eee5
feat(deps): add "@nextui-org/number-field" to docs
wingkwong Jan 1, 2025
5b26972
feat(react): export `@nextui-org/number-field`
wingkwong Jan 1, 2025
cf7e2e3
feat(changeset): add @nextui-org/react
wingkwong Jan 1, 2025
7cf4fd4
feat(docs): number-field examples
wingkwong Jan 1, 2025
10f80f4
chore(number-field): use text instead
wingkwong Jan 1, 2025
eb9ba4c
refactor(number-field): remove unnecessary filled-within
wingkwong Jan 1, 2025
6ba9b27
fix(number-field): test case
wingkwong Jan 2, 2025
4c71835
Merge branch 'canary' into feat/eng-363
wingkwong Jan 4, 2025
500a161
chore(number-field): remove aria-label for stepper buttons
wingkwong Jan 4, 2025
5be13df
feat(docs): add incrementAriaLabel & decrementAriaLabel to NumberField
wingkwong Jan 4, 2025
9d7ba10
chore(number-field): reorder WithFormatOptions
wingkwong Jan 4, 2025
c165bef
fix(deps): update number-field's peerDependencies & dependencies
wingkwong Jan 4, 2025
231bc83
feat(number-field): hidden input for holding numeric vaule
wingkwong Jan 4, 2025
5d2cd06
fix(docs): number field title
wingkwong Jan 4, 2025
939eda8
feat(docs): add format options to number field
wingkwong Jan 4, 2025
db3a825
chore(docs): revise number field content
wingkwong Jan 4, 2025
85ce591
chore(number-field): add type to useDOMRef
wingkwong Jan 4, 2025
b39f664
fix(number-field): clear button
wingkwong Jan 4, 2025
a00a316
fix(theme): clear button styles
wingkwong Jan 4, 2025
f7cb758
refactor(theme): stepper button styles
wingkwong Jan 4, 2025
843849b
chore(number-field): accept stepperButton class
wingkwong Jan 4, 2025
ac0c559
fix(theme): helper wrapper padding
wingkwong Jan 5, 2025
25ad5cb
feat(deps): add `@react-aria/i18n`
wingkwong Jan 5, 2025
b8de20c
fix(number-field): use locale from `@react-aria/i18n`
wingkwong Jan 5, 2025
c097167
Merge branch 'canary' into feat/eng-363
wingkwong Jan 5, 2025
01bcd26
fix(deps): dependency order
wingkwong Jan 5, 2025
9510a41
Merge branch 'canary' into feat/eng-363
wingkwong Jan 6, 2025
51a88d1
fix(docs): incorrect command
wingkwong Jan 6, 2025
cd00b74
chore(docs): remove type=number
wingkwong Jan 7, 2025
8bf0ee1
chore(theme): add padding to stepper wrapper
wingkwong Jan 8, 2025
3cda10a
Merge branch 'canary' into feat/eng-363
wingkwong Jan 12, 2025
26dd43c
fix(number-field): avoid resetting value
wingkwong Jan 12, 2025
db74c64
fix(number-field): storybook
wingkwong Jan 12, 2025
64813cc
chore(docs): remove custom impl
wingkwong Jan 12, 2025
4ee3dfe
chore(docs): update docs code & content
wingkwong Jan 12, 2025
2a9c413
Merge branch 'canary' into feat/eng-363
wingkwong Jan 17, 2025
8d5f350
chore(number-field): migrate to heroui
wingkwong Jan 17, 2025
5b02110
Merge branch 'canary' into feat/eng-363
wingkwong Jan 17, 2025
757c33b
chore(number-field): migrate to heroui
wingkwong Jan 17, 2025
0e0bb87
chore(number-field): migrate to heroui
wingkwong Jan 17, 2025
4d02f08
chore: rename to number input
wingkwong Jan 17, 2025
18d4cb1
fix(number-input): incorrect import
wingkwong Jan 17, 2025
bfcafcc
chore(docs): rename to number input
wingkwong Jan 17, 2025
569e224
chore: change to number input
wingkwong Jan 17, 2025
950b340
refactor(number-input): change label to amount
wingkwong Jan 18, 2025
27db56f
fix(docs): use heroui commands
wingkwong Jan 18, 2025
60fae38
chore(changeset): update package name
wingkwong Jan 18, 2025
d9835c0
Merge branch 'canary' into feat/eng-363
wingkwong Jan 19, 2025
d777642
Merge branch 'canary' into feat/eng-363
wingkwong Jan 20, 2025
10c2d63
refactor(number-input): remove steps
wingkwong Jan 20, 2025
a6a80a2
refactor: remove helper text
wingkwong Jan 21, 2025
05273f4
feat(number-input): label placement
wingkwong Jan 21, 2025
1f5a6f8
refactor(number-input): rename stepper
wingkwong Jan 21, 2025
65f65c0
fix(theme): isClearable
wingkwong Jan 21, 2025
0a92df1
feat(docs): add label placements
wingkwong Jan 21, 2025
5fc9aa0
refactor(docs): update number-input content
wingkwong Jan 21, 2025
278e9fb
Merge branch 'canary' into feat/eng-363
wingkwong Jan 25, 2025
d69ba34
fix(docs): incorrect file
wingkwong Jan 25, 2025
3370a70
feat(docs): add lablePlacement
wingkwong Jan 25, 2025
520a0ab
refactor(docs): remove labelPlacement & startContent
wingkwong Jan 25, 2025
106e4c4
refactor(docs): remove helperText
wingkwong Jan 25, 2025
d079509
refactor(docs): remove helperText
wingkwong Jan 25, 2025
ab5766e
refactor(docs): revise description
wingkwong Jan 25, 2025
4866e09
feat(number-input): add data-slot for stepper-wrapper
wingkwong Jan 25, 2025
87483c0
fix(number-input): test cases
wingkwong Jan 25, 2025
34c6a60
fix(docs): unexpected change
wingkwong Jan 27, 2025
53032f2
refactor(number-input): update outdated info
wingkwong Jan 27, 2025
73e0af4
fix(docs): coderabbitai comments
wingkwong Jan 27, 2025
9198bde
refactor: remove validationState
wingkwong Jan 27, 2025
4db884b
fix(docs): typo
wingkwong Jan 27, 2025
0858fd8
chore(deps): remove unnecessary dep
wingkwong Jan 28, 2025
700318b
Merge branch 'canary' into feat/eng-363
wingkwong Jan 30, 2025
a9df502
chore(deps): bump RA versions
wingkwong Jan 30, 2025
fb635e5
chore(number-input): apply latest labelPlacement change
wingkwong Jan 30, 2025
f09ed32
refactor(number-input): update author
wingkwong Feb 6, 2025
9c4e3e2
Merge branch 'canary' into feat/eng-363
wingkwong Feb 6, 2025
40ca83b
refactor(number-input): revise stepper wrapper alignment
wingkwong Feb 6, 2025
cc3231f
refactor(number-input): stepper button styles
wingkwong Feb 8, 2025
13df8b5
chore(number-input): add disableRipple
wingkwong Feb 8, 2025
84a45db
fix(theme): increase stepper button click area
wingkwong Feb 8, 2025
f6ff930
fix(number-input): sync latest validationBehavior changes
wingkwong Feb 8, 2025
1decf88
fix(number-input): pass validationBehavior to useAriaNumberInput
wingkwong Feb 8, 2025
0173a36
chore(docs): add import react
wingkwong Feb 9, 2025
3f6eda7
Merge branch 'canary' into feat/eng-363
wingkwong Feb 11, 2025
7f04255
chore(number-input): remove HorizontalStepper story
wingkwong Feb 11, 2025
2021ce6
chore(number-input): enable ripple
wingkwong Feb 11, 2025
aebd00a
fix(number-input): remove number type
wingkwong Feb 11, 2025
aaf5fed
refactor(theme): follow input clear button styles
wingkwong Feb 11, 2025
a7d93b7
feat(theme): add color for stepperButton
wingkwong Feb 11, 2025
9edef40
fix(theme): revise stepperButton size for outside & outside-left cases
wingkwong Feb 11, 2025
7cb3d67
fix(number-input): typo
wingkwong Feb 11, 2025
b840ed3
chore(docs): update description for wheel
wingkwong Feb 11, 2025
ddf4013
Merge branch 'canary' into feat/eng-363
wingkwong Feb 12, 2025
ccd1c80
chore(theme): change opacity when pressed
wingkwong Feb 12, 2025
4405265
chore(number-input): add disableRipple
wingkwong Feb 12, 2025
a11f28e
Update .changeset/witty-flies-reflect.md
jrgarciadev Feb 14, 2025
b78a5d5
Merge branch 'canary' into feat/eng-363
wingkwong Feb 14, 2025
7e94eeb
fix(theme): add hover opacity effect
wingkwong Feb 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/witty-flies-reflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@heroui/number-input": patch
"@heroui/shared-icons": patch
"@heroui/theme": patch
"@heroui/react": patch
---

introduce NumberInput
7 changes: 7 additions & 0 deletions apps/docs/config/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,13 @@
"keywords": "navbar, navigation, top menu, website header",
"path": "/docs/components/navbar.mdx"
},
{
"key": "number-input",
"title": "Number Input",
"keywords": "input, numeric input, number input",
"path": "/docs/components/number-input.mdx",
"newPost": true
},
{
"key": "pagination",
"title": "Pagination",
Expand Down
1 change: 1 addition & 0 deletions apps/docs/content/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ export * from "./table";
export * from "./autocomplete";
export * from "./alert";
export * from "./drawer";
export * from "./number-input";
16 changes: 16 additions & 0 deletions apps/docs/content/components/number-input/clear-button.raw.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {NumberInput} from "@heroui/react";

export default function App() {
return (
<NumberInput
isClearable
className="max-w-xs"
defaultValue={1024}
label="Amount"
placeholder="Enter the amount"
variant="bordered"
// eslint-disable-next-line no-console
onClear={() => console.log("number input cleared")}
/>
);
}
9 changes: 9 additions & 0 deletions apps/docs/content/components/number-input/clear-button.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import App from "./clear-button.raw.jsx?raw";

const react = {
"/App.jsx": App,
};

export default {
...react,
};
20 changes: 20 additions & 0 deletions apps/docs/content/components/number-input/colors.raw.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import {NumberInput} from "@heroui/react";

export default function App() {
const colors = ["default", "primary", "secondary", "success", "warning", "danger"];

return (
<div className="w-full flex flex-row flex-wrap gap-4">
{colors.map((color) => (
<NumberInput
key={color}
className="max-w-[220px]"
color={color}
defaultValue={1024}
label="Amount"
placeholder="Enter the amount"
/>
))}
</div>
);
}
9 changes: 9 additions & 0 deletions apps/docs/content/components/number-input/colors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import App from "./colors.raw.jsx?raw";

const react = {
"/App.jsx": App,
};

export default {
...react,
};
18 changes: 18 additions & 0 deletions apps/docs/content/components/number-input/controlled.raw.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from "react";
import {NumberInput} from "@heroui/react";

Comment thread
wingkwong marked this conversation as resolved.
export default function App() {
const [value, setValue] = React.useState();

return (
<div className="w-full flex flex-col gap-2 max-w-[240px]">
<NumberInput
label="Amount"
placeholder="Enter the amount"
value={value}
onValueChange={setValue}
/>
<p className="text-default-500 text-small">NumberInput value: {value}</p>
</div>
);
}
9 changes: 9 additions & 0 deletions apps/docs/content/components/number-input/controlled.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import App from "./controlled.raw.jsx?raw";

const react = {
"/App.jsx": App,
};

export default {
...react,
};
39 changes: 39 additions & 0 deletions apps/docs/content/components/number-input/custom-styles.raw.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import {NumberInput} from "@heroui/react";

export default function App() {
return (
<div className="w-[340px] h-[240px] px-8 rounded-2xl flex justify-center items-center bg-gradient-to-tr from-pink-500 to-yellow-500 text-white shadow-lg">
<NumberInput
isClearable
classNames={{
label: "text-black/50 dark:text-white/90",
input: [
"bg-transparent",
"text-black/90 dark:text-white/90",
"placeholder:text-default-700/50 dark:placeholder:text-white/60",
],
innerWrapper: "bg-transparent",
inputWrapper: [
"shadow-xl",
"bg-default-200/50",
"dark:bg-default/60",
"backdrop-blur-xl",
"backdrop-saturate-200",
"hover:bg-default-200/70",
"dark:hover:bg-default/70",
"group-data-[focus=true]:bg-default-200/50",
"dark:group-data-[focus=true]:bg-default/60",
"!cursor-text",
],
helperText: "text-black/50 dark:text-white/90",
}}
description="The number of apples that Marcus bought"
helperText="Must be equal or greater than 1"
label="Number of apples"
minValue={1}
placeholder="Enter a number..."
radius="lg"
/>
</div>
);
}
9 changes: 9 additions & 0 deletions apps/docs/content/components/number-input/custom-styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import App from "./custom-styles.raw.jsx?raw";

const react = {
"/App.jsx": App,
};

export default {
...react,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React from "react";
import {Button, Form, NumberInput} from "@heroui/react";

export default function App() {
const [submitted, setSubmitted] = React.useState(null);
Comment thread
wingkwong marked this conversation as resolved.

const onSubmit = (e) => {
e.preventDefault();
const data = Object.fromEntries(new FormData(e.currentTarget));

setSubmitted(data);
};
Comment thread
wingkwong marked this conversation as resolved.

return (
<Form className="w-full max-w-xs" onSubmit={onSubmit}>
<NumberInput
isRequired
label="Amount"
name="amount"
placeholder="Enter a number"
validate={(value) => {
if (value < 100) {
return "Number must be greater than 100";
}

if (value > 1000) {
return "Number must be less than 1000";
}

return value === 777 ? "Nice try!" : null;
}}
/>
<Button color="primary" type="submit">
Submit
</Button>
Comment thread
wingkwong marked this conversation as resolved.
{submitted && (
<div className="text-small text-default-500">
You submitted: <code>{JSON.stringify(submitted)}</code>
</div>
)}
</Form>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import App from "./custom-validation.raw.jsx?raw";

const react = {
"/App.jsx": App,
};

export default {
...react,
};
12 changes: 12 additions & 0 deletions apps/docs/content/components/number-input/description.raw.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {NumberInput} from "@heroui/react";

export default function App() {
return (
<NumberInput
className="max-w-xs"
defaultValue={1024}
description="Enter the amount"
label="Amount"
/>
);
}
9 changes: 9 additions & 0 deletions apps/docs/content/components/number-input/description.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import App from "./description.raw.jsx?raw";

const react = {
"/App.jsx": App,
};

export default {
...react,
};
13 changes: 13 additions & 0 deletions apps/docs/content/components/number-input/disabled.raw.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {NumberInput} from "@heroui/react";

export default function App() {
return (
<NumberInput
isDisabled
aria-label="Amount"
className="max-w-xs"
defaultValue={1024}
placeholder="Enter the amount"
/>
);
}
9 changes: 9 additions & 0 deletions apps/docs/content/components/number-input/disabled.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import App from "./disabled.raw.jsx?raw";

const react = {
"/App.jsx": App,
};

export default {
...react,
};
15 changes: 15 additions & 0 deletions apps/docs/content/components/number-input/error-message.raw.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import {NumberInput} from "@heroui/react";

export default function App() {
return (
<NumberInput
className="max-w-xs"
defaultValue={1024}
errorMessage="Please enter a valid number"
isInvalid={true}
label="Amount"
placeholder="Enter the amount"
variant="bordered"
/>
Comment thread
wingkwong marked this conversation as resolved.
);
}
9 changes: 9 additions & 0 deletions apps/docs/content/components/number-input/error-message.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import App from "./error-message.raw.jsx?raw";

const react = {
"/App.jsx": App,
};

export default {
...react,
};
60 changes: 60 additions & 0 deletions apps/docs/content/components/number-input/format-options.raw.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import {NumberInput} from "@heroui/react";

export default function App() {
return (
<div className="flex flex-col gap-4">
<div className="flex w-full flex-wrap md:flex-nowrap mb-6 md:mb-0 gap-4">
<NumberInput
className="max-w-xs"
defaultValue={6}
formatOptions={{
style: "currency",
currency: "USD",
}}
label="With Currency"
/>
<NumberInput
className="max-w-xs"
defaultValue={6}
formatOptions={{
signDisplay: "exceptZero",
minimumFractionDigits: 1,
maximumFractionDigits: 2,
}}
label="With Sign"
/>
<NumberInput
className="max-w-xs"
defaultValue={6}
formatOptions={{
style: "percent",
}}
label="With Percent"
/>
</div>
<div className="flex w-full flex-wrap md:flex-nowrap mb-6 md:mb-0 gap-4">
<NumberInput
className="max-w-xs"
defaultValue={6}
formatOptions={{
style: "currency",
currency: "EUR",
currencyDisplay: "code",
currencySign: "accounting",
}}
label="With Currency Vaule"
/>
<NumberInput
className="max-w-xs"
defaultValue={6}
formatOptions={{
style: "unit",
unit: "inch",
unitDisplay: "long",
}}
label="With Unit"
/>
</div>
</div>
);
}
9 changes: 9 additions & 0 deletions apps/docs/content/components/number-input/format-options.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import App from "./format-options.raw.jsx?raw";

const react = {
"/App.jsx": App,
};

export default {
...react,
};
13 changes: 13 additions & 0 deletions apps/docs/content/components/number-input/hide-stepper.raw.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {NumberInput} from "@heroui/react";

export default function App() {
return (
<NumberInput
hideStepper
className="max-w-xs"
defaultValue={1024}
label="Amount"
placeholder="Enter the amount"
/>
);
}
9 changes: 9 additions & 0 deletions apps/docs/content/components/number-input/hide-stepper.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import App from "./hide-stepper.raw.jsx?raw";

const react = {
"/App.jsx": App,
};

export default {
...react,
};
Loading