Component: Timezone Picker

未关闭
#91 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
react, tailwindcss, typescript
领域
frontend

调研方向

Start with src/registry/components/locale-picker.tsx and its listbox navigation, then inspect useControllableState, test/, and the registry and documentation paths named in the issue. Build the timezone picker to meet the listed API and behavior, and add tests for grouping, search, offset formatting, and controlled versus uncontrolled use. Done means the component, exports, registry entry, tests, and documentation page are present.

由索引模型根据 Issue 内容生成。

描述

component date-time good first issue

Component: Timezone Picker

A searchable picker for IANA time zones, grouped by region, showing each zone's current UTC offset and local time.

Requirements
  • TypeScript-first with exported props interface
  • Zone list from Intl.supportedValuesOf("timeZone"); accept an optional timeZones prop to limit it
  • Grouped by region (Europe, America, Asia…), with human-readable city names (America/New_York → "New York")
  • Each option shows the current offset (UTC+02:00) and local time, computed with Intl.DateTimeFormat (timeZoneName: "shortOffset"), so it's correct across DST changes
  • Search matches city, region and offset
  • Defaults to the visitor's zone (Intl.DateTimeFormat().resolvedOptions().timeZone) when uncontrolled and no defaultValue is given
  • Follows the component conventions: value / defaultValue / onValueChange via useControllableState, forwarded ref, ...rest
  • Keyboard navigation through use-listbox-navigation, like LocalePicker
  • Labels (placeholder, "No results") passed as props
Expected API
<TimezonePicker
  defaultValue="Europe/Berlin"
  onValueChange={(zone) => saveUserTimezone(zone)}
  labels={{ placeholder: "Search time zones", empty: "No time zone found" }}
/>
Deliverables
  • Component source in src/registry/components/
  • Export in src/registry/components/index.ts and entry in src/registry/registry.ts
  • Tests in test/ covering grouping, search, offset formatting and controlled vs uncontrolled use
  • Documentation page in content/docs/components/locale-pickers/

LocalePicker (src/registry/components/locale-picker.tsx) is a good reference for the listbox and search behaviour.

See CONTRIBUTING.md and the Contributor Rulebook.

主要语言
TypeScript
星标
39
派生
16
平均合并
18 小时 14 分钟
30 天内合并 PR
35

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

babelize/babelize-elements 的其他 Issue

查看 babelize/babelize-elements 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。