@noemaru1011/ui 1.0.1 → 1.0.3

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/llms-full.txt ADDED
@@ -0,0 +1,509 @@
1
+ # my-ui-catalog — Full AI Context
2
+
3
+ ## 1. Overview
4
+
5
+ `@noemaru1011/ui` is a reusable UI component library built with React and TypeScript.
6
+
7
+ It provides components for application interfaces, layout composition, common interactions, and low-level UI primitives.
8
+
9
+ Repository:
10
+
11
+ - https://github.com/noemaru1011/my-ui-catalog
12
+
13
+ Storybook:
14
+
15
+ - https://noemaru1011.github.io/my-ui-catalog/
16
+
17
+ npm package:
18
+
19
+ - `@noemaru1011/ui`
20
+
21
+ ## 2. Technology Stack
22
+
23
+ The project uses the following technologies:
24
+
25
+ - React 19
26
+ - TypeScript
27
+ - Vite
28
+ - Tailwind CSS 4
29
+ - Base UI
30
+ - class-variance-authority
31
+ - i18next
32
+ - react-i18next
33
+ - Storybook
34
+
35
+ Use the package's published peer dependency requirements as the source of truth for compatibility.
36
+
37
+ ## 3. Installation
38
+
39
+ ```bash
40
+ npm install @noemaru1011/ui
41
+ ```
42
+
43
+ Import the stylesheet in the application entry point:
44
+
45
+ ```tsx
46
+ import '@noemaru1011/ui/style.css';
47
+ ```
48
+
49
+ The stylesheet provides the library's Tailwind CSS output, theme variables, and component styles.
50
+
51
+ ## 4. Public API
52
+
53
+ The package entry point is `src/index.ts`.
54
+
55
+ ### 4.1 Elements
56
+
57
+ The Elements collection provides higher-level, reusable interface components.
58
+
59
+ ```tsx
60
+ import {
61
+ Accordion,
62
+ Blockquote,
63
+ Checkbox,
64
+ Combobox,
65
+ ComboboxMultiple,
66
+ DatePicker,
67
+ DateRange,
68
+ DescriptionList,
69
+ Disclosure,
70
+ FileUpload,
71
+ FileUploadButton,
72
+ HamburgerMenu,
73
+ Heading,
74
+ Image,
75
+ Input,
76
+ PasswordInput,
77
+ Link,
78
+ List,
79
+ Loading,
80
+ Radio,
81
+ LanguageSelect,
82
+ Select,
83
+ Switch,
84
+ ThemeSwitch,
85
+ Text,
86
+ Textarea,
87
+ } from '@noemaru1011/ui';
88
+ ```
89
+
90
+ Available components:
91
+
92
+ - Accordion
93
+ - Blockquote
94
+ - Checkbox
95
+ - Combobox
96
+ - ComboboxMultiple
97
+ - DatePicker
98
+ - DateRange
99
+ - DescriptionList
100
+ - Disclosure
101
+ - FileUpload
102
+ - FileUploadButton
103
+ - HamburgerMenu
104
+ - Heading
105
+ - Image
106
+ - Input
107
+ - PasswordInput
108
+ - Link
109
+ - List
110
+ - Loading
111
+ - Radio
112
+ - LanguageSelect
113
+ - Select
114
+ - Switch
115
+ - ThemeSwitch
116
+ - Text
117
+ - Textarea
118
+
119
+ ### 4.2 Layouts
120
+
121
+ The Layouts collection provides components for composing page and application structures.
122
+
123
+ ```tsx
124
+ import {
125
+ AppLayout,
126
+ Center,
127
+ Cluster,
128
+ Container,
129
+ Forbidden,
130
+ InternalServerError,
131
+ NotFound,
132
+ Grid,
133
+ Reel,
134
+ Stack,
135
+ } from '@noemaru1011/ui';
136
+ ```
137
+
138
+ Available components:
139
+
140
+ - AppLayout
141
+ - Center
142
+ - Cluster
143
+ - Container
144
+ - Forbidden
145
+ - InternalServerError
146
+ - NotFound
147
+ - Grid
148
+ - Reel
149
+ - Stack
150
+
151
+ ### 4.3 UI Components
152
+
153
+ The package also exports commonly used UI components directly.
154
+
155
+ ```tsx
156
+ import {
157
+ Alert,
158
+ AlertDialog,
159
+ Badge,
160
+ Breadcrumb,
161
+ Button,
162
+ Card,
163
+ Carousel,
164
+ Dialog,
165
+ Drawer,
166
+ Field,
167
+ InputGroup,
168
+ Label,
169
+ Pagination,
170
+ Popover,
171
+ RadioGroup,
172
+ Separator,
173
+ Spinner,
174
+ Table,
175
+ Tabs,
176
+ Toast,
177
+ Tooltip,
178
+ } from '@noemaru1011/ui';
179
+ ```
180
+
181
+ Available components:
182
+
183
+ - Alert
184
+ - AlertDialog
185
+ - Badge
186
+ - Breadcrumb
187
+ - Button
188
+ - Card
189
+ - Carousel
190
+ - Dialog
191
+ - Drawer
192
+ - Field
193
+ - InputGroup
194
+ - Label
195
+ - Pagination
196
+ - Popover
197
+ - RadioGroup
198
+ - Separator
199
+ - Spinner
200
+ - Table
201
+ - Tabs
202
+ - Toast
203
+ - Tooltip
204
+
205
+ ### 4.4 Primitive Components
206
+
207
+ Low-level UI primitives are available through the `primitives` namespace.
208
+
209
+ ```tsx
210
+ import { primitives } from '@noemaru1011/ui';
211
+ ```
212
+
213
+ The namespace exposes the components exported from `src/components/ui`.
214
+
215
+ These include:
216
+
217
+ - accordion
218
+ - alert
219
+ - alert-dialog
220
+ - badge
221
+ - breadcrumb
222
+ - button
223
+ - calendar
224
+ - card
225
+ - carousel
226
+ - checkbox
227
+ - combobox
228
+ - dialog
229
+ - drawer
230
+ - field
231
+ - input-group
232
+ - input
233
+ - label
234
+ - pagination
235
+ - popover
236
+ - radio-group
237
+ - select
238
+ - separator
239
+ - spinner
240
+ - switch
241
+ - table
242
+ - tabs
243
+ - textarea
244
+ - toast
245
+ - tooltip
246
+
247
+ Use the higher-level Elements and Layouts exports when they satisfy the use case. Use primitives when lower-level control is needed.
248
+
249
+ ### 4.5 Other Exports
250
+
251
+ The package entry point also exports:
252
+
253
+ - Theme Provider
254
+ - i18n configuration
255
+ - data-table-features
256
+ - utility functions
257
+
258
+ Refer to `src/index.ts` and the corresponding source files for exact export names and signatures.
259
+
260
+ ## 5. Button
261
+
262
+ The Button component is based on Base UI and uses class-variance-authority for variant and size styling.
263
+
264
+ ### Variants
265
+
266
+ - `default`
267
+ - `outline`
268
+ - `secondary`
269
+ - `ghost`
270
+ - `destructive`
271
+ - `link`
272
+
273
+ ### Sizes
274
+
275
+ - `default`
276
+ - `xs`
277
+ - `sm`
278
+ - `lg`
279
+ - `icon`
280
+ - `icon-xs`
281
+ - `icon-sm`
282
+ - `icon-lg`
283
+
284
+ ### Loading State
285
+
286
+ The Button supports a `loading` property.
287
+
288
+ When loading is enabled:
289
+
290
+ - The button is disabled.
291
+ - `aria-busy` is set.
292
+ - A Spinner is displayed.
293
+
294
+ Example:
295
+
296
+ ```tsx
297
+ import { Button } from '@noemaru1011/ui';
298
+
299
+ export function SaveButton() {
300
+ return (
301
+ <Button loading>
302
+ Saving...
303
+ </Button>
304
+ );
305
+ }
306
+ ```
307
+
308
+ The exact TypeScript interface should be checked in the published type definitions.
309
+
310
+ ## 6. Styling and Theme
311
+
312
+ The library stylesheet is defined in:
313
+
314
+ - `src/index.css`
315
+
316
+ The project uses Tailwind CSS 4 and semantic CSS variables.
317
+
318
+ ### Theme
319
+
320
+ The stylesheet defines:
321
+
322
+ - Light theme variables on `:root`
323
+ - Dark theme variables on `.dark`
324
+
325
+ The library supports semantic design tokens for colors and UI styling.
326
+
327
+ Use the provided theme variables rather than hardcoding colors when extending the design system.
328
+
329
+ ### Typography
330
+
331
+ The stylesheet includes Noto Sans JP Variable as a Japanese font resource.
332
+
333
+ ### Border Radius
334
+
335
+ The base radius is:
336
+
337
+ ```css
338
+ --radius: 0.625rem;
339
+ ```
340
+
341
+ This corresponds to 10px when the root font size is 16px.
342
+
343
+ The design system generally uses the standard radius scale. Documented exceptions include:
344
+
345
+ - `rounded-full`
346
+ - `rounded-none`
347
+ - `rounded-[inherit]`
348
+ - `rounded-[2px]`
349
+
350
+ ### Z-index
351
+
352
+ The stylesheet defines semantic z-index utility classes:
353
+
354
+ - `z-base`
355
+ - `z-local`
356
+ - `z-sticky`
357
+ - `z-popover`
358
+ - `z-overlay`
359
+ - `z-modal`
360
+ - `z-toast`
361
+ - `z-tooltip`
362
+
363
+ Prefer these semantic layers when implementing overlays, dialogs, popovers, notifications, and tooltips.
364
+
365
+ ## 7. Internationalization (i18n)
366
+
367
+ The i18n configuration is defined in:
368
+
369
+ - `src/i18n/index.ts`
370
+
371
+ The library uses:
372
+
373
+ - i18next
374
+ - i18next-browser-languagedetector
375
+ - react-i18next
376
+
377
+ Configuration:
378
+
379
+ - Default language: Japanese (`ja`)
380
+ - Fallback language: Japanese (`ja`)
381
+ - Default namespace: `common`
382
+ - Namespaces:
383
+ - `common`
384
+ - `error`
385
+ - `example`
386
+
387
+ Language detection:
388
+
389
+ - localStorage
390
+ - Browser navigator
391
+
392
+ Detected language settings are cached in localStorage.
393
+
394
+ Refer to the i18n source and exported API for the exact initialization and integration procedure.
395
+
396
+ ## 8. Basic Usage
397
+
398
+ ```tsx
399
+ import '@noemaru1011/ui/style.css';
400
+
401
+ import {
402
+ Button,
403
+ Card,
404
+ Heading,
405
+ Stack,
406
+ Text,
407
+ } from '@noemaru1011/ui';
408
+
409
+ export function SamplePage() {
410
+ return (
411
+ <Stack>
412
+ <Card>
413
+ <Heading>Welcome</Heading>
414
+ <Text>This is a sample page.</Text>
415
+ <Button>Continue</Button>
416
+ </Card>
417
+ </Stack>
418
+ );
419
+ }
420
+ ```
421
+
422
+ This example illustrates the import pattern. Check the published type definitions for the exact props supported by each component.
423
+
424
+ ## 9. Build and Source Structure
425
+
426
+ The library build configuration is:
427
+
428
+ - `vite.lib.config.ts`
429
+
430
+ The build entry point is:
431
+
432
+ - `src/index.ts`
433
+
434
+ The build output directory is:
435
+
436
+ - `dist`
437
+
438
+ The library build also generates TypeScript declaration files.
439
+
440
+ Important source locations:
441
+
442
+ | Path | Purpose |
443
+ |---|---|
444
+ | `src/index.ts` | Public package entry point |
445
+ | `src/components/elements/` | Higher-level reusable components |
446
+ | `src/components/layouts/` | Layout components |
447
+ | `src/components/ui/` | Low-level UI primitives |
448
+ | `src/components/providers/theme-provider/` | Theme provider |
449
+ | `src/i18n/` | Internationalization |
450
+ | `src/index.css` | Global styles and design tokens |
451
+ | `src/stories/` | Storybook documentation and examples |
452
+ | `.storybook/` | Storybook configuration |
453
+
454
+ ## 10. Storybook
455
+
456
+ Storybook is used to document and demonstrate components.
457
+
458
+ Public Storybook:
459
+
460
+ https://noemaru1011.github.io/my-ui-catalog/
461
+
462
+ The project configures Storybook to load MDX and component stories from `src`.
463
+
464
+ Use Storybook to inspect component appearance and examples. For exact TypeScript APIs, use the source code or published declaration files.
465
+
466
+ ## 11. Guidelines for AI Agents
467
+
468
+ When generating code using this library, follow these rules:
469
+
470
+ 1. Import components from `@noemaru1011/ui` unless there is a clear reason to use another entry point.
471
+ 2. Import `@noemaru1011/ui/style.css` in the application.
472
+ 3. Prefer Elements and Layouts for common application UI.
473
+ 4. Use `primitives` for low-level UI composition.
474
+ 5. Do not invent component names, props, variants, or event handlers.
475
+ 6. Verify exact component interfaces against the published TypeScript declaration files.
476
+ 7. Do not assume every primitive has the same API as its higher-level counterpart.
477
+ 8. Reuse the library's theme tokens and semantic styles.
478
+ 9. Prefer the existing i18n configuration for translated text.
479
+ 10. Use Storybook as a visual reference, not as a replacement for TypeScript API definitions.
480
+
481
+ ## 12. Source of Truth
482
+
483
+ When information conflicts, use this priority order:
484
+
485
+ 1. Published TypeScript declaration files
486
+ 2. Current source code
487
+ 3. Package metadata
488
+ 4. Storybook examples
489
+ 5. README and other documentation
490
+ 6. This AI context document
491
+
492
+ This document is intended to help AI systems understand the package structure and usage. It is not a replacement for the actual API definitions.
493
+
494
+ ## 13. Maintenance
495
+
496
+ When the library changes, update this document alongside the relevant source changes.
497
+
498
+ In particular, review:
499
+
500
+ - Public exports
501
+ - Component names
502
+ - Component props and types
503
+ - Dependencies and peer dependencies
504
+ - Styling and theme tokens
505
+ - i18n configuration
506
+ - Installation instructions
507
+ - Storybook examples
508
+
509
+ Keep `llms.txt` concise and use `llms-full.txt` for detailed documentation.
package/llms.txt ADDED
@@ -0,0 +1,56 @@
1
+ # my-ui-catalog
2
+
3
+ > React 19 / TypeScript 向けの再利用可能な UI コンポーネントライブラリです。Elements、Layouts、UI Primitives、Theme Provider などを提供します。
4
+
5
+ ## Documentation
6
+
7
+ - [Full AI Context](./llms-full.txt): AI エージェント向けの詳細な利用ガイド
8
+ - [README](./README.md): インストール・基本的な利用方法
9
+ - [Storybook](https://noemaru1011.github.io/my-ui-catalog/): コンポーネントの表示・動作確認
10
+ - [package.json](./package.json): パッケージ情報・依存関係・公開設定
11
+ - [Source Entry](./src/index.ts): 公開 API のエントリーポイント
12
+ - [Styles](./src/index.css): Tailwind CSS・テーマ・デザイントークン
13
+
14
+ ## Package
15
+
16
+ - npm package: `@noemaru1011/ui`
17
+ - Repository: https://github.com/noemaru1011/my-ui-catalog
18
+
19
+ ## Main Features
20
+
21
+ - React 19 対応の UI コンポーネント
22
+ - TypeScript による型定義
23
+ - Elements: 汎用的な UI コンポーネント
24
+ - Layouts: レイアウト構築用コンポーネント
25
+ - UI Primitives: 基本 UI コンポーネント
26
+ - Theme Provider: ライト・ダークテーマ対応
27
+ - i18n: 日本語をデフォルトとした多言語対応
28
+
29
+ ## Instructions for AI Agents
30
+
31
+ 1. コンポーネントの利用方法を回答する前に、必要に応じて `llms-full.txt` を参照してください。
32
+ 2. 実際の Props や型定義は、公開されている TypeScript 定義またはソースコードを正としてください。
33
+ 3. README や Storybook に記載のない Props・挙動を推測で作らないでください。
34
+ 4. 基本的には `@noemaru1011/ui` からコンポーネントを import してください。
35
+ 5. スタイルを利用する場合は `@noemaru1011/ui/style.css` を読み込んでください。
36
+ 6. `primitives` 名前空間は低レベルの UI コンポーネントを利用する場合に使用してください。
37
+
38
+ ## Quick Start
39
+
40
+ ```tsx
41
+ import '@noemaru1011/ui/style.css';
42
+
43
+ import { Button, Card } from '@noemaru1011/ui';
44
+
45
+ export function Example() {
46
+ return (
47
+ <Card>
48
+ <Button>Click me</Button>
49
+ </Card>
50
+ );
51
+ }
52
+ ```
53
+
54
+ ## Detailed Context
55
+
56
+ See [llms-full.txt](./llms-full.txt) for the full component catalog, exports, styling conventions, theme configuration, and usage guidance.
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@noemaru1011/ui",
3
3
  "private": false,
4
- "version": "1.0.1",
4
+ "version": "1.0.3",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "node": ">=24.22.2"
8
8
  },
