Skip to content

feat: add outside-top labelPlacement support for Input (HeroUI v2.8.0)#626

Merged
sj817 merged 3 commits into
mainfrom
copilot/update-input-interface
Mar 24, 2026
Merged

feat: add outside-top labelPlacement support for Input (HeroUI v2.8.0)#626
sj817 merged 3 commits into
mainfrom
copilot/update-input-interface

Conversation

Copilot AI commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

HeroUI v2.8.0 introduced a new outside-top value for labelPlacement on Input — unlike outside (which requires a placeholder to render the label outside), outside-top always positions the label above the input unconditionally.

TypeScript interface changes

  • packages/core/src/types/components/input.tslabelPlacement extended to 'inside' | 'outside' | 'outside-left' | 'outside-top'
  • packages/web/src/types/components/input.ts — same
input.create('email', {
  labelPlacement: 'outside-top', // new: label always above, no placeholder required
  label: 'Email',
})

Dependency bumps (packages/web/package.json)

Package Before After
@heroui/input 2.4.9 ^2.4.23
@heroui/theme 2.4.9 ^2.4.17
@heroui/system ^2.4.12 ^2.4.18

@heroui/[email protected] is the first release implementing outside-top behavior. @heroui/[email protected] is the last version compatible with Tailwind CSS v3 (v2.4.18+ requires v4); it includes the necessary outside-top CSS variants. Lock file updated accordingly.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • registry.npmmirror.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/.npm/_npx/4876f32048baf8ac/node_modules/.bin/prebuild-install -r node --pkg_version=0.13.1 --pkg_name=node-pty-prebuilt-multiarch pull.rebase nfig/composer/vendor/bin/bash (dns block)
  • www.heroui.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Feat: 输入框接口更新</issue_title>
<issue_description>### 描述功能

see https://www.heroui.com/blog/v2.8.0#input

动机

https://www.heroui.com/blog/v2.8.0#input

实现方法

No response

替代方案

No response

附加信息

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

由 Sourcery 提供的摘要

为 HeroUI v2.8.0 中新增的 outside-top 输入标签位置方式提供支持,并相应更新 HeroUI Web 端依赖。

新功能:

  • 扩展输入组件的 TypeScript props,使核心和 Web 输入组件都支持 outside-top 标签位置。

增强:

  • 在 Web 包中更新 HeroUI input、system 和 theme 包的版本,使其支持新的标签位置行为,并保持与当前 Tailwind CSS 版本的兼容性。

构建:

  • 刷新 pnpm 锁定文件(lockfile),以与更新后的 HeroUI 依赖版本保持一致。
Original summary in English

Summary by Sourcery

Add support for the new outside-top input label placement from HeroUI v2.8.0 and update HeroUI web dependencies accordingly.

New Features:

  • Extend input TypeScript props to support outside-top label placement in both core and web input components.

Enhancements:

  • Update HeroUI input, system, and theme package versions in the web package to versions that support the new label placement behavior and remain compatible with the current Tailwind CSS version.

Build:

  • Refresh pnpm lockfile to align with updated HeroUI dependency versions.

Copilot AI changed the title [WIP] Update input box interface as outlined in feature request feat: add outside-top labelPlacement support for Input (HeroUI v2.8.0) Mar 23, 2026
Copilot AI requested a review from sj817 March 23, 2026 23:45
@sj817
sj817 marked this pull request as ready for review March 24, 2026 04:48
Copilot AI review requested due to automatic review settings March 24, 2026 04:48
@sourcery-ai

sourcery-ai Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor
审阅者指南(在小型 PR 上折叠)

审阅者指南

通过扩展共享的 Input TypeScript props,并将与 HeroUI 相关的依赖升级到实现该行为和 CSS 的版本(并相应更新 lockfile),为 Input 新增对 outside-top labelPlacement 选项的支持。

更新后的 InputProps labelPlacement 支持类图

classDiagram
  class ComponentProps

  class LabelPlacement {
    <<type>>
    +inside
    +outside
    +outside_left
    +outside_top
  }

  class Core_InputProps {
    +string label
    +LabelPlacement labelPlacement
    +string startContent
    +string endContent
    +boolean fullWidth
    +boolean isClearable
  }

  class Web_InputProps {
    +string label
    +LabelPlacement labelPlacement
    +string startContent
    +string endContent
    +boolean fullWidth
    +boolean isClearable
  }

  ComponentProps <|-- Core_InputProps
  ComponentProps <|-- Web_InputProps

  LabelPlacement <-- Core_InputProps : uses
  LabelPlacement <-- Web_InputProps : uses
Loading

文件级变更

变更 详情 文件
扩展 Input props 以接受新的 outside-top labelPlacement 选项。
  • 在 core 包中更新 InputProps TypeScript 接口,在 labelPlacement 联合类型中加入 'outside-top'。
  • 在 web 包类型中镜像同样的 InputProps.labelPlacement 联合类型修改,以保持两层实现同步。
