wimui 0.2.0 → 0.3.0

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/dist/llms.txt ADDED
@@ -0,0 +1,313 @@
1
+ # WIM UI — LLM guide (llms.txt)
2
+
3
+ > Machine-readable map of the wimui React component library for coding agents. Read this before generating any UI with wimui: it defines the required CSS/setup, the correct import paths, the full component list, and the composition rules that keep screens from looking AI-generated.
4
+
5
+ ## What this is
6
+
7
+ **wimui** v0.3.0 — a React 19 component library: 216 documented components across 10 categories, with design tokens, dark mode, i18n (en/ja/pt-BR) and WAI-ARIA compliant a11y. Peer deps: react ^19, react-dom ^19 (plus optional peers for specific components — see package.json).
8
+
9
+ ## Install & required setup
10
+
11
+ ```bash
12
+ npm i wimui
13
+ ```
14
+
15
+ ```ts
16
+ // 1. CSS contract — styles.css is REQUIRED (design tokens + component styles).
17
+ import "wimui/styles.css";
18
+ import "wimui/reset.css"; // optional base reset
19
+
20
+ // 2. Components — import from the root barrel or a category subpath (tree-shakeable).
21
+ import { Button, Card } from "wimui";
22
+ import { Stack, Grid } from "wimui/layout";
23
+ ```
24
+
25
+ - **Theme**: wrap the app in `WimProvider` (recommended) or set `data-theme="light|dark"` on `<html>` (omit to follow OS).
26
+ - **Density**: `data-density="comfortable|compact"`, or `WimProvider` / `setWimDensity()`.
27
+ - **Never hardcode** colors / spacing / sizes in consumer code — use the `--wim-*` CSS custom properties (tokens) that styles.css defines.
28
+ - **Form + RHF** helpers live in `wimui/rhf` (react-hook-form + zod), not the root barrel.
29
+
30
+ ## Import paths
31
+
32
+ Every component works from the root barrel `"wimui"`. For smaller bundles, import from its category subpath instead:
33
+
34
+ - `wimui/layout`
35
+ - `wimui/form`
36
+ - `wimui/feedback`
37
+ - `wimui/navigation`
38
+ - `wimui/data-display`
39
+ - `wimui/overlay`
40
+ - `wimui/typography`
41
+ - `wimui/media`
42
+ - `wimui/charts`
43
+ - `wimui/ai`
44
+
45
+ ## Composition rules — build screens that don't look AI-generated
46
+
47
+ Single components are judged by state/a11y/token compliance. **Composed screens** are judged by hierarchy, rhythm, asymmetry and real-feeling content. Apply these whenever combining components into a screen, page, pattern or demo.
48
+
49
+ **Before laying out**: pick exactly ONE visual protagonist for the screen. If every element has the same volume, it reads as AI-generated.
50
+
51
+ **Banned patterns (the "AI signature" — do not emit):**
52
+ - `linear-gradient(135deg, …)` hero backgrounds → use surface-hierarchy tokens (`surface` / `surface-raised`) to separate planes.
53
+ - The stock hero (badge → big heading → subtext → two solid/outline buttons) → asymmetric composition led by one protagonist.
54
+ - "Rule of three" equal feature cards (icon + short heading + one line, ×3) → let the count follow content (2 or 5 is fine); vary card size and copy length.
55
+ - Emoji used as UI icons (☰ ★ ✓) → use `src/icon/` components. (Emoji as functional markers in docs/README is fine; as UI icons it is not.)
56
+ - Skeleton used as anything but loading (fake screenshots) → real-looking content or an actual mini UI.
57
+ - Every section center-aligned → default to left-aligned; at most one centered section per page.
58
+ - Round numbers ("1000+", "99%") + generic copy ("Get started", "seamless/powerful/effortless") → jagged realistic numbers (4,281) and product-specific voice.
59
+ - Sequential/alphabetical dummy names (Alice/Bob/Charlie, User 1/2) → culturally diverse, unordered, real-feeling names.
60
+ - Rainbow color-per-category → color carries state only (success/warning/danger); everything else neutral.
61
+ - Perfectly even grids (2×2, 3×3 all same size) → break the grid (span the protagonist cell, size differences, hero+sidebar asymmetry).
62
+ - Filling every slot / uniform gaps everywhere → leave whitespace; group by proximity (tight within a group, loose between groups).
63
+
64
+ **Must rules:**
65
+ 1. One visual protagonist per screen (jump in size/weight/color creates the entry point).
66
+ 2. Contrast density: hero/showcase sparse, data regions (tables/lists) dense. Uniform "medium density" reads as AI.
67
+ 3. Never override a component's defaults via inline `style` (`padding:0`, `borderRadius:0`). Add a prop/token instead.
68
+ 4. Never hardcode gap/padding/size — use `--wim-spacing-*` tokens.
69
+ 5. Keep one radius stance per screen (`radius.component` / `radius.container` / `radius.overlay`); don't mix 0 and lg arbitrarily.
70
+ 6. Limit accent color: primary surfaces (solid buttons, emphasis backgrounds) 1–2 per view.
71
+ 7. Give demo content real substance (product-context copy, internally consistent numbers/dates/names — active ≤ total, dates not evenly spaced).
72
+ 8. Add intentional "wobble": mix in 1–2 incomplete rows (a truncated long name, a missing optional field, an extreme value, an error/unread state) and show non-happy-path states (hover/focus/disabled/error/empty/loading).
73
+
74
+ ## Components
75
+
76
+ ### layout — `import { … } from "wimui/layout"`
77
+
78
+ - **AppShell** — Basic application shell layout
79
+ - **AspectRatio** — Fixed ratio container
80
+ - **BentoGrid** — Modern card grid
81
+ - **Box** — Polymorphic box
82
+ - **Center** — Radial centering
83
+ - **Container** — Layout wrapper
84
+ - **Dashboard** — Arranges widgets in a configurable grid with an edit mode for adding, removing, and resizing them.
85
+ - **Divider** — Content separator
86
+ - **Flex** — Flexible layout
87
+ - **Footer** — Lower navigation
88
+ - **Grid** — Flexbox or CSS Grid system
89
+ - **Group** — Flexible grouping
90
+ - **Header** — Upper navigation
91
+ - **InteractiveArea** — Interactive empty/drop zone area
92
+ - **Masonry** — Waterfall grid
93
+ - **Navbar** — Primary navigation
94
+ - **ScrollArea** — A custom scrollbar component that provides high-performance, cross-browser consistent themes while maintaining a native-like feel.
95
+ - **Sidebar** — A collapsible navigation or informational panel on the side of the screen
96
+ - **SimpleGrid** — Responsive fixed grid
97
+ - **Splitter** — Split and resize panels
98
+ - **Stack** — Vertical/Horizontal alignment
99
+ - **Toolbar** — Action strip for IconButton, ToggleGroup, and related controls with toolbar keyboard navigation.
100
+ - **Transition** — Utilities for managing smooth enter and leave animations with CSS classes
101
+ - **VisuallyHidden** — Hide content visually while keeping it accessible to screen readers
102
+ - **Watermark** — Translucent text or images overlaid on content to indicate ownership or status
103
+
104
+ ### form — `import { … } from "wimui/form"`
105
+
106
+ - **Button** — Action triggers
107
+ - **ButtonGroup** — Group of buttons
108
+ - **Cascader** — Hierarchical selection
109
+ - **Checkbox** — Multiple choice
110
+ - **CheckboxGroup** — Shared state checkboxes
111
+ - **ColorInput** — Input with color preview
112
+ - **ColorPicker** — Color selection picker
113
+ - **Combobox** — Select with search
114
+ - **CopyButton** — Copy to clipboard
115
+ - **CounterTextarea** — Textarea with character count display
116
+ - **CreditCardInput** — Payment card input with brand detection
117
+ - **DatePicker** — Date selection
118
+ - **DateRangePicker** — Date range selection
119
+ - **Dropzone** — Drag & drop files
120
+ - **FieldError** — Validation messages
121
+ - **Fieldset** — Form grouping
122
+ - **FieldTemplate** — Standardizes label placement, required markings, and error message display for all form-related components.
123
+ - **FileUpload** — File selection
124
+ - **FloatButton** — Floating action buttons
125
+ - **IconButton** — Icon-only button
126
+ - **ImageCropper** — Front-end image crop and rotate tool
127
+ - **InlineEdit** — A component that allows users to switch between a view-only mode and an editable mode in-place.
128
+ - **Input** — Single-line input fields for text, numbers, or emails
129
+ - **InputBase** — Standardizes the visual container, icon slots (Prefix/Suffix), and clear button behavior for text-based inputs.
130
+ - **InputGroup** — Inputs with icons/labels
131
+ - **InputMask** — Formatted inputs
132
+ - **LinkButton** — Anchor styled as button
133
+ - **Mentions** — @ / # suggestions
134
+ - **MultiSelect** — Multiple selection
135
+ - **NumberInput** — Input with step adjustments
136
+ - **OtpInput** — One-time password fields
137
+ - **PasswordInput** — Password with toggle
138
+ - **PasswordStrength** — Visual meter to indicate password security level
139
+ - **PhoneInput** — International phone number input
140
+ - **QueryBuilder** — Visual builder for constructing complex search queries.
141
+ - **Radio** — Single choice
142
+ - **RadioGroup** — Shared state radio buttons
143
+ - **RangeSlider** — Range selection
144
+ - **Rating** — Star rating
145
+ - **RichTextEditor** — WYSIWYG rich text editor
146
+ - **SearchInput** — Search with clear button
147
+ - **SegmentedControl** — Button-style controls for switching between a small set of mutually exclusive options
148
+ - **Select** — A dropdown menu for selecting one option from a predefined list
149
+ - **SignaturePad** — Handwritten signature input
150
+ - **Slider** — An input to capture a numeric value from a specified range by dragging a knob
151
+ - **SmartSearchInput** — Smart search input enabling both traditional search and AI prompting.
152
+ - **Switch** — A binary switch for instantly toggling settings between on and off states
153
+ - **SwitchGroup** — Shared state switches
154
+ - **TagInput** — Field for entering free-form text as tags
155
+ - **Textarea** — Multi-line input fields for longer text entries like descriptions or comments
156
+ - **ThemeToggle** — Light / dark / system theme switcher
157
+ - **TimePicker** — Time selection
158
+ - **ToggleGroup** — Toggleable buttons
159
+ - **Transfer** — Move items between lists
160
+ - **TreeSelect** — Select from tree structure
161
+
162
+ ### feedback — `import { … } from "wimui/feedback"`
163
+
164
+ - **Alert** — Important messages
165
+ - **Autosave** — Inline status indicator for automatic save state
166
+ - **Banner** — Top prominent messages
167
+ - **ErrorBoundary** — Runtime error fallback
168
+ - **Indicator** — Small status dots
169
+ - **Loader** — Animated indicators to show that data is loading or processing
170
+ - **LoadingOverlay** — Overlay with loading indicator
171
+ - **Notification** — Rich notification card
172
+ - **Progress** — Progress bar
173
+ - **Result** — Task status indicator
174
+ - **ScrollProgress** — Reading progress indicator
175
+ - **Skeleton** — Placeholder for content loading states.
176
+ - **Snackbar** — Bottom notifications
177
+ - **Spinner** — A rotating icon indicating background activity or data fetching
178
+ - **Toast** — Non-intrusive floating messages that provide feedback on system operations
179
+ - **Tour** — Sequential guided walkthroughs to onboard users or highlight features
180
+
181
+ ### navigation — `import { … } from "wimui/navigation"`
182
+
183
+ - **Affix** — Sticky elements
184
+ - **Anchor** — Smooth scroll links
185
+ - **BackTop** — Back to top button
186
+ - **Breadcrumb** — Location trace
187
+ - **CommandPalette** — Cmd+K search overlay
188
+ - **HamburgerMenu** — Toggleable menu
189
+ - **KeyboardShortcuts** — Display a structured list of keyboard shortcuts
190
+ - **Link** — Hyperlinks
191
+ - **Menubar** — Desktop-style application menu bar with floating File / Edit / View submenus.
192
+ - **Pagination** — Multi-page navigation
193
+ - **SpeedDial** — Floating action button that expands sub-actions on hover or click.
194
+ - **Stepper** — Visual sequence steps
195
+ - **TabBar** — Mobile bottom navigation
196
+ - **TabNavigation** — Tab-based navigation
197
+ - **Tabs** — A container to organize related content into switchable view panels
198
+
199
+ ### data-display — `import { … } from "wimui/data-display"`
200
+
201
+ - **Accordion** — Collapsible panels
202
+ - **Avatar** — Profile initials/pics
203
+ - **AvatarGroup** — Stacked avatars
204
+ - **Badge** — Indicators or counts
205
+ - **Calendar** — Calendar view
206
+ - **CalendarHeatmap** — GitHub-style activity graph for visualizing continuity
207
+ - **Card** — Information containers
208
+ - **Carousel** — Content slideshow
209
+ - **Chip** — Filter/Selection tokens
210
+ - **Countdown** — Display the remaining time until a target moment as a live ticking timer, for sale deadlines, OTP resend waits, and maintenance notices.
211
+ - **DataGrid** — Advanced data table and manipulation
212
+ - **DescriptionList** — Key-value pairs
213
+ - **EmptyState** — Missing data placeholder
214
+ - **FAQSection** — Frequently Asked Questions section
215
+ - **InfiniteScroll** — Infinite scroll control
216
+ - **JsonDiffViewer** — Compares two JSON values as a formatted side-by-side or unified diff, built on top of CodeDiffViewer.
217
+ - **JsonViewer** — Recursive tree viewer and editor for JSON data.
218
+ - **Kanban** — Drag-and-drop board for visualizing workflow stages
219
+ - **Leaderboard** — Display a ranked list of entries with scores and medal highlights for the top three positions.
220
+ - **List** — Structurally organized items in bullet points or numbered formats
221
+ - **Markdown** — A component for safely rendering text in Markdown format.
222
+ - **Marquee** — Scrolling text animation
223
+ - **NodeGraph** — Interactive node-based flowchart and pipeline editor
224
+ - **PullToRefresh** — Pull-to-refresh utility for enhancing mobile user experience.
225
+ - **QRCode** — QR generator
226
+ - **RangeCalendar** — Range calendar view
227
+ - **Reaction** — Display emoji reaction buttons with toggleable state and counts
228
+ - **RelativeTime** — Display a timestamp as a localized relative phrase ("3 minutes ago", "yesterday") that updates automatically as time passes.
229
+ - **ScheduleView** — Time-grid calendar with drag-and-drop scheduling
230
+ - **SortableList** — Item rearrangement and reordering
231
+ - **Stats** — A component to highlight key performance indicators and metrics
232
+ - **SwipeAction** — Mobile-friendly swipe actions (delete, archive) for list items.
233
+ - **Table** — Rows and columns for displaying structured data efficiently
234
+ - **Tag** — Compact visual descriptors used for labeling or categorizing content
235
+ - **Timeline** — A vertical list mapping events or history in chronological order
236
+ - **TreeView** — Hierarchical data
237
+ - **VirtualList** — Efficiently renders large lists by virtualizing off-screen items
238
+
239
+ ### overlay — `import { … } from "wimui/overlay"`
240
+
241
+ - **BottomSheet** — Mobile bottom overlay
242
+ - **ContextMenu** — Right-click menus
243
+ - **Dialog** — Focused task windows
244
+ - **Drawer** — Slide-out detail panels
245
+ - **Dropdown** — Overlay selection menu
246
+ - **FocusTrap** — Focus management
247
+ - **HoverCard** — Rich content on hover
248
+ - **Menu** — General menus
249
+ - **Popconfirm** — Confirmation overlay
250
+ - **Popover** — Contextual overlay
251
+ - **Portal** — Out-of-hierarchy render
252
+ - **Tooltip** — Information on hover
253
+
254
+ ### typography — `import { … } from "wimui/typography"`
255
+
256
+ - **Blockquote** — Visually separates external quotes or text to be emphasized.
257
+ - **Code** — Code snippets
258
+ - **Highlight** — Text highlighting
259
+ - **Kbd** — Keyboard shortcuts
260
+ - **Label** — Descriptive text for input fields, including required/optional marks
261
+ - **Legend** — Group title
262
+ - **Span** — Lightweight wrapper for inline text or short labels with icon support
263
+ - **Spoiler** — Collapse long text such as reviews and comments to a fixed number of lines, with an accessible "show more" toggle that appears only when the text overflows.
264
+ - **Text** — Has appropriate line-height and spacing to ensure readability of long text.
265
+ - **Title** — Possesses visual weight (boldness/size) to indicate page structure.
266
+
267
+ ### media — `import { … } from "wimui/media"`
268
+
269
+ - **Audio** — Audio playback
270
+ - **Gallery** — Displays a responsive image grid with configurable columns, aspect ratios, multi-select, and an optional lightbox.
271
+ - **Icon** — Visual symbols
272
+ - **Image** — Image content
273
+ - **ImageCompare** — ImageCompare overlays two images and reveals them with a draggable divider — a before/after slider for comparing edits, restorations, or AI-generated results against their source.
274
+ - **Lightbox** — A high-quality overlay component for displaying images and media with gallery and zoom functionality.
275
+ - **Video** — A component for embedding and controlling local or remote video content
276
+
277
+ ### charts — `import { … } from "wimui/charts"`
278
+
279
+ - **AreaChart** — Area charts
280
+ - **BarChart** — Bar charts
281
+ - **FunnelChart** — Process stage abandonment chart
282
+ - **GanttChart** — Project schedule and timeline visualization
283
+ - **GaugeChart** — KPI goal achievement chart
284
+ - **Heatmap** — Graphical representation of data where individual values are contained in a matrix as colors.
285
+ - **LineChart** — Line charts
286
+ - **PieChart** — Proportional parts of a whole chart
287
+ - **RadarChart** — Multivariate data on concentric axes chart
288
+ - **ScatterChart** — Scatter plots
289
+ - **Sparkline** — Tiny inline trend chart
290
+ - **Treemap** — Hierarchical data area-based display
291
+
292
+ ### ai — `import { … } from "wimui/ai"`
293
+
294
+ - **AgentStatus** — Real-time agent state indicator (thinking / running / waiting)
295
+ - **AIResponseFeedback** — Thumbs-up/down feedback controls and regenerate button for AI responses.
296
+ - **ArtifactsOverlay** — ArtifactsOverlay is a specialized side-panel for displaying large AI-generated content (Artifacts) without interrupting the main chat context.
297
+ - **ChatUI** — A comprehensive set of components for building chat interfaces with support for messages, avatars, timestamps, and interactive input.
298
+ - **CodeBlock** — Syntax-highlighted code block with copy button, line numbers, and collapsible overflow.
299
+ - **CodeDiffViewer** — Displays code changes as a side-by-side or unified diff, with line-level highlighting and Apply/Reject actions.
300
+ - **InteractiveGraph** — InteractiveGraph provides a canvas for visualizing node-based data. Ideal for RAG knowledge bases, agent workflows, or state machines.
301
+ - **MarkdownRenderer** — MarkdownRenderer converts a markdown string into WIM UI components. It uses react-markdown under the hood and applies WIM's typography system.
302
+ - **ModelSelector** — ModelSelector is a dropdown for switching between AI models, surfacing the metadata that matters when choosing one — context window size and per-token pricing.
303
+ - **PromptInput** — Auto-resizing prompt input with send and attachment actions
304
+ - **SourceCitation** — Displays cited sources with title, domain, and external link for AI-generated content.
305
+ - **StreamingText** — Streaming Markdown renderer for AI-generated responses
306
+ - **Terminal** — Renders terminal-style output with ANSI color support, prompt prefixes, and copy/clear controls.
307
+ - **ThoughtProcess** — Visualizes AI reasoning steps and execution states in a timeline format.
308
+ - **ThreadList** — ThreadList renders a conversation-history sidebar for AI chat apps — a scrollable list of past threads with an optional new-conversation action and per-thread deletion.
309
+ - **UsageMeter** — UsageMeter (also exported as TokenCounter) visualizes token consumption against a budget such as a model's context window — a labeled bar plus a numeric readout that shifts to warning and danger colors near the limit.
310
+ - **VoiceVisualizer** — Animated voice-level indicator (bars / waveform)
311
+
312
+ ---
313
+ For per-component props, types and defaults, see `llms-full.txt`.