wimui 0.3.0 → 0.5.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/README.md +3 -3
- package/dist/WimProvider.cjs +1 -1
- package/dist/WimProvider.d.ts +9 -2
- package/dist/WimProvider.js +27 -21
- package/dist/components/data-display/Badge/badge.module.cjs +1 -1
- package/dist/components/data-display/Badge/badge.module.js +1 -1
- package/dist/components/data-display/Chip/chip.module.cjs +1 -1
- package/dist/components/data-display/Chip/chip.module.js +2 -2
- package/dist/components/data-display/DataGrid/DataGrid.cjs +1 -1
- package/dist/components/data-display/DataGrid/DataGrid.js +3 -0
- package/dist/components/data-display/Tag/tag.module.cjs +1 -1
- package/dist/components/data-display/Tag/tag.module.js +1 -1
- package/dist/components/layout/BentoGrid/BentoGrid.cjs +1 -1
- package/dist/components/layout/BentoGrid/BentoGrid.d.ts +3 -1
- package/dist/components/layout/BentoGrid/BentoGrid.js +6 -2
- package/dist/components/layout/BentoGrid/bento-grid.module.cjs +1 -1
- package/dist/components/layout/BentoGrid/bento-grid.module.js +1 -1
- package/dist/components/layout/Navbar/Navbar.cjs +1 -1
- package/dist/components/layout/Navbar/Navbar.d.ts +2 -0
- package/dist/components/layout/Navbar/Navbar.js +7 -7
- package/dist/components/layout/Navbar/navbar.module.cjs +1 -1
- package/dist/components/layout/Navbar/navbar.module.js +15 -14
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -2
- package/dist/llms-full.txt +531 -2
- package/dist/llms.txt +109 -2
- package/dist/preset.cjs +2 -0
- package/dist/preset.d.ts +11 -0
- package/dist/preset.js +16 -0
- package/dist/rhf/zod.d.ts +1 -1
- package/dist/styles.css +2 -2
- package/dist/tokens/generated/presets.cjs +2 -0
- package/dist/tokens/generated/presets.d.ts +19 -0
- package/dist/tokens/generated/presets.js +21 -0
- package/dist/wimui.umd.css +1 -1
- package/dist/wimui.umd.js +2 -2
- package/package.json +7 -4
package/dist/llms.txt
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## What this is
|
|
6
6
|
|
|
7
|
-
**wimui** v0.
|
|
7
|
+
**wimui** v0.5.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
8
|
|
|
9
9
|
## Install & required setup
|
|
10
10
|
|
|
@@ -55,12 +55,17 @@ Single components are judged by state/a11y/token compliance. **Composed screens*
|
|
|
55
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
56
|
- Skeleton used as anything but loading (fake screenshots) → real-looking content or an actual mini UI.
|
|
57
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"
|
|
58
|
+
- Round numbers ("1000+", "99%") + generic copy ("Get started") → jagged realistic numbers (4,281) and product-specific voice.
|
|
59
59
|
- Sequential/alphabetical dummy names (Alice/Bob/Charlie, User 1/2) → culturally diverse, unordered, real-feeling names.
|
|
60
60
|
- Rainbow color-per-category → color carries state only (success/warning/danger); everything else neutral.
|
|
61
61
|
- Perfectly even grids (2×2, 3×3 all same size) → break the grid (span the protagonist cell, size differences, hero+sidebar asymmetry).
|
|
62
62
|
- Filling every slot / uniform gaps everywhere → leave whitespace; group by proximity (tight within a group, loose between groups).
|
|
63
63
|
|
|
64
|
+
**Machine-enforced banned vocabulary** (a linter, `check:slop`, fails builds that use these in demo copy — say concrete actions/numbers instead):
|
|
65
|
+
- Hype adjectives/verbs: seamless, powerful, effortless, cutting-edge, next-gen, next-generation, revolutionary, game-changing, state-of-the-art, world-class, best-in-class, unparalleled, lightning-fast, blazing-fast, supercharge, innovative, disruptive, harness, leverage, elevate, empower, reimagine, unleash, delight, magical, 圧倒的, 革新的, 次世代, 究極, 最先端.
|
|
66
|
+
- Hype phrases: "in today's digital landscape", "built for the modern team", "supercharge your", "unleash your", "reimagine the way", "experience the power of", "innovative solutions".
|
|
67
|
+
- Stock placeholder names: John Doe, Jane Doe, John Smith, Jane Smith, Lorem Ipsum, Example User, Acme (a realistic example name in an input placeholder is fine).
|
|
68
|
+
|
|
64
69
|
**Must rules:**
|
|
65
70
|
1. One visual protagonist per screen (jump in size/weight/color creates the entry point).
|
|
66
71
|
2. Contrast density: hero/showcase sparse, data regions (tables/lists) dense. Uniform "medium density" reads as AI.
|
|
@@ -71,6 +76,108 @@ Single components are judged by state/a11y/token compliance. **Composed screens*
|
|
|
71
76
|
7. Give demo content real substance (product-context copy, internally consistent numbers/dates/names — active ≤ total, dates not evenly spaced).
|
|
72
77
|
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
78
|
|
|
79
|
+
## Recipes — copy-paste starting points
|
|
80
|
+
|
|
81
|
+
### 1. Required setup (the contract)
|
|
82
|
+
|
|
83
|
+
Without `styles.css` nothing is styled — this is the one step Storybook hides from you. Import it once at the app entry, wrap the tree in `WimProvider`, then build screens inside.
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
// main.tsx — app entry
|
|
87
|
+
import { createRoot } from "react-dom/client";
|
|
88
|
+
import "wimui/styles.css"; // REQUIRED: design tokens + component styles
|
|
89
|
+
import "wimui/reset.css"; // optional base reset
|
|
90
|
+
import { WimProvider } from "wimui";
|
|
91
|
+
import { App } from "./App";
|
|
92
|
+
|
|
93
|
+
// theme: "light" | "dark" | "system" (default). density: "comfortable" | "compact".
|
|
94
|
+
createRoot(document.getElementById("root")!).render(
|
|
95
|
+
<WimProvider theme="system" density="comfortable">
|
|
96
|
+
<App />
|
|
97
|
+
</WimProvider>,
|
|
98
|
+
);
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
// App.tsx — app frame. AppShell wires header/sidebar; page content is children.
|
|
103
|
+
import { AppShell, Header, Sidebar, Stack, Title, Text, Button } from "wimui";
|
|
104
|
+
|
|
105
|
+
export function App() {
|
|
106
|
+
return (
|
|
107
|
+
<AppShell
|
|
108
|
+
header={<Header sticky bordered><Title tag="h1" size="md">Larkfield</Title></Header>}
|
|
109
|
+
sidebar={
|
|
110
|
+
<Sidebar width={240}>
|
|
111
|
+
<Stack gap="2xs" p="md">
|
|
112
|
+
<Button variant="ghost" justify="start" fullWidth>Overview</Button>
|
|
113
|
+
<Button variant="ghost" justify="start" fullWidth>Customers</Button>
|
|
114
|
+
<Button variant="ghost" justify="start" fullWidth>Settings</Button>
|
|
115
|
+
</Stack>
|
|
116
|
+
</Sidebar>
|
|
117
|
+
}
|
|
118
|
+
>
|
|
119
|
+
<Stack gap="lg">
|
|
120
|
+
<Title tag="h2" size="lg">Overview</Title>
|
|
121
|
+
<Text color="secondary">Spacing/size/color come from --wim-* tokens via props — never hardcode px/hex.</Text>
|
|
122
|
+
</Stack>
|
|
123
|
+
</AppShell>
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### 2. A composed content screen
|
|
129
|
+
|
|
130
|
+
One protagonist (the KPI row), a dense table below, tokens via props, jagged real data, and one deliberately incomplete row. Note the compound components (`Stats.Value`, `Table.Head`) and that `Grid` uses `cols` (not `columns`).
|
|
131
|
+
|
|
132
|
+
```tsx
|
|
133
|
+
import { Stack, Grid, Card, Stats, Table, Badge, Title, Text } from "wimui";
|
|
134
|
+
|
|
135
|
+
const rows = [
|
|
136
|
+
{ id: "in_9f2a", name: "Marisol Okonkwo", plan: "Scale", amount: "$4,610.50", status: "paid" },
|
|
137
|
+
{ id: "in_7b41", name: "Dmitri Sørensen", plan: "Enterprise", amount: "$12,199.00", status: "failed" },
|
|
138
|
+
{ id: "in_2a90", name: "Thomas O'Reilly", plan: null, amount: "$89.00", status: "pending" }, // incomplete row
|
|
139
|
+
];
|
|
140
|
+
const intent = { paid: "success", failed: "danger", pending: undefined } as const;
|
|
141
|
+
|
|
142
|
+
export function BillingOverview() {
|
|
143
|
+
return (
|
|
144
|
+
<Stack gap="lg">
|
|
145
|
+
<Title tag="h2" size="lg">Billing</Title>
|
|
146
|
+
|
|
147
|
+
{/* Protagonist: KPI row. Uneven content per tile — not three clones. */}
|
|
148
|
+
<Grid cols={{ base: 1, sm: 2, lg: 3 }} gap="md">
|
|
149
|
+
<Stats><Stats.Label>MRR</Stats.Label><Stats.Value>$48,210</Stats.Value><Stats.Trend>+6.4%</Stats.Trend></Stats>
|
|
150
|
+
<Stats><Stats.Label>Active workspaces</Stats.Label><Stats.Value>1,204</Stats.Value><Stats.Description>176 idle over 30 days</Stats.Description></Stats>
|
|
151
|
+
<Stats><Stats.Label>Failed webhooks</Stats.Label><Stats.Value>137</Stats.Value><Stats.Trend>+23 today</Stats.Trend></Stats>
|
|
152
|
+
</Grid>
|
|
153
|
+
|
|
154
|
+
{/* Dense data region */}
|
|
155
|
+
<Card padding="none">
|
|
156
|
+
<Table hoverable fullWidth>
|
|
157
|
+
<Table.Header>
|
|
158
|
+
<Table.Row>
|
|
159
|
+
<Table.Head>Customer</Table.Head><Table.Head>Plan</Table.Head>
|
|
160
|
+
<Table.Head>Amount</Table.Head><Table.Head>Status</Table.Head>
|
|
161
|
+
</Table.Row>
|
|
162
|
+
</Table.Header>
|
|
163
|
+
<Table.Body>
|
|
164
|
+
{rows.map((r) => (
|
|
165
|
+
<Table.Row key={r.id}>
|
|
166
|
+
<Table.Cell>{r.name}</Table.Cell>
|
|
167
|
+
<Table.Cell>{r.plan ?? <Text color="tertiary">—</Text>}</Table.Cell>
|
|
168
|
+
<Table.Cell>{r.amount}</Table.Cell>
|
|
169
|
+
<Table.Cell><Badge variant="subtle" intent={intent[r.status]}>{r.status}</Badge></Table.Cell>
|
|
170
|
+
</Table.Row>
|
|
171
|
+
))}
|
|
172
|
+
</Table.Body>
|
|
173
|
+
</Table>
|
|
174
|
+
</Card>
|
|
175
|
+
</Stack>
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
> More verified full-screen recipes (auth sign-in, settings form, empty state, filtered data table, onboarding) and per-category idioms (form, navigation, feedback, overlay) are in `llms-full.txt`.
|
|
74
181
|
## Components
|
|
75
182
|
|
|
76
183
|
### layout — `import { … } from "wimui/layout"`
|
package/dist/preset.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const e=require("./tokens/generated/presets.cjs");var t=`data-wim-preset`,n=new Set(e.WIM_PRESETS.map(e=>e.name));function r(e=void 0){if(typeof document>`u`)return`none`;let r=(e??document.documentElement).getAttribute?.(t);return r&&n.has(r)?r:`none`}function i(e,r=void 0){if(typeof document>`u`)return;let i=r??document.documentElement;e===`none`||!n.has(e)?i.removeAttribute(t):i.setAttribute(t,e)}exports.WIM_PRESETS=e.WIM_PRESETS,exports.getWimPreset=r,exports.setWimPreset=i;
|
package/dist/preset.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WIM_PRESETS, WimPresetName } from './tokens/generated/presets';
|
|
2
|
+
export { WIM_PRESETS };
|
|
3
|
+
export type { WimPresetName };
|
|
4
|
+
/** A preset name, or `none` for the default (no preset). */
|
|
5
|
+
export type WimPreset = WimPresetName | "none";
|
|
6
|
+
export declare function getWimPreset(root?: ParentNode | null | undefined): WimPreset;
|
|
7
|
+
/**
|
|
8
|
+
* Apply a preset to an element (defaults to `document.documentElement`).
|
|
9
|
+
* `none` (or an unknown name) removes the attribute.
|
|
10
|
+
*/
|
|
11
|
+
export declare function setWimPreset(preset: WimPreset, root?: Element | null | undefined): void;
|
package/dist/preset.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { WIM_PRESETS as e } from "./tokens/generated/presets.js";
|
|
3
|
+
//#region src/preset.ts
|
|
4
|
+
var t = "data-wim-preset", n = new Set(e.map((e) => e.name));
|
|
5
|
+
function r(e = void 0) {
|
|
6
|
+
if (typeof document > "u") return "none";
|
|
7
|
+
let r = (e ?? document.documentElement).getAttribute?.(t);
|
|
8
|
+
return r && n.has(r) ? r : "none";
|
|
9
|
+
}
|
|
10
|
+
function i(e, r = void 0) {
|
|
11
|
+
if (typeof document > "u") return;
|
|
12
|
+
let i = r ?? document.documentElement;
|
|
13
|
+
e === "none" || !n.has(e) ? i.removeAttribute(t) : i.setAttribute(t, e);
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { e as WIM_PRESETS, r as getWimPreset, i as setWimPreset };
|
package/dist/rhf/zod.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Re-export `@hookform/resolvers/zod` so apps can wire zod schemas without an extra import path.
|
|
3
|
-
* Requires optional peers: `zod` (^4), `@hookform/resolvers` (^5.1), `react-hook-form` (^7.43).
|
|
3
|
+
* Requires optional peers: `zod` (^3.25 || ^4), `@hookform/resolvers` (^5.1), `react-hook-form` (^7.43).
|
|
4
4
|
* See README「サポート行列(peer)」.
|
|
5
5
|
*/
|
|
6
6
|
export { zodResolver } from '@hookform/resolvers/zod';
|