packages/core/src/types/components/input.ts
packages/web/src/types/components/input.ts
将 HeroUI web 依赖版本对齐到既支持 outside-top 又与 Tailwind CSS v3 兼容的版本。
  • 将 @heroui/input 升级到 ^2.4.23,这是首个实现 outside-top 行为的版本。
  • 将 @heroui/system 升级到 ^2.4.18,以与更新后的 input 和 theme 包保持一致。
  • 将 @heroui/theme 升级到 ^2.4.17,这是最后一个兼容 Tailwind v3 且包含所需 outside-top CSS 变体的版本。
  • 更新 pnpm-lock.yaml 以反映新的依赖版本。
packages/web/package.json
pnpm-lock.yaml

与关联 Issue 的对照评估

Issue 目标 是否解决 说明
#512 更新 Input TypeScript 接口以匹配 HeroUI v2.8.0 的变更(尤其是支持新的 outside-top labelPlacement 选项)。
#512 将与 HeroUI 相关的依赖更新到实现 HeroUI v2.8.0 中引入的新 Input 行为的版本。

可能关联的 Issue


提示与命令

与 Sourcery 交互

  • 触发新审阅: 在 pull request 中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审阅评论。
  • 从审阅评论生成 GitHub issue: 在审阅评论下回复,请 Sourcery 从该评论创建 issue。也可以直接回复 @sourcery-ai issue,从该评论创建 issue。
  • 生成 pull request 标题: 在 pull request 标题的任意位置写上 @sourcery-ai 以在任意时间生成标题。也可以在 pull request 中评论 @sourcery-ai title 来(重新)生成标题。
  • 生成 pull request 摘要: 在 pull request 正文任意位置写上 @sourcery-ai summary,即可在你想要的位置生成 PR 摘要。也可以在 pull request 中评论 @sourcery-ai summary 来在任意时间(重新)生成摘要。
  • 生成审阅者指南: 在 pull request 中评论 @sourcery-ai guide,可在任意时间(重新)生成审阅者指南。
  • 解决所有 Sourcery 评论: 在 pull request 中评论 @sourcery-ai resolve,以解决所有 Sourcery 评论。如果你已经处理完所有评论且不再希望看到它们,这会很有用。
  • 忽略所有 Sourcery 审阅: 在 pull request 中评论 @sourcery-ai dismiss,以忽略所有现有的 Sourcery 审阅。若你希望从一次全新的审阅开始,这尤其有用——别忘了再评论 @sourcery-ai review 来触发新的审阅!

自定义你的体验

访问你的 控制面板 以:

  • 启用或禁用审阅特性,例如 Sourcery 生成的 pull request 摘要、审阅者指南等。
  • 更改审阅语言。
  • 添加、删除或编辑自定义审阅指令。
  • 调整其他审阅设置。

获取帮助

Original review guide in English
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds support for the new outside-top labelPlacement option for Input by extending the shared Input TypeScript props and bumping HeroUI-related dependencies to versions that implement the behavior and CSS, with the lockfile updated accordingly.

Class diagram for updated InputProps labelPlacement support

classDiagram
  class ComponentProps

  class LabelPlacement {
    <<type>>
    +inside
    +outside
    +outside_left
    +outside_top
  }

  class Core_InputProps {
    +string label
    +LabelPlacement labelPlacement
    +string startContent
    +string endContent
    +boolean fullWidth
    +boolean isClearable
  }

  class Web_InputProps {
    +string label
    +LabelPlacement labelPlacement
    +string startContent
    +string endContent
    +boolean fullWidth
    +boolean isClearable
  }

  ComponentProps <|-- Core_InputProps
  ComponentProps <|-- Web_InputProps

  LabelPlacement <-- Core_InputProps : uses
  LabelPlacement <-- Web_InputProps : uses
Loading

File-Level Changes

Change Details Files
Extend Input props to accept the new outside-top labelPlacement option.
  • Update the InputProps TypeScript interface in the core package to include 'outside-top' in the labelPlacement union type.
  • Mirror the same InputProps.labelPlacement union type change in the web package types so both layers stay in sync.
packages/core/src/types/components/input.ts
packages/web/src/types/components/input.ts
Align HeroUI web dependencies with versions that support outside-top and remain compatible with Tailwind CSS v3.
  • Bump @heroui/input to ^2.4.23, the first version implementing outside-top behavior.
  • Bump @heroui/system to ^2.4.18 to stay consistent with the updated input and theme packages.
  • Bump @heroui/theme to ^2.4.17, the last Tailwind v3-compatible release that also includes the required outside-top CSS variants.
  • Update pnpm-lock.yaml to reflect the new dependency versions.
packages/web/package.json
pnpm-lock.yaml

Assessment against linked issues

Issue Objective Addressed Explanation
#512 Update the Input TypeScript interface to match HeroUI v2.8.0 changes (notably supporting the new outside-top labelPlacement option).
#512 Update HeroUI-related dependencies to versions that implement the new Input behavior introduced in HeroUI v2.8.0.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我在这里给出了一些整体性的反馈:

  • labelPlacement 联合类型现在同时出现在 packages/corepackages/web 中;建议提取成一个共享的类型(或从某个统一位置重新导出),这样今后再有类似的新增项时,只需要在单一的“可信源”(single source of truth)里更新即可。
  • packages/web/package.json 中,一些 HeroUI 依赖被固定在特定版本,而更新过的依赖则使用了插入号版本范围(例如 @heroui/input@heroui/theme);建议统一版本管理策略,或者在文档中说明为什么这些特定的包可以使用浮动版本,以避免后续出现不一致的升级。
给 AI 代理的提示(Prompt)
Please address the comments from this code review:

## Overall Comments
- The `labelPlacement` union is now duplicated in both `packages/core` and `packages/web`; consider extracting a shared type (or re-exporting from one place) so future additions like this only need to be updated in a single source of truth.
- In `packages/web/package.json`, some HeroUI dependencies are pinned while the updated ones now use a caret range (e.g., `@heroui/input`, `@heroui/theme`); consider aligning the versioning strategy or documenting why these specific packages are allowed to float to avoid inconsistent upgrades later.

Sourcery 对开源项目是免费的——如果你觉得我们的评审有帮助,欢迎分享给他人 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈来改进后续的评审。
Original comment in English

Hey - I've left some high level feedback:

  • The labelPlacement union is now duplicated in both packages/core and packages/web; consider extracting a shared type (or re-exporting from one place) so future additions like this only need to be updated in a single source of truth.
  • In packages/web/package.json, some HeroUI dependencies are pinned while the updated ones now use a caret range (e.g., @heroui/input, @heroui/theme); consider aligning the versioning strategy or documenting why these specific packages are allowed to float to avoid inconsistent upgrades later.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `labelPlacement` union is now duplicated in both `packages/core` and `packages/web`; consider extracting a shared type (or re-exporting from one place) so future additions like this only need to be updated in a single source of truth.
- In `packages/web/package.json`, some HeroUI dependencies are pinned while the updated ones now use a caret range (e.g., `@heroui/input`, `@heroui/theme`); consider aligning the versioning strategy or documenting why these specific packages are allowed to float to avoid inconsistent upgrades later.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the project’s Input component typing and web UI dependencies to support HeroUI v2.8.0’s new labelPlacement: 'outside-top' option.

Changes:

  • Extend InputProps.labelPlacement union type to include 'outside-top' in both core and web type definitions.
  • Bump @heroui/input, @heroui/system, and @heroui/theme versions in packages/web to pick up the new behavior/styles.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/web/src/types/components/input.ts Adds 'outside-top' to the labelPlacement type for web Input props.
packages/core/src/types/components/input.ts Adds 'outside-top' to the labelPlacement type for core Input props.
packages/web/package.json Updates HeroUI dependency versions needed for outside-top support.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/web/package.json
@sj817

sj817 commented Mar 24, 2026

Copy link
Copy Markdown
Member

@copilot

packages/core build: > [email protected] build:locale /home/runner/work/Karin/Karin/packages/core
packages/core build: > node cli/locale.js
packages/core build: Done
packages/web build$ tsc && vite build
packages/web build: src/components/heroui/inputs.tsx(72,15): error TS7006: Parameter 'el' implicitly has an 'any' type.
packages/web build: Failed
/home/runner/work/Karin/Karin/packages/web:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  [email protected] build: `tsc && vite build`
Exit status 2
 ELIFECYCLE  Command failed with exit code 2.
Error: Process completed with exit code 2.

Copilot AI commented Mar 24, 2026

Copy link
Copy Markdown
Contributor Author

@copilot

packages/core build: > [email protected] build:locale /home/runner/work/Karin/Karin/packages/core

...

Fixed in 76cd572. The upgrade to @heroui/[email protected] tightened the ref callback type, so TypeScript could no longer infer el. Added an explicit HTMLInputElement | null annotation to resolve TS7006.

@github-actions

Copy link
Copy Markdown
Contributor

你可以通过以下命令安装该版本:

pnpm add https://pkg.pr.new/node-karin@76cd572 -w

@sj817
sj817 merged commit e762c57 into main Mar 24, 2026
4 checks passed
@sj817
sj817 deleted the copilot/update-input-interface branch March 24, 2026 05:05
@github-actions github-actions Bot mentioned this pull request Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat: 输入框接口更新

3 participants