Skip to content
Merged

v2.6.13 #4578

Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file modified apps/docs/public/storybook-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions packages/components/autocomplete/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @heroui/autocomplete

## 2.3.10

### Patch Changes

- Updated dependencies [[`45b1d82`](https://github.com/frontio-ai/heroui/commit/45b1d82c391dac7f39609d492010164b6c2d6d38)]:
- @heroui/input@2.4.9
- @heroui/popover@2.3.9

## 2.3.9

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/components/autocomplete/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@heroui/autocomplete",
"version": "2.3.9",
"version": "2.3.10",
"description": "An autocomplete combines a text input with a listbox, allowing users to filter a list of options to items matching a query.",
"keywords": [
"autocomplete"
Expand Down
6 changes: 6 additions & 0 deletions packages/components/input/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @heroui/input

## 2.4.9

### Patch Changes

- [`45b1d82`](https://github.com/frontio-ai/heroui/commit/45b1d82c391dac7f39609d492010164b6c2d6d38) Thanks [@jrgarciadev](https://github.com/jrgarciadev)! - Fix input ignoring spaces

## 2.4.8

### Patch Changes
Expand Down
27 changes: 0 additions & 27 deletions packages/components/input/__tests__/input.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,33 +224,6 @@ describe("Input", () => {

expect(onClear).toHaveBeenCalledTimes(0);
});

it("should focus input on click", async () => {
const {getByTestId} = render(<Input data-testid="input" />);

const input = getByTestId("input") as HTMLInputElement;
const innerWrapper = document.querySelector("[data-slot='inner-wrapper']") as HTMLDivElement;
const inputWrapper = document.querySelector("[data-slot='input-wrapper']") as HTMLDivElement;

const user = userEvent.setup();

expect(document.activeElement).not.toBe(input);

await user.click(input);
expect(document.activeElement).toBe(input);
input.blur();
expect(document.activeElement).not.toBe(input);

await user.click(innerWrapper);
expect(document.activeElement).toBe(input);
input.blur();
expect(document.activeElement).not.toBe(input);

await user.click(inputWrapper);
expect(document.activeElement).toBe(input);
input.blur();
expect(document.activeElement).not.toBe(input);
});
});

describe("Input with React Hook Form", () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/input/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@heroui/input",
"version": "2.4.8",
"version": "2.4.9",
"description": "The input component is designed for capturing user input within a text field.",
"keywords": [
"input"
Expand Down
23 changes: 11 additions & 12 deletions packages/components/input/src/use-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,6 @@ export function useInput<T extends HTMLInputElement | HTMLTextAreaElement = HTML
domRef.current?.focus();
}, [setInputValue, onClear]);

const handleInputWrapperClick = useCallback(() => {
if (domRef.current) {
domRef.current?.focus();
}
}, [domRef.current]);

// if we use `react-hook-form`, it will set the input value using the ref in register
// i.e. setting ref.current.value to something which is uncontrolled
// hence, sync the state with `ref.current.value`
Expand Down Expand Up @@ -226,11 +220,6 @@ export function useInput<T extends HTMLInputElement | HTMLTextAreaElement = HTML
onPress: handleClear,
});

const {pressProps: inputWrapperPressProps} = usePress({
isDisabled: !!originalProps?.isDisabled || !!originalProps?.isReadOnly,
onPress: handleInputWrapperClick,
});

const isInvalid = validationState === "invalid" || isAriaInvalid;

const labelPlacement = useMemo<InputVariantProps["labelPlacement"]>(() => {
Expand Down Expand Up @@ -409,7 +398,12 @@ export function useInput<T extends HTMLInputElement | HTMLTextAreaElement = HTML
className: slots.inputWrapper({
class: clsx(classNames?.inputWrapper, isFilled ? "is-filled" : ""),
}),
...mergeProps(props, hoverProps, inputWrapperPressProps),
...mergeProps(props, hoverProps),
onClick: (e) => {
if (domRef.current && e.currentTarget === e.target) {
domRef.current.focus();
}
},
style: {
cursor: "text",
...props.style,
Expand All @@ -433,6 +427,11 @@ export function useInput<T extends HTMLInputElement | HTMLTextAreaElement = HTML
...props,
ref: innerWrapperRef,
"data-slot": "inner-wrapper",
onClick: (e) => {
if (domRef.current && e.currentTarget === e.target) {
domRef.current.focus();
}
},
className: slots.innerWrapper({
class: clsx(classNames?.innerWrapper, props?.className),
}),
Expand Down
15 changes: 15 additions & 0 deletions packages/core/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# @heroui/react

## 2.6.13

### Patch Changes

- Updated dependencies [[`45b1d82`](https://github.com/frontio-ai/heroui/commit/45b1d82c391dac7f39609d492010164b6c2d6d38)]:
- @heroui/input@2.4.9
- @heroui/accordion@2.2.7
- @heroui/autocomplete@2.3.10
- @heroui/drawer@2.2.7
- @heroui/modal@2.2.7
- @heroui/navbar@2.2.8
- @heroui/popover@2.3.9
- @heroui/select@2.4.9
- @heroui/tabs@2.2.7

## 2.6.12

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/core/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@heroui/react",
"version": "2.6.12",
"version": "2.6.13",
"description": "🚀 Beautiful and modern React UI library.",
"author": "Junior Garcia <jrgarciadev@gmail.com>",
"homepage": "https://heroui.com",
Expand Down
26 changes: 13 additions & 13 deletions packages/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@
"react-dom": "^18.0.0"
},
"devDependencies": {
"@storybook/addon-a11y": "^8.4.5",
"@storybook/addon-actions": "^8.4.5",
"@storybook/addon-docs": "^8.4.5",
"@storybook/addon-essentials": "^8.4.5",
"@storybook/addon-links": "^8.4.5",
"@storybook/cli": "^8.4.5",
"@storybook/manager-api": "^8.4.5",
"@storybook/preview-api": "^8.4.5",
"@storybook/react": "^8.4.5",
"@storybook/react-vite": "^8.4.5",
"@storybook/theming": "^8.4.5",
"@storybook/addon-a11y": "^8.5.0",
"@storybook/addon-actions": "^8.5.0",
"@storybook/addon-docs": "^8.5.0",
"@storybook/addon-essentials": "^8.5.0",
"@storybook/addon-links": "^8.5.0",
"@storybook/cli": "^8.5.0",
"@storybook/manager-api": "^8.5.0",
"@storybook/preview-api": "^8.5.0",
"@storybook/react": "^8.5.0",
"@storybook/react-vite": "^8.5.0",
"@storybook/theming": "^8.5.0",
"@vitejs/plugin-react": "^4.3.3",
"autoprefixer": "^10.4.13",
"remark-gfm": "^4.0.0",
"storybook": "^8.4.5",
"storybook": "^8.5.0",
"storybook-dark-mode": "^4.0.2",
"tailwindcss": "^3.3.5",
"vite": "^5.4.11"
Expand All @@ -65,4 +65,4 @@
"esm"
]
}
}
}
14 changes: 10 additions & 4 deletions packages/storybook/public/dark-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading