aicde-ui 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,27 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AICDE
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ The MIT license above covers the source code only. The AICDE name and
26
+ logo are brand assets of AICDE and are not licensed under it.
27
+ AICDE 名稱與 logo 為 AICDE 的品牌識別,不在上述 MIT 授權範圍內。
package/README.md CHANGED
@@ -1,3 +1,111 @@
1
- # Temporary Holding Version
1
+ <p align="center"><img src="https://zhijian090195.github.io/library/assets/aicde-mark.png" width="80" alt="AICDE"></p>
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ # aicde-ui
4
+
5
+ 給 React 用的現成元件:按鈕、輸入框、表格、對話框、通知……裝好就能用,還能一鍵換成 15 種風格。
6
+
7
+ - **看所有元件和範例**:https://zhijian090195.github.io/library/
8
+ - **原始碼**:https://github.com/zhijian090195/library
9
+
10
+ ## 安裝
11
+
12
+ ```bash
13
+ npm install aicde-ui
14
+ ```
15
+
16
+ 需要 React 18 以上。
17
+
18
+ ## 三步開始用
19
+
20
+ **1. 在入口檔案引入樣式(只要一次)**
21
+
22
+ 一般 React 專案放在 `main.jsx`;Next.js 放在 `app/layout.jsx`。
23
+
24
+ ```tsx
25
+ import 'aicde-ui/style.css';
26
+ ```
27
+
28
+ **2. 在要用的地方引入元件**
29
+
30
+ ```tsx
31
+ import { Button, Toaster, toast } from 'aicde-ui';
32
+
33
+ export default function App() {
34
+ return (
35
+ <>
36
+ <Button variant="primary" onClick={() => toast('已儲存', { type: 'success' })}>
37
+ 儲存
38
+ </Button>
39
+ <Toaster />
40
+ </>
41
+ );
42
+ }
43
+ ```
44
+
45
+ **3.(建議)加上字型**
46
+
47
+ 放在網頁的 `<head>` 裡,字會比較好看:
48
+
49
+ ```html
50
+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700&family=Noto+Sans+TC:wght@400;500;700&family=JetBrains+Mono:wght@500;700&family=Noto+Serif+TC:wght@700&display=swap" rel="stylesheet">
51
+ ```
52
+
53
+ **小提醒**
54
+
55
+ - 要跳通知(`toast`、`notify`),畫面上要放一個 `<Toaster />`。
56
+ - Next.js 可以直接用,不用另外設定。
57
+
58
+ ## 換風格
59
+
60
+ 用 `ThemeProvider` 包起來,`theme` 填風格名稱:
61
+
62
+ ```tsx
63
+ import { ThemeProvider } from 'aicde-ui';
64
+
65
+ <ThemeProvider theme="cute" mode="dark">
66
+ <App />
67
+ </ThemeProvider>
68
+ ```
69
+
70
+ `mode` 可以填 `light`(淺色)、`dark`(深色)或 `system`(跟著電腦設定)。
71
+
72
+ | theme | 風格 | 適合 |
73
+ |---|---|---|
74
+ | `default` | 紙雕(預設):像紙一層層疊起來 | 品牌官網、一般產品 |
75
+ | `clean` | 簡潔:細框、沒有陰影 | 後台、工具 |
76
+ | `paper` | 暖紙雕:米色紙張 | 餐飲、文創 |
77
+ | `ink` | 混合媒材:手繪墨線 | 創意工作室、教育 |
78
+ | `soft` | 柔光:圓圓的、柔和陰影 | 消費型 App、健康 |
79
+ | `riso` | 網點絲印:印刷網點 | 活動、出版 |
80
+ | `brutal` | 新粗野:粗黑框、直角 | 開發者工具、新創 |
81
+ | `stitch` | 手縫布藝:車縫虛線 | 手作、親子、寵物 |
82
+ | `ticket` | 水彩票根:打孔、水彩 | 旅遊、售票 |
83
+ | `block` | 積木:厚底、立體 | 遊戲、兒童 |
84
+ | `blueprint` | 藍圖:工程細線 | 工程、建築 |
85
+ | `clinical` | 醫療:海藍色、按鈕大好點 | 醫院、保險、政府 |
86
+ | `cute` | 可愛:大圓角、會彈跳 | 寵物、兒童、社群 |
87
+ | `finance` | 金融:資訊密集、數字對齊 | 交易平台、報表 |
88
+ | `editorial` | 編輯:雜誌感、襯線標題 | 媒體、部落格 |
89
+
90
+ ## 有哪些元件
91
+
92
+ | 類別 | 元件 |
93
+ |---|---|
94
+ | 通用 | `Button` 按鈕、`Divider` 分隔線、`FloatButton` 浮動按鈕、`BackTop` 回到頂部 |
95
+ | 導覽 | `Tabs` 分頁標籤、`Pagination` 頁碼、`Dropdown` 下拉選單、`Breadcrumb` 麵包屑、`Steps` 步驟、`Menu` 側邊選單、`CommandPalette` 指令面板、`ContextMenu` 右鍵選單 |
96
+ | 輸入 | `Input` 輸入框、`Textarea` 多行輸入、`Select` 下拉選擇、`Checkbox` 勾選、`Radio` 單選、`Switch` 開關、`Segmented` 分段切換、`Slider` 滑桿、`InputNumber` 數字、`OtpInput` 驗證碼、`Autocomplete` 自動完成、`Cascader` 多層選擇、`ColorPicker` 選色、`DatePicker` 日期、`RangePicker` 日期範圍、`Rating` 評分、`Upload` 上傳、`TagInput` 標籤輸入、`Transfer` 穿梭框、`Field` 欄位標題與錯誤訊息 |
97
+ | 展示 | `Card` 卡片、`Tag` 標籤、`Badge` 徽章、`Avatar` 頭像、`Table` 表格、`DataTable` 可排序表格、`List` 列表、`Descriptions` 資料欄位、`Statistic` 數字、`Timeline` 時間軸、`Collapse` 折疊、`Tooltip` 提示、`Calendar` 月曆、`Tree` 樹狀、`Carousel` 輪播、`ImagePreview` 看大圖、`Empty` 空狀態、`Kbd` 鍵盤按鍵 |
98
+ | 回饋 | `Modal` 對話框、`Drawer` 側邊抽屜、`toast()` / `notify()` 通知、`Alert` 提示、`Banner` 橫幅、`Progress` 進度條、`Spinner` 轉圈、`Skeleton` 載入佔位、`Popover` 彈出卡片、`Result` 結果頁 |
99
+
100
+ 每個元件怎麼用、有哪些參數,網站上都有範例。
101
+
102
+ **兩種寫法都可以**:元件可以讓它自己記住狀態(例如 `defaultValue`),也可以由你控制(例如 `value` + `onChange`)。
103
+
104
+ ## 好操作
105
+
106
+ 按鈕、輸入框、下拉選擇、對話框、表格這幾個最常用的元件,都測試過只用鍵盤也能操作,視障者用的讀屏軟體也念得出來。
107
+
108
+ ## 授權
109
+
110
+ - 程式碼是 MIT 授權,可以免費使用、修改、商用。
111
+ - AICDE 名稱和 logo 不包含在內,做自己的產品時請換成你自己的。