9
9
  "files": [
10
10
  "dist",
11
- "README.md"
11
+ "llms.txt",
12
+ "llms-full.txt"
12
13
  ],
13
14
  "main": "./dist/index.js",
14
15
  "module": "./dist/index.js",
@@ -24,8 +25,12 @@
24
25
  "access": "public"
25
26
  },
26
27
  "peerDependencies": {
28
+ "i18next": "^27.0.1",
27
29
  "react": "^19.0.8",
28
- "react-dom": "^19.0.0"
30
+ "react-dom": "^19.0.0",
31
+ "react-i18next": "^18.0.0",
32
+ "react-router": "^7.18.4",
33
+ "react-router-dom": "^7.18.4"
29
34
  },
30
35
  "repository": {
31
36
  "type": "git",
@@ -53,61 +58,60 @@
53
58
  "dependencies": {
54
59
  "@base-ui/react": "^1.8.0",
55
60
  "@fontsource-variable/noto-sans-jp": "^5.3.1",
56
- "@hookform/resolvers": "^7.0.3",
57
- "@tailwindcss/vite": "^4.3.5",
58
- "@tanstack/react-query": "^5.107.1",
59
61
  "@tanstack/react-table": "^9.3.1",
60
62
  "class-variance-authority": "^0.7.1",
61
63
  "cn": "^0.5.2",
62
64
  "date-fns": "^4.4.0",
63
65
  "embla-carousel-react": "^8.6.0",
64
- "i18next": "^27.0.1",
65
- "i18next-browser-languagedetector": "^8.3.0",
66
- "lucide-react": "^1.49.0",
67
- "react": "^19.0.8",
66
+ "lucide-react": "^1.73.0",
68
67
  "react-day-picker": "^10.0.2",
69
- "react-dom": "^19.0.0",
70
- "react-hook-form": "^7.89.0",
71
- "react-i18next": "^18.0.0",
72
68
  "react-router-dom": "^7.18.4",
73
- "remark-gfm": "^4.0.1",
74
- "tailwindcss": "^4.3.3",
75
- "tw-animate-css": "^1.4.0",
76
- "zod": "^4.6.5"
69
+ "tw-animate-css": "^1.4.0"
77
70
  },
78
71
  "devDependencies": {
79
- "@biomejs/biome": "^2.6.6",
72
+ "@biomejs/biome": "^2.6.8",
80
73
  "@chromatic-com/storybook": "5.6.0",
81
- "@storybook/addon-a11y": "^10.6.6",
82
- "@storybook/addon-docs": "^10.6.6",
83
- "@storybook/addon-mcp": "^10.6.6",
74
+ "@hookform/resolvers": "^7.0.7",
75
+ "@storybook/addon-a11y": "^10.6.7",
76
+ "@storybook/addon-docs": "^10.6.7",
77
+ "@storybook/addon-mcp": "^10.6.7",
84
78
  "@storybook/addon-vitest": "^10.6.6",
85
- "@storybook/react-vite": "^10.6.6",
79
+ "@storybook/react-vite": "^10.6.7",
80
+ "@tailwindcss/vite": "^4.3.5",
81
+ "@tanstack/react-query": "^5.107.1",
86
82
  "@testing-library/jest-dom": "^7.0.1",
87
83
  "@testing-library/react": "^16.3.3",
88
- "@testing-library/user-event": "^14.6.7",
84
+ "@testing-library/user-event": "^14.6.12",
89
85
  "@types/node": "^25.9.9",
90
86
  "@types/react": "^19.2.18",
91
87
  "@types/react-dom": "^19.2.7",
92
88
  "@typescript/typescript6": "^6.0.2",
93
- "@vitejs/plugin-react": "^6.1.1",
89
+ "@vitejs/plugin-react": "^6.3.0",
94
90
  "@vitest/browser": "^5.0.5",
95
91
  "@vitest/browser-playwright": "^5.0.5",
96
92
  "@vitest/coverage-v8": "^5.0.5",
97
93
  "@vitest/ui": "^5.0.5",
98
- "chromatic": "^18.14.2",
99
- "i18next-cli": "^1.87.0",
100
- "jsdom": "^31.0.0",
101
- "playwright": "latest",
94
+ "chromatic": "^18.14.4",
95
+ "i18next": "^27.1.3",
96
+ "i18next-browser-languagedetector": "^8.3.0",
97
+ "i18next-cli": "^1.88.1",
98
+ "jsdom": "^31.0.1",
99
+ "playwright": "^1.65.1",
100
+ "react-hook-form": "^7.92.0",
101
+ "react-i18next": "^18.0.2",
102
+ "remark-gfm": "^4.0.1",
102
103
  "shadcn": "^4.23.0",
103
104
  "storybook": "^10.6.6",
105
+ "tailwindcss": "^4.3.3",
104
106
  "typescript": "~7.0.2",
107
+ "unplugin-dts": "^1.1.2",
105
108
  "vite": "^8.3.6",
106
- "vite-plugin-dts": "^5.1.2",
107
- "vitest": "^5.0.5"
109
+ "vitest": "^5.0.5",
110
+ "zod": "^4.6.7"
108
111
  },
109
112
  "allowScripts": {
110
- "esbuild@0.28.2": true
113
+ "esbuild@0.28.2": true,
114
+ "@swc/core@1.16.22": true
111
115
  },
112
116
  "overrides": {
113
117
  "@joshwooding/vite-plugin-react-docgen-typescript": {
@@ -1,8 +0,0 @@
1
- export type WithoutExternalStyle<T, K extends PropertyKey = never> = Omit<T, K | 'className' | 'style'> & {
2
- className?: never;
3
- style?: never;
4
- };
5
- export declare function withoutExternalStyle<T extends {
6
- className?: never;
7
- style?: never;
8
- }>(props: T): Omit<T, "className" | "style">;