wimui 0.29.10 → 0.31.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.ja.md +11 -10
- package/README.md +10 -7
- package/dist/components/_internal/IndicatorBase.cjs +1 -1
- package/dist/components/_internal/IndicatorBase.d.ts +1 -1
- package/dist/components/_internal/IndicatorBase.js +1 -1
- package/dist/components/_internal/StatusContent.cjs +1 -1
- package/dist/components/_internal/StatusContent.d.ts +9 -2
- package/dist/components/_internal/StatusContent.js +4 -2
- package/dist/components/_internal/status-content.module.cjs +1 -1
- package/dist/components/_internal/status-content.module.js +11 -9
- package/dist/components/data-display/Card/Card.cjs +1 -1
- package/dist/components/data-display/Card/Card.js +1 -1
- package/dist/components/data-display/Carousel/Carousel.cjs +1 -1
- package/dist/components/data-display/Carousel/Carousel.d.ts +6 -0
- package/dist/components/data-display/Carousel/Carousel.js +92 -92
- package/dist/components/data-display/Carousel/carousel.module.cjs +1 -1
- package/dist/components/data-display/Carousel/carousel.module.js +14 -13
- package/dist/components/data-display/Chip/Chip.cjs +1 -1
- package/dist/components/data-display/Chip/Chip.js +1 -1
- package/dist/components/data-display/EmptyState/EmptyState.cjs +1 -1
- package/dist/components/data-display/EmptyState/EmptyState.d.ts +7 -1
- package/dist/components/data-display/EmptyState/EmptyState.js +4 -3
- package/dist/components/data-display/Marquee/Marquee.cjs +1 -1
- package/dist/components/data-display/Marquee/Marquee.d.ts +4 -1
- package/dist/components/data-display/Marquee/Marquee.js +4 -2
- package/dist/components/data-display/Marquee/marquee.module.cjs +1 -1
- package/dist/components/data-display/Marquee/marquee.module.js +1 -1
- package/dist/components/data-display/Stats/Stats.cjs +1 -1
- package/dist/components/data-display/Stats/Stats.d.ts +14 -3
- package/dist/components/data-display/Stats/Stats.js +13 -7
- package/dist/components/data-display/Stats/stats.module.cjs +1 -1
- package/dist/components/data-display/Stats/stats.module.js +4 -4
- package/dist/components/feedback/Skeleton/skeleton.module.cjs +1 -1
- package/dist/components/feedback/Skeleton/skeleton.module.js +3 -3
- package/dist/components/form/RichTextEditor/commands.d.ts +1 -1
- package/dist/components/layout/BentoGrid/BentoGrid.cjs +1 -1
- package/dist/components/layout/BentoGrid/BentoGrid.d.ts +12 -1
- package/dist/components/layout/BentoGrid/BentoGrid.js +3 -3
- package/dist/components/layout/BentoGrid/bento-grid.module.cjs +1 -1
- package/dist/components/layout/BentoGrid/bento-grid.module.js +6 -1
- package/dist/components/media/Audio/audio.module.cjs +1 -1
- package/dist/components/media/Audio/audio.module.js +2 -2
- package/dist/components/overlay/Dropdown/Dropdown.cjs +1 -1
- package/dist/components/overlay/Dropdown/Dropdown.d.ts +14 -0
- package/dist/components/overlay/Dropdown/Dropdown.js +99 -93
- package/dist/llms-full.txt +31 -8
- package/dist/llms.txt +15 -4
- package/dist/styles.css +2 -2
- package/dist/wimui.umd.css +1 -1
- package/dist/wimui.umd.js +5 -5
- package/package.json +60 -24
|
@@ -4,12 +4,12 @@ import { Transition as n } from "../../layout/Transition/Transition.js";
|
|
|
4
4
|
import { BaseListItem as r } from "../../_internal/BaseListItem/BaseListItem.js";
|
|
5
5
|
import { mergeRefs as i } from "../../_internal/mergeRefs.js";
|
|
6
6
|
import a from "./dropdown.module.js";
|
|
7
|
-
import o, { forwardRef as s,
|
|
8
|
-
import
|
|
9
|
-
import { jsx as
|
|
10
|
-
import { FloatingPortal as
|
|
7
|
+
import o, { forwardRef as s, useCallback as c, useEffect as l, useId as u, useRef as d, useState as f } from "react";
|
|
8
|
+
import p from "classnames";
|
|
9
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
10
|
+
import { FloatingPortal as h, autoUpdate as g, flip as _, offset as v, shift as y, useFloating as b } from "@floating-ui/react";
|
|
11
11
|
//#region src/components/overlay/Dropdown/Dropdown.tsx
|
|
12
|
-
var
|
|
12
|
+
var x = o.createContext({
|
|
13
13
|
isOpen: !1,
|
|
14
14
|
toggle: () => {},
|
|
15
15
|
close: () => {},
|
|
@@ -24,150 +24,156 @@ var b = o.createContext({
|
|
|
24
24
|
floatingStyles: {},
|
|
25
25
|
floatingRef: { current: null },
|
|
26
26
|
setAlign: () => {}
|
|
27
|
-
}),
|
|
28
|
-
let [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
}), S = s(({ children: n, className: r, asChild: o = !1, defaultOpen: s = !1, open: h, onOpenChange: S, ...C }, w) => {
|
|
28
|
+
let [T, E] = f(s), D = h ?? T, O = c((e) => {
|
|
29
|
+
h === void 0 && E(e), S?.(e);
|
|
30
|
+
}, [h, S]), [k, A] = f(-1), j = d(null), M = d(0), [N, P] = f("left"), { refs: F, floatingStyles: I } = b({
|
|
31
|
+
open: D,
|
|
32
|
+
placement: N === "right" ? "bottom-end" : "bottom-start",
|
|
33
|
+
whileElementsMounted: g,
|
|
32
34
|
middleware: [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
v(4),
|
|
36
|
+
_(),
|
|
37
|
+
y({ padding: 8 })
|
|
36
38
|
]
|
|
37
|
-
}),
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
}), L = i(j, w);
|
|
40
|
+
l(() => {
|
|
41
|
+
M.current = 0;
|
|
40
42
|
});
|
|
41
|
-
let
|
|
42
|
-
let e =
|
|
43
|
-
return
|
|
44
|
-
},
|
|
45
|
-
let e = !
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
};
|
|
50
|
-
|
|
43
|
+
let R = () => {
|
|
44
|
+
let e = M.current;
|
|
45
|
+
return M.current += 1, e;
|
|
46
|
+
}, z = u(), B = `wim-dropdown-menu-${z}`, V = `wim-dropdown-trigger-${z}`, H = () => {
|
|
47
|
+
let e = !D;
|
|
48
|
+
O(e), A(e ? 0 : -1);
|
|
49
|
+
}, U = c(() => {
|
|
50
|
+
O(!1), A(-1);
|
|
51
|
+
}, [O]);
|
|
52
|
+
l(() => {
|
|
51
53
|
let e = (e) => {
|
|
52
|
-
let t = e.target, n =
|
|
53
|
-
|
|
54
|
+
let t = e.target, n = F.floating.current?.contains(t) ?? !1;
|
|
55
|
+
j.current && !j.current.contains(t) && !n && U();
|
|
54
56
|
}, t = (e) => {
|
|
55
|
-
e.key === "Escape" &&
|
|
57
|
+
e.key === "Escape" && U();
|
|
56
58
|
};
|
|
57
|
-
return
|
|
59
|
+
return D && (document.addEventListener("mousedown", e), document.addEventListener("keydown", t)), () => {
|
|
58
60
|
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
|
|
59
61
|
};
|
|
60
|
-
}, [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
}, [
|
|
63
|
+
D,
|
|
64
|
+
F.floating,
|
|
65
|
+
U
|
|
66
|
+
]);
|
|
67
|
+
let W = (e) => {
|
|
68
|
+
if (!D) return;
|
|
69
|
+
let t = Array.from((F.floating.current ?? j.current)?.querySelectorAll("[role=\"menuitem\"]:not([aria-disabled=\"true\"])") || []);
|
|
64
70
|
switch (e.key) {
|
|
65
71
|
case "ArrowDown":
|
|
66
|
-
e.preventDefault(),
|
|
72
|
+
e.preventDefault(), A((e) => e < t.length - 1 ? e + 1 : 0);
|
|
67
73
|
break;
|
|
68
74
|
case "ArrowUp":
|
|
69
|
-
e.preventDefault(),
|
|
75
|
+
e.preventDefault(), A((e) => e > 0 ? e - 1 : t.length - 1);
|
|
70
76
|
break;
|
|
71
77
|
case "Home":
|
|
72
|
-
e.preventDefault(),
|
|
78
|
+
e.preventDefault(), A(0);
|
|
73
79
|
break;
|
|
74
80
|
case "End":
|
|
75
|
-
e.preventDefault(),
|
|
81
|
+
e.preventDefault(), A(t.length - 1);
|
|
76
82
|
break;
|
|
77
83
|
case "Tab":
|
|
78
|
-
|
|
84
|
+
U();
|
|
79
85
|
break;
|
|
80
86
|
}
|
|
81
87
|
};
|
|
82
|
-
|
|
83
|
-
|
|
88
|
+
l(() => {
|
|
89
|
+
D && k >= 0 && Array.from((F.floating.current ?? j.current)?.querySelectorAll("[role=\"menuitem\"]:not([aria-disabled=\"true\"])") || [])[k]?.focus({ preventScroll: !0 });
|
|
84
90
|
}, [
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
91
|
+
k,
|
|
92
|
+
D,
|
|
93
|
+
F.floating
|
|
88
94
|
]);
|
|
89
|
-
let
|
|
90
|
-
return /* @__PURE__ */
|
|
95
|
+
let G = o ? e : "div";
|
|
96
|
+
return /* @__PURE__ */ m(x.Provider, {
|
|
91
97
|
value: {
|
|
92
|
-
isOpen:
|
|
93
|
-
toggle:
|
|
94
|
-
close:
|
|
95
|
-
menuId:
|
|
96
|
-
triggerId:
|
|
97
|
-
focusedIndex:
|
|
98
|
-
setFocusedIndex:
|
|
99
|
-
registerItem:
|
|
100
|
-
containerRef:
|
|
101
|
-
setReference:
|
|
102
|
-
setFloating:
|
|
103
|
-
floatingStyles:
|
|
104
|
-
floatingRef:
|
|
105
|
-
setAlign:
|
|
98
|
+
isOpen: D,
|
|
99
|
+
toggle: H,
|
|
100
|
+
close: U,
|
|
101
|
+
menuId: B,
|
|
102
|
+
triggerId: V,
|
|
103
|
+
focusedIndex: k,
|
|
104
|
+
setFocusedIndex: A,
|
|
105
|
+
registerItem: R,
|
|
106
|
+
containerRef: j,
|
|
107
|
+
setReference: F.setReference,
|
|
108
|
+
setFloating: F.setFloating,
|
|
109
|
+
floatingStyles: I,
|
|
110
|
+
floatingRef: F.floating,
|
|
111
|
+
setAlign: P
|
|
106
112
|
},
|
|
107
|
-
children: /* @__PURE__ */
|
|
108
|
-
...
|
|
113
|
+
children: /* @__PURE__ */ m(G, {
|
|
114
|
+
...C,
|
|
109
115
|
role: "none",
|
|
110
|
-
className:
|
|
111
|
-
ref:
|
|
112
|
-
onKeyDown:
|
|
113
|
-
children: /* @__PURE__ */
|
|
116
|
+
className: p("wim-dropdown", a.root, r),
|
|
117
|
+
ref: L,
|
|
118
|
+
onKeyDown: W,
|
|
119
|
+
children: /* @__PURE__ */ m(t, { children: n })
|
|
114
120
|
})
|
|
115
121
|
});
|
|
116
122
|
});
|
|
117
|
-
|
|
118
|
-
var
|
|
119
|
-
let { toggle: u, isOpen: d, menuId:
|
|
120
|
-
return /* @__PURE__ */
|
|
123
|
+
S.displayName = "Dropdown";
|
|
124
|
+
var C = s(({ children: n, className: r, asChild: s = !1, ...c }, l) => {
|
|
125
|
+
let { toggle: u, isOpen: d, menuId: f, triggerId: h, setReference: g } = o.useContext(x), _ = s ? e : "div", v = i(g, l);
|
|
126
|
+
return /* @__PURE__ */ m(_, {
|
|
121
127
|
...c,
|
|
122
128
|
ref: v,
|
|
123
129
|
id: h,
|
|
124
|
-
className:
|
|
130
|
+
className: p(a.trigger, r),
|
|
125
131
|
onClick: u,
|
|
126
132
|
"aria-haspopup": "menu",
|
|
127
133
|
"aria-expanded": d,
|
|
128
|
-
"aria-controls": d ?
|
|
134
|
+
"aria-controls": d ? f : void 0,
|
|
129
135
|
role: "button",
|
|
130
136
|
tabIndex: 0,
|
|
131
137
|
onKeyDown: (e) => {
|
|
132
138
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), u());
|
|
133
139
|
},
|
|
134
|
-
children: /* @__PURE__ */
|
|
140
|
+
children: /* @__PURE__ */ m(t, { children: n })
|
|
135
141
|
});
|
|
136
142
|
});
|
|
137
|
-
|
|
138
|
-
var
|
|
139
|
-
let { isOpen:
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}, [r,
|
|
143
|
+
C.displayName = "Dropdown.Trigger";
|
|
144
|
+
var w = s(({ children: e, className: t, align: r = "left", show: s, style: c, ...u }, d) => {
|
|
145
|
+
let { isOpen: f, menuId: g, triggerId: _, setFloating: v, floatingStyles: y, setAlign: b } = o.useContext(x);
|
|
146
|
+
l(() => {
|
|
147
|
+
b(r);
|
|
148
|
+
}, [r, b]);
|
|
143
149
|
let S = i(v, d);
|
|
144
|
-
return /* @__PURE__ */
|
|
150
|
+
return /* @__PURE__ */ m(h, { children: /* @__PURE__ */ m(n, {
|
|
145
151
|
...u,
|
|
146
152
|
ref: S,
|
|
147
|
-
show: s === void 0 ?
|
|
153
|
+
show: s === void 0 ? f : s,
|
|
148
154
|
preset: "fade",
|
|
149
155
|
id: g,
|
|
150
156
|
style: {
|
|
151
157
|
...y,
|
|
152
|
-
...
|
|
158
|
+
...c
|
|
153
159
|
},
|
|
154
|
-
className:
|
|
160
|
+
className: p(a.menu, t),
|
|
155
161
|
role: "menu",
|
|
156
162
|
"aria-labelledby": _,
|
|
157
163
|
children: e
|
|
158
164
|
}) });
|
|
159
165
|
});
|
|
160
|
-
|
|
161
|
-
var
|
|
162
|
-
let { close: l, focusedIndex: u, setFocusedIndex:
|
|
166
|
+
w.displayName = "Dropdown.Menu";
|
|
167
|
+
var T = s(({ children: e, onClick: t, disabled: n = !1, className: i, ...s }, c) => {
|
|
168
|
+
let { close: l, focusedIndex: u, setFocusedIndex: d, registerItem: h } = o.useContext(x), [g] = f(() => h()), _ = u === g, v = (e) => {
|
|
163
169
|
n || (e.stopPropagation(), t && t(), l());
|
|
164
170
|
};
|
|
165
|
-
return /* @__PURE__ */
|
|
171
|
+
return /* @__PURE__ */ m(r, {
|
|
166
172
|
...s,
|
|
167
173
|
ref: c,
|
|
168
|
-
className:
|
|
174
|
+
className: p(a.item, i),
|
|
169
175
|
onClick: v,
|
|
170
|
-
onFocus: () =>
|
|
176
|
+
onFocus: () => d(g),
|
|
171
177
|
disabled: n,
|
|
172
178
|
role: "menuitem",
|
|
173
179
|
tabIndex: _ ? 0 : -1,
|
|
@@ -177,11 +183,11 @@ var w = s(({ children: e, onClick: t, disabled: n = !1, className: i, ...s }, c)
|
|
|
177
183
|
children: e
|
|
178
184
|
});
|
|
179
185
|
});
|
|
180
|
-
|
|
181
|
-
var
|
|
186
|
+
T.displayName = "Dropdown.Item";
|
|
187
|
+
var E = s((e, t) => /* @__PURE__ */ m(S, {
|
|
182
188
|
...e,
|
|
183
189
|
ref: t
|
|
184
190
|
}));
|
|
185
|
-
|
|
191
|
+
E.displayName = "Dropdown", E.Trigger = C, E.Menu = w, E.Item = T;
|
|
186
192
|
//#endregion
|
|
187
|
-
export {
|
|
193
|
+
export { E as Dropdown, E as default, T as DropdownItem, w as DropdownMenu, C as DropdownTrigger };
|
package/dist/llms-full.txt
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## What this is
|
|
6
6
|
|
|
7
|
-
**wimui** v0.
|
|
7
|
+
**wimui** v0.31.0 — a React 19 component library: 225 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
|
|
|
@@ -45,7 +45,7 @@ Every component works from the root barrel `"wimui"`. For smaller bundles, impor
|
|
|
45
45
|
|
|
46
46
|
## Composition rules — build screens that don't look AI-generated
|
|
47
47
|
|
|
48
|
-
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
|
+
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 — **and also when you write a single component on its own**, because the way it renders with no props is judged by the same rules (rule 22). That split is about what is being judged, not about where the problem lives: a default that emits a banned pattern emits it into every screen that uses the component.
|
|
49
49
|
|
|
50
50
|
**Before laying out**: pick exactly ONE visual protagonist for the screen. If every element has the same volume, it reads as AI-generated.
|
|
51
51
|
|
|
@@ -65,7 +65,7 @@ Single components are judged by state/a11y/token compliance. **Composed screens*
|
|
|
65
65
|
**Machine-enforced banned vocabulary** (a linter, `check:slop`, fails builds that use these in demo copy — say concrete actions/numbers instead):
|
|
66
66
|
- 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, 圧倒的, 革新的, 次世代, 究極, 最先端.
|
|
67
67
|
- 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".
|
|
68
|
-
- 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
|
+
- Stock placeholder names: John Doe, Jane Doe, John Smith, Jane Smith, Lorem Ipsum, Example User, Acme, Alice, Bob, Charlie, User 1, User 2, User 3, Step 1, Step 2, Step 3 (a realistic example name in an input placeholder is fine).
|
|
69
69
|
|
|
70
70
|
**Must rules:**
|
|
71
71
|
1. One visual protagonist per screen (jump in size/weight/color creates the entry point).
|
|
@@ -80,10 +80,21 @@ Single components are judged by state/a11y/token compliance. **Composed screens*
|
|
|
80
80
|
10. Keep one elevation stance per screen: don't mix surfaces raised by shadow with surfaces cut by borders. `Card` and `Stats` default to `elevated`, so pass `variant="outline"` when the screen is border-led. If the outer container already casts a shadow, its contents need only a border. On admin/list screens, `Table`/`DataGrid` mobile cards must stay border-only like the toolbar and pagination — row cards with `shadow-sm` while chrome is flat outline is the same mixed stance.
|
|
81
81
|
11. Never wrap a component that already draws its own frame. `<Card><Table card /></Card>` doubles the border and nests radii (12px inside 4px). `Table` takes a `card` prop and `Stats` is already a Card — place them directly.
|
|
82
82
|
12. Always pass `intent` on `Badge` / `Tag` / `Chip`. Their default is `primary` (the accent), so an ordinary value like `pending` or `member` gets painted as loudly as an exception and the colour stops carrying information. Use `intent="neutral"` for ordinary values.
|
|
83
|
-
13. Pick colour by good/bad, not by direction. `Stats.Trend`
|
|
83
|
+
13. Pick colour by good/bad, not by direction. On `Stats.Trend`, `direction` sets the arrow and `intent` sets the colour; without `intent` the colour follows the direction, so `up` is the success colour. For a metric where up is bad (failures, error rate, cost), write `direction="up" intent="danger"` — leaving it out renders the bad news as good. Don't approximate a meaning the API cannot express.
|
|
84
84
|
14. Keep the chrome quiet. Breadcrumb, page title, summary line, toolbar and filter bar frame the content; they must not compete with the protagonist. Don't promote a one-line summary to an `Alert`/`Banner`, don't wrap the filter bar in a `Card` (its border doubles up with the data region's), keep primary surfaces out of the chrome, and don't stack a KPI tile row above a table screen. Corollary of protagonist and accent limits, but it is the rule most often broken on admin/list screens — the test is whether the eye lands on the data first.
|
|
85
85
|
15. 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).
|
|
86
86
|
16. Check the screen at 390px and 768px before calling it done. The page itself must never scroll sideways (`document.scrollWidth > document.documentElement.clientWidth` is a bug — the usual cause is a group of controls that cannot wrap, e.g. several buttons packed into one `Toolbar.Group`; split them into separate groups). Data tables need their narrow mode turned on (`<DataGrid mobileCard>` / `<Table mobileCard>`) rather than an inner scrollbar: without it columns collapse and a short string like a `Code` lot number breaks one character per line. The default card switch is `container-down(sm)` (576px). Wide grids that still overflow at tablet should pass `mobileCard="md"` so cards continue through 768px.
|
|
87
|
+
17. Left-align by default. At most one centred section per page, counted per section — cards repeated inside one grid count as one, and this exemption is about how to count centring only: the repetition of a uniform grid is still caught by the rule-of-three rule.
|
|
88
|
+
18. Never fall back to three equal parallel items (three feature cards with icon + short heading + one line, or "Fast. Secure. Reliable."). Let the count come from the content — two or five is fine — and vary card grain and body length.
|
|
89
|
+
19. Subtract every decoration that does not help the reader act or understand (excess shadow, border, gradient, emoji). AI fills empty space by habit, so decoration accumulates without intent.
|
|
90
|
+
20. Never hand-draw fake chrome (browser bars, phone frames, IDE windows) to make a demo look like a screenshot.
|
|
91
|
+
21. Never fall back to a stock diagonal gradient (a 135deg hero background, a `to bottom right` panel, a gradient blob). Split surfaces with the surface tokens instead. Gradients parallel to an axis are fine when they implement motion (a 90deg shimmer).
|
|
92
|
+
22. Judge a component the way it renders with no props. If placing it bare produces something on the banned list — a stock hero, three equal feature cards, a diagonal gradient panel, rainbow categories, empty placeholder copy — the default is the defect, not the screen that used it. Catalogue "Default" stories teach the component, so they are read as composition, not as craft.
|
|
93
|
+
23. Never ship hollow boilerplate copy ("No data found", "Get started", "This is a description", "Ready to start?", "Your operation has been executed"). It displays the fact that nobody decided what to say yet. Name the thing that is missing and the one action that changes it. This is a different defect from hype: hype overclaims, hollow copy says nothing.
|
|
94
|
+
24. Avoid the stock hero anatomy: icon or badge, big heading, one line of subtext, two buttons (one solid, one outline), all centred. It is the single most recognisable AI screen. Decide one protagonist and build asymmetrically around it; one primary action plus a text link beats two equal buttons.
|
|
95
|
+
25. Never assign a different colour per tag, per person or per KPI. Colour carries good/bad (success / warning / danger) and nothing else; everything else stays neutral. A rainbow of categories makes every value look like an exception, which means none of them do.
|
|
96
|
+
26. Never draw a stand-in for content you did not build: a Skeleton used as a fake screenshot, a grey box or gradient panel captioned "Chart placeholder". Either put the real component in (a Sparkline, a table) or leave the region out. A labelled empty box teaches readers that the library cannot fill it.
|
|
97
|
+
27. Glass / neumorphic "futuristic tech" surfaces may exist as an opt-in variant, but never as a default or as the first example in the docs. Shown first, it becomes what the library looks like, and that look is the most generic one available.
|
|
87
98
|
|
|
88
99
|
## Recipes — copy-paste starting points
|
|
89
100
|
|
|
@@ -2240,7 +2251,7 @@ what a scanner would read.
|
|
|
2240
2251
|
- `children: React.ReactNode` — Content to render inside.
|
|
2241
2252
|
- **Card** — Information containers
|
|
2242
2253
|
- `asChild: boolean` = false — If true, the card will be rendered as its child, merging its props onto that child.
|
|
2243
|
-
- `variant: "elevated" | "outline" | "flat" | "glass"` = "
|
|
2254
|
+
- `variant: "elevated" | "outline" | "flat" | "glass"` = "outline" — Visual style variant of the card
|
|
2244
2255
|
- `interactive: boolean` = false — Whether to enable hover animation and click effects
|
|
2245
2256
|
- `padding: (typeof CARD_STYLED_PADDING)[number]` = "md" — Padding size.
|
|
2246
2257
|
|
|
@@ -2259,6 +2270,9 @@ Same derivation as `padding`. There is no `--wim-radius-xs` / `-3xl` /
|
|
|
2259
2270
|
- `interval: number` = 5000 — Auto-play interval (in milliseconds)
|
|
2260
2271
|
- `showIndicators: boolean` = true — Whether to show the indicators
|
|
2261
2272
|
- `showControls: boolean` = true — Whether to show the previous/next buttons
|
|
2273
|
+
- `controlsPlacement: "overlay" | "outside"` = "overlay" — Where the arrows and indicators sit. `overlay` (default) places them on top of the
|
|
2274
|
+
slide, which suits full-bleed images. `outside` moves the arrows beside the viewport
|
|
2275
|
+
and the indicators below it, so they never cover a slide made of text.
|
|
2262
2276
|
- `loop: boolean` = true — Whether to loop infinitely (seamless transitions)
|
|
2263
2277
|
- `slidesToShow: number | Breakpoints` = 1 — Number of slides to show at once. A number or an object per breakpoint.
|
|
2264
2278
|
- `aspectRatio: string` — Aspect ratio (e.g. '16/9', '4/3', '1/1').
|
|
@@ -2277,7 +2291,7 @@ Cannot be combined with `onDelete` (T99).
|
|
|
2277
2291
|
- `icon: React.ReactNode` — Icon
|
|
2278
2292
|
- `selected: boolean` = false — Whether the chip is selected
|
|
2279
2293
|
- `disabled: boolean` = false — Whether the chip is disabled
|
|
2280
|
-
- `intent: IndicatorIntent` = "
|
|
2294
|
+
- `intent: IndicatorIntent` = "neutral" — Intent (semantic state)
|
|
2281
2295
|
- `variant: "solid" | "outline" | "subtle"` = "solid" — Visual style variant
|
|
2282
2296
|
- `size: Extract<ComponentSize, "sm" | "md" | "lg">` = "md" — Size
|
|
2283
2297
|
- `deleteAriaLabel: string` — Accessible label for the delete button
|
|
@@ -2367,6 +2381,9 @@ drops secondary text below the AA contrast floor.
|
|
|
2367
2381
|
- `description: React.ReactNode` — Description text to display.
|
|
2368
2382
|
- `icon: React.ReactNode` — Icon to display.
|
|
2369
2383
|
- `extra: React.ReactNode` — Element shown as an action (e.g. a button).
|
|
2384
|
+
- `align: "start" | "center"` = "start" — Horizontal alignment. Start-aligned reads as part of the card or table it sits
|
|
2385
|
+
in; use `"center"` only when the empty state is the only thing in its region.
|
|
2386
|
+
@default "start"
|
|
2370
2387
|
- **FAQSection** — Frequently Asked Questions section
|
|
2371
2388
|
- `items: FAQItem[]` (required) — FAQ items.
|
|
2372
2389
|
- `title: React.ReactNode` — Main title of the section.
|
|
@@ -2422,7 +2439,8 @@ drops secondary text below the AA contrast floor.
|
|
|
2422
2439
|
- **Marquee** — Scrolling text animation (aka Ticker)
|
|
2423
2440
|
- `duration: number` = 20 — Animation speed (in seconds). Defaults to `20`.
|
|
2424
2441
|
- `reverse: boolean` = false — Whether to run the animation in reverse.
|
|
2425
|
-
- `pauseOnHover: boolean` = true — Whether to pause the animation on hover.
|
|
2442
|
+
- `pauseOnHover: boolean` = true — Whether to pause the animation on hover. Keyboard focus inside the marquee
|
|
2443
|
+
always pauses it, regardless of this option (WCAG 2.2.2).
|
|
2426
2444
|
- `vertical: boolean` = false — Whether to scroll vertically.
|
|
2427
2445
|
- `repeat: number` = 2 — Number of times the content is repeated. May need adjusting for a seamless loop. Defaults to `2`.
|
|
2428
2446
|
- **NodeGraph** — Visualizes complex networks and relationships between nodes.
|
|
@@ -2529,7 +2547,7 @@ renders inline, next to whatever follows it.
|
|
|
2529
2547
|
- `onSortEnd: (oldIndex: number, newIndex: number) => void` — Callback called when reordering is completed.
|
|
2530
2548
|
- `disabled: boolean` = false — Whether the entire list is disabled.
|
|
2531
2549
|
- **Stats** — A component to highlight key performance indicators and metrics
|
|
2532
|
-
- `variant: React.ComponentProps<typeof Card>["variant"]` = "
|
|
2550
|
+
- `variant: React.ComponentProps<typeof Card>["variant"]` = "outline" — Visual style variant of the card
|
|
2533
2551
|
- `asChild: boolean` = false — If true, the card will be rendered as its child, merging its props onto that child.
|
|
2534
2552
|
- `interactive: boolean` = false — Whether to enable hover animation and click effects
|
|
2535
2553
|
- `padding: (typeof CARD_STYLED_PADDING)[number]` = "md" — Padding size.
|
|
@@ -2653,6 +2671,11 @@ Cannot be combined with `onDelete` — the delete control is a second element, a
|
|
|
2653
2671
|
- **Dropdown** — Overlay selection menu (aka Overflow Menu, Kebab Menu, Meatball Menu, Vertical Ellipsis, Horizontal Ellipsis, Three Dots Menu, More Menu, App Switcher, オーバーフローメニュー, ケバブメニュー, ミートボールメニュー)
|
|
2654
2672
|
- `children: ReactNode` (required) — Dropdown parts (Dropdown.Trigger and Dropdown.Menu).
|
|
2655
2673
|
- `asChild: boolean` = false — If true, the dropdown will be rendered as its child, merging its props onto that child.
|
|
2674
|
+
- `defaultOpen: boolean` = false — Whether the menu starts open. Use it for a screenshot, a test, or a menu that should
|
|
2675
|
+
already be showing. Ignored once `open` is provided.
|
|
2676
|
+
- `open: boolean` — Controls the open state from the outside. Pass it together with `onOpenChange`.
|
|
2677
|
+
- `onOpenChange: (open: boolean) => void` — Called with the next open state, both when the trigger is used and when the menu is
|
|
2678
|
+
dismissed by an outside click or Escape.
|
|
2656
2679
|
- **FocusTrap** — Focus management
|
|
2657
2680
|
- `children: React.ReactNode` (required) — Content to trap focus within.
|
|
2658
2681
|
- `active: boolean` = true — Whether the trap is active.
|
package/dist/llms.txt
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## What this is
|
|
6
6
|
|
|
7
|
-
**wimui** v0.
|
|
7
|
+
**wimui** v0.31.0 — a React 19 component library: 225 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
|
|
|
@@ -45,7 +45,7 @@ Every component works from the root barrel `"wimui"`. For smaller bundles, impor
|
|
|
45
45
|
|
|
46
46
|
## Composition rules — build screens that don't look AI-generated
|
|
47
47
|
|
|
48
|
-
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
|
+
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 — **and also when you write a single component on its own**, because the way it renders with no props is judged by the same rules (rule 22). That split is about what is being judged, not about where the problem lives: a default that emits a banned pattern emits it into every screen that uses the component.
|
|
49
49
|
|
|
50
50
|
**Before laying out**: pick exactly ONE visual protagonist for the screen. If every element has the same volume, it reads as AI-generated.
|
|
51
51
|
|
|
@@ -65,7 +65,7 @@ Single components are judged by state/a11y/token compliance. **Composed screens*
|
|
|
65
65
|
**Machine-enforced banned vocabulary** (a linter, `check:slop`, fails builds that use these in demo copy — say concrete actions/numbers instead):
|
|
66
66
|
- 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, 圧倒的, 革新的, 次世代, 究極, 最先端.
|
|
67
67
|
- 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".
|
|
68
|
-
- 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
|
+
- Stock placeholder names: John Doe, Jane Doe, John Smith, Jane Smith, Lorem Ipsum, Example User, Acme, Alice, Bob, Charlie, User 1, User 2, User 3, Step 1, Step 2, Step 3 (a realistic example name in an input placeholder is fine).
|
|
69
69
|
|
|
70
70
|
**Must rules:**
|
|
71
71
|
1. One visual protagonist per screen (jump in size/weight/color creates the entry point).
|
|
@@ -80,10 +80,21 @@ Single components are judged by state/a11y/token compliance. **Composed screens*
|
|
|
80
80
|
10. Keep one elevation stance per screen: don't mix surfaces raised by shadow with surfaces cut by borders. `Card` and `Stats` default to `elevated`, so pass `variant="outline"` when the screen is border-led. If the outer container already casts a shadow, its contents need only a border. On admin/list screens, `Table`/`DataGrid` mobile cards must stay border-only like the toolbar and pagination — row cards with `shadow-sm` while chrome is flat outline is the same mixed stance.
|
|
81
81
|
11. Never wrap a component that already draws its own frame. `<Card><Table card /></Card>` doubles the border and nests radii (12px inside 4px). `Table` takes a `card` prop and `Stats` is already a Card — place them directly.
|
|
82
82
|
12. Always pass `intent` on `Badge` / `Tag` / `Chip`. Their default is `primary` (the accent), so an ordinary value like `pending` or `member` gets painted as loudly as an exception and the colour stops carrying information. Use `intent="neutral"` for ordinary values.
|
|
83
|
-
13. Pick colour by good/bad, not by direction. `Stats.Trend`
|
|
83
|
+
13. Pick colour by good/bad, not by direction. On `Stats.Trend`, `direction` sets the arrow and `intent` sets the colour; without `intent` the colour follows the direction, so `up` is the success colour. For a metric where up is bad (failures, error rate, cost), write `direction="up" intent="danger"` — leaving it out renders the bad news as good. Don't approximate a meaning the API cannot express.
|
|
84
84
|
14. Keep the chrome quiet. Breadcrumb, page title, summary line, toolbar and filter bar frame the content; they must not compete with the protagonist. Don't promote a one-line summary to an `Alert`/`Banner`, don't wrap the filter bar in a `Card` (its border doubles up with the data region's), keep primary surfaces out of the chrome, and don't stack a KPI tile row above a table screen. Corollary of protagonist and accent limits, but it is the rule most often broken on admin/list screens — the test is whether the eye lands on the data first.
|
|
85
85
|
15. 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).
|
|
86
86
|
16. Check the screen at 390px and 768px before calling it done. The page itself must never scroll sideways (`document.scrollWidth > document.documentElement.clientWidth` is a bug — the usual cause is a group of controls that cannot wrap, e.g. several buttons packed into one `Toolbar.Group`; split them into separate groups). Data tables need their narrow mode turned on (`<DataGrid mobileCard>` / `<Table mobileCard>`) rather than an inner scrollbar: without it columns collapse and a short string like a `Code` lot number breaks one character per line. The default card switch is `container-down(sm)` (576px). Wide grids that still overflow at tablet should pass `mobileCard="md"` so cards continue through 768px.
|
|
87
|
+
17. Left-align by default. At most one centred section per page, counted per section — cards repeated inside one grid count as one, and this exemption is about how to count centring only: the repetition of a uniform grid is still caught by the rule-of-three rule.
|
|
88
|
+
18. Never fall back to three equal parallel items (three feature cards with icon + short heading + one line, or "Fast. Secure. Reliable."). Let the count come from the content — two or five is fine — and vary card grain and body length.
|
|
89
|
+
19. Subtract every decoration that does not help the reader act or understand (excess shadow, border, gradient, emoji). AI fills empty space by habit, so decoration accumulates without intent.
|
|
90
|
+
20. Never hand-draw fake chrome (browser bars, phone frames, IDE windows) to make a demo look like a screenshot.
|
|
91
|
+
21. Never fall back to a stock diagonal gradient (a 135deg hero background, a `to bottom right` panel, a gradient blob). Split surfaces with the surface tokens instead. Gradients parallel to an axis are fine when they implement motion (a 90deg shimmer).
|
|
92
|
+
22. Judge a component the way it renders with no props. If placing it bare produces something on the banned list — a stock hero, three equal feature cards, a diagonal gradient panel, rainbow categories, empty placeholder copy — the default is the defect, not the screen that used it. Catalogue "Default" stories teach the component, so they are read as composition, not as craft.
|
|
93
|
+
23. Never ship hollow boilerplate copy ("No data found", "Get started", "This is a description", "Ready to start?", "Your operation has been executed"). It displays the fact that nobody decided what to say yet. Name the thing that is missing and the one action that changes it. This is a different defect from hype: hype overclaims, hollow copy says nothing.
|
|
94
|
+
24. Avoid the stock hero anatomy: icon or badge, big heading, one line of subtext, two buttons (one solid, one outline), all centred. It is the single most recognisable AI screen. Decide one protagonist and build asymmetrically around it; one primary action plus a text link beats two equal buttons.
|
|
95
|
+
25. Never assign a different colour per tag, per person or per KPI. Colour carries good/bad (success / warning / danger) and nothing else; everything else stays neutral. A rainbow of categories makes every value look like an exception, which means none of them do.
|
|
96
|
+
26. Never draw a stand-in for content you did not build: a Skeleton used as a fake screenshot, a grey box or gradient panel captioned "Chart placeholder". Either put the real component in (a Sparkline, a table) or leave the region out. A labelled empty box teaches readers that the library cannot fill it.
|
|
97
|
+
27. Glass / neumorphic "futuristic tech" surfaces may exist as an opt-in variant, but never as a default or as the first example in the docs. Shown first, it becomes what the library looks like, and that look is the most generic one available.
|
|
87
98
|
|
|
88
99
|
## Recipes — copy-paste starting points
|
|
89
100
|
|