Skip to content

feat(iconfont): add API and introduction markdown files - #12

Merged
shijistar merged 2 commits into
masterfrom
feature/iconfont-description-raw-md
Aug 3, 2026
Merged

feat(iconfont): add API and introduction markdown files#12
shijistar merged 2 commits into
masterfrom
feature/iconfont-description-raw-md

Conversation

@shijistar

@shijistar shijistar commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Documentation
    • Added bilingual documentation for the icon font factory, supported properties, sizing, animation, rotation, and configuration options.
  • Enhancements
    • Improved the icon font Storybook playground with configurable script URLs and safer handling of optional icon settings.
    • Updated the layout for clearer vertical presentation of controls and examples.
  • Chores
    • Improved Storybook type support and project configuration for more reliable documentation development.

… via ?raw

- Move the large bilingual (EN/CN) API description out of Iconfont.stories.tsx
  into Iconfont.apidoc.md, imported with Vite ?raw.
- Add .storybook/vite-env.d.ts referencing vite/client so *?raw is typed.
- Preserves the existing autodocs render pipeline and EN/CN language toggle
  (parameters.docs.description.component content is unchanged at runtime).
Copilot AI review requested due to automatic review settings August 3, 2026 15:12
@shijistar
shijistar merged commit 2c1e36a into master Aug 3, 2026
2 checks passed
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b5d9c0d9-03ae-4a51-a991-807c0c5bd337

📥 Commits

Reviewing files that changed from the base of the PR and between 2f761d9 and 201bcda.

📒 Files selected for processing (5)
  • .storybook/stories/components/Iconfont/api-doc.md
  • .storybook/stories/components/Iconfont/index.stories.tsx
  • .storybook/stories/components/Iconfont/introduce.md
  • .storybook/vite-env.d.ts
  • tsconfig.json

📝 Walkthrough

Walkthrough

The Iconfont Storybook story now supports configurable script URLs, optional icon settings, external bilingual documentation, and updated TypeScript inclusion for .storybook files.

Changes

Iconfont Storybook experience

Layer / File(s) Summary
Storybook documentation and type setup
.storybook/stories/components/Iconfont/introduce.md, .storybook/stories/components/Iconfont/api-doc.md, .storybook/stories/components/Iconfont/index.stories.tsx, .storybook/vite-env.d.ts, tsconfig.json
The story loads bilingual introduction and API documentation. The Storybook environment includes Vite client types and recursively includes .storybook files.
Configurable Iconfont playground
.storybook/stories/components/Iconfont/index.stories.tsx
The playground exposes scriptUrl, handles optional icon values, memoizes createIconfont, conditionally renders the icon, and uses Space orientation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant StorybookControls
  participant IconfontPlayground
  participant createIconfont
  participant IconComponent
  StorybookControls->>IconfontPlayground: provide scriptUrl and icon settings
  IconfontPlayground->>createIconfont: create icon component
  createIconfont-->>IconfontPlayground: return IconComponent
  IconfontPlayground->>IconComponent: render when values are available
Loading

Possibly related PRs

Suggested reviewers: copilot

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/iconfont-description-raw-md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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 enhances the Storybook documentation surface for the Iconfont component/factory by moving the long inline docs content into dedicated markdown files and wiring those files into the story, while also adjusting TypeScript/Storybook typing support for Vite raw imports.

Changes:

  • Added introduce.md and api-doc.md and composed them into the Storybook docs description.
  • Improved the Iconfont Storybook story controls by exposing scriptUrl and making several args optional for easier playground usage.
  • Updated TypeScript configuration and Storybook typings to better cover .storybook files and Vite ?raw imports.

Reviewed changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tsconfig.json Expands .storybook inclusion to ensure nested Storybook files are included for TS compilation.
.storybook/vite-env.d.ts Adds vite/client type references so TS understands Vite features (e.g., ?raw imports).
.storybook/stories/components/Iconfont/introduce.md New intro documentation for createIconfont (EN/CN).
.storybook/stories/components/Iconfont/api-doc.md New API/reference documentation for createIconfont (EN/CN).
.storybook/stories/components/Iconfont/index.stories.tsx Switches docs to markdown imports, fixes relative imports, and enhances story args/controls.

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.

2 participants