knowidea-ui 0.8.0 → 0.8.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.
Files changed (2) hide show
  1. package/README.md +28 -30
  2. package/package.json +7 -7
package/README.md CHANGED
@@ -1,40 +1,38 @@
1
1
  # knowidea-ui
2
2
 
3
- KNOW IDEA の UI ライブラリの React 19 コンポーネント。特定のアプリに依存しない。見た目は `knowidea-css` のクラスを当てるだけで、挙動が複雑なコンポーネント(Dialog、ConfirmDialog、Tabs、Menu、Tooltip、Select、Checkbox、Radio、Switch、Toast、Field、Input、Accordion、Progress、Avatar、Drawer、Sheet、SegmentedControl、DatePicker、Popover、Combobox、Slider、Stepper)は `@base-ui/react` 1.9.0 をベースに実装している。
3
+ KNOW IDEA UI の React の部品。54 個。ボタン、入力、表、ダイアログ、トーストなど。ライトとダークの両方に対応し、押せる所はすべて 44px 以上。
4
4
 
5
- | コマンド | 中身 |
6
- | --- | --- |
7
- | `pnpm --filter knowidea-ui build` | tsc で `dist/` に JS と型定義を出力する |
8
-
9
- 事前に `knowidea-tokens` と `knowidea-icons` のビルドが必要。`pnpm -r build` は依存順にビルドする。
10
-
11
- ## 入れ方
5
+ [ドキュメント](https://takikou347.github.io/knowidea-ui/) / [GitHub](https://github.com/takikou347/knowidea-ui) / MIT
12
6
 
13
- npm などには出していない(公開先はまだ決まっていない)。リポジトリの `pnpm release:pack` で `release/` に tarball を作り、使う側で 4 つ全部を入れる。`knowidea-css`、`knowidea-icons`、`knowidea-tokens` は `peerDependencies` なので、同じコマンドで入れないと解決できない。手順は `apps/docs` の Installation。`pnpm test:consumer` が、新しいプロジェクトで手順どおりに動くことを確かめる。
14
-
15
- ## Components
16
-
17
- | Category | Components |
18
- | --- | --- |
19
- | Inputs | Button、IconButton、TextField、Input、Textarea、Select、Combobox、DatePicker、Calendar、Checkbox、Radio、SegmentedControl、Slider、Stepper、FileUpload、Switch、Field |
20
- | Data display | Avatar、Badge、Chip、Status、Stat(Sparkline)、Table、List(ListItem)、Timeline、Tooltip、Popover、Kbd、CodeBlock、Quote |
21
- | Feedback | Alert、Toast、Dialog、ConfirmDialog、Sheet、Progress、Skeleton、Spinner、EmptyState |
22
- | Surfaces | Card、Accordion、SelectionBar |
23
- | Navigation | Link、Tabs、Menu、Breadcrumbs、Pagination、AppBar、Drawer、BottomNavigation |
24
- | Layout | Stack、Grid、Container、Divider |
25
- | Charts | Chart(棒グラフと折れ線グラフ。追加の依存なしで、自前の SVG で描画する) |
26
- | Theme | ThemeProvider、createTheme |
7
+ ## 入れる
27
8
 
28
- すべてのコンポーネントが、Empty、Loading、Error、Disabled、Focus の 5 つの状態を備える。Props、CSS のクラスと変数、アクセシビリティは、`apps/docs`(ドキュメントサイト)の各ページに記載している。
29
-
30
- アイコンは `knowidea-icons` を使う。`Icon` は `ki-icon` クラスを付けたラッパーで、`name` には `icons.json` の名前を渡す。`icon` プロパティは ReactNode を受け取るため、`SearchIcon` のような名前ごとのコンポーネントも渡せる。
9
+ ```sh
10
+ npm install knowidea-ui knowidea-css knowidea-tokens knowidea-icons
11
+ ```
31
12
 
32
- ## Theme
13
+ ## 使う
33
14
 
34
15
  ```tsx
35
- <ThemeProvider theme={{ primary: "#016C6C", radius: 8, density: "compact", fontSize: 14 }}>
36
- <App />
37
- </ThemeProvider>
16
+ import "knowidea-tokens/tokens.css";
17
+ import "knowidea-css/index.css";
18
+ import { Button, ThemeProvider } from "knowidea-ui";
19
+
20
+ export function App() {
21
+ return (
22
+ <ThemeProvider theme={{ primary: "#016C6C" }}>
23
+ <Button>保存する</Button>
24
+ </ThemeProvider>
25
+ );
26
+ }
38
27
  ```
39
28
 
40
- 囲んだ範囲にだけ CSS 変数をオーバーライドする(ライトとダークの両方)。コントラスト比が 4.5:1 に届かない組み合わせは `console.warn` に出力される(`onWarn` で受け取れる)。仕組みは `packages/tokens/README.md` を参照。
29
+ 主の色、角丸、密度、字の大きさ、グラデーションの見た目(`look: "gradient"`)を `ThemeProvider` で変えられる。部品ごとの使い方はドキュメントにある。
30
+
31
+ ## 4 つのパッケージ
32
+
33
+ | パッケージ | 中身 |
34
+ | --- | --- |
35
+ | [knowidea-tokens](https://www.npmjs.com/package/knowidea-tokens) | 色、余白、角丸、書体の CSS 変数と、テーマを作る `createTheme` |
36
+ | [knowidea-css](https://www.npmjs.com/package/knowidea-css) | 部品の見た目(`ki-` のクラス)。素の HTML でも使える |
37
+ | [knowidea-icons](https://www.npmjs.com/package/knowidea-icons) | アイコン 133 個(SVG のスプライトと React) |
38
+ | [knowidea-ui](https://www.npmjs.com/package/knowidea-ui) | React 19 の部品 54 個。土台は Base UI |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knowidea-ui",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "KNOW IDEA UI の React の部品(Base UI が土台)",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -30,9 +30,9 @@
30
30
  "peerDependencies": {
31
31
  "react": "^19.0.0",
32
32
  "react-dom": "^19.0.0",
33
- "knowidea-css": "^0.8.0",
34
- "knowidea-icons": "^0.8.0",
35
- "knowidea-tokens": "^0.8.0"
33
+ "knowidea-css": "^0.8.1",
34
+ "knowidea-icons": "^0.8.1",
35
+ "knowidea-tokens": "^0.8.1"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/react": "19.3.0",
@@ -40,9 +40,9 @@
40
40
  "react": "19.3.0",
41
41
  "react-dom": "19.3.0",
42
42
  "typescript": "5.9.3",
43
- "knowidea-icons": "0.8.0",
44
- "knowidea-css": "0.8.0",
45
- "knowidea-tokens": "0.8.0"
43
+ "knowidea-css": "0.8.1",
44
+ "knowidea-tokens": "0.8.1",
45
+ "knowidea-icons": "0.8.1"
46
46
  },
47
47
  "files": [
48
48
  "dist",