Commit 6ab92fd
authored
feat(react): add Card variant prop, type fixes, and Pro app (#85)
* fix(react): fix NativeSelect children type and Table optional dataIndex
- NativeSelect children type now accepts arrays of ReactElements
- Table ColumnType.dataIndex is now optional for action columns
- Updated getValue helper to handle undefined dataIndex gracefully
* feat(card): add variant prop with outlined, elevated, and filled styles
- Add CardVariant type: 'outlined' | 'elevated' | 'filled'
- outlined: border (default, same as bordered=true)
- elevated: box-shadow using --ty-shadow-card token
- filled: subtle background using --ty-color-fill token
- variant takes precedence over deprecated bordered prop
- Full backward compatibility: existing bordered prop still works
- Added Variant demo and updated docs (EN + CN)
* feat(pro): add Tiny Design Pro app with UI block examples
Next.js 15 static site with 20 block categories and 25 blocks
showcasing @tiny-design/react components. Features include:
- Live preview with responsive viewport toggle (desktop/tablet/mobile)
- Source code view with syntax highlighting and copy button
- Light/dark theme support with anti-FOUC script
- Static export for GitHub Pages deployment at /tiny-design/pro/
* feat(docs): add Pro nav link and update deploy workflow
- Add "Pro" link with "New" badge to docs header navigation
- Update deploy-site.yml to build and merge pro app output into
the combined GitHub Pages deployment at /tiny-design/pro/
* chore: update pnpm-lock.yaml
* chore: add changeset for card variant and type fixes
* fix(icon): add missing semicolons in svg-icons demo
* refactor(pro): use react-runner for block previews
Replace direct component imports with react-runner's useRunner hook.
Blocks are now rendered from their raw source strings, making the
source code the single source of truth for both preview and code view.
This removes the duplicate dynamic import per block.
* fix(pro): exclude ?raw imports from SWC transform in webpack config
Existing Next.js oneOf rules were compiling TSX before the asset/source
loader could read the original text. Now ?raw queries are excluded from
all oneOf sub-rules so the raw source is preserved as-is.
* fix(pro): strip Next.js HMR code from raw source in dev mode
In dev mode, Next.js appends import.meta.webpackHot HMR code to
asset/source modules, causing react-runner's sucrase transform to
fail with "Cannot use import.meta outside a module". Strip the
appended IIFE wrapper before passing the source to useRunner.
* fix(pro): fix hydration mismatch in theme toggle icon
Defer theme-dependent icon rendering until after mount to prevent
server/client mismatch when localStorage theme differs from default.
* fix: build issue
* feat: update pro page
* chore: update styles
* fix: build issues
* chore: fix file path1 parent e89a0ca commit 6ab92fd
File tree
66 files changed
+4121
-36
lines changed- .changeset
- .github/workflows
- apps
- docs/src
- containers/theme-editor/components
- locale
- pro
- src
- app
- blocks/[category]
- blocks
- authentication
- banners
- cards
- form-layouts
- lists
- notifications
- page-headers
- page-shells
- progress-steps
- sidebars
- stats
- tables
- user-cards
- components
- block-preview
- layout
- theme-script
- utils
- packages/react/src
- alert
- card
- __tests__
- __snapshots__
- demo
- style
- icon/demo
- native-select
- table
- tag/style
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
66 files changed
+4121
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
46 | 54 | | |
47 | 55 | | |
48 | 56 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
130 | 133 | | |
131 | 134 | | |
132 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
0 commit comments