wimui 0.58.1 → 0.60.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/components/ai/PromptInput/PromptInput.cjs +1 -1
- package/dist/components/ai/PromptInput/PromptInput.js +30 -30
- package/dist/components/ai/SourceCitation/SourceCitation.cjs +1 -1
- package/dist/components/ai/SourceCitation/SourceCitation.d.ts +5 -1
- package/dist/components/ai/SourceCitation/SourceCitation.js +10 -8
- package/dist/components/ai/Terminal/Terminal.cjs +2 -2
- package/dist/components/ai/Terminal/Terminal.js +16 -14
- package/dist/components/data-display/DataGrid/DataGrid.cjs +1 -1
- package/dist/components/data-display/DataGrid/DataGrid.d.ts +5 -1
- package/dist/components/data-display/DataGrid/DataGrid.js +54 -53
- package/dist/components/data-display/FAQSection/FAQSection.cjs +1 -1
- package/dist/components/data-display/FAQSection/FAQSection.d.ts +5 -1
- package/dist/components/data-display/FAQSection/FAQSection.js +5 -3
- package/dist/components/data-display/TreeView/TreeView.cjs +1 -1
- package/dist/components/data-display/TreeView/TreeView.d.ts +5 -1
- package/dist/components/data-display/TreeView/TreeView.js +87 -87
- package/dist/components/data-display/VirtualList/VirtualList.cjs +1 -1
- package/dist/components/data-display/VirtualList/VirtualList.d.ts +2 -0
- package/dist/components/data-display/VirtualList/VirtualList.js +15 -14
- package/dist/components/feedback/Notification/Notification.cjs +1 -1
- package/dist/components/feedback/Notification/Notification.d.ts +5 -1
- package/dist/components/feedback/Notification/Notification.js +10 -8
- package/dist/components/feedback/Toast/Toast.cjs +1 -1
- package/dist/components/feedback/Toast/Toast.d.ts +5 -1
- package/dist/components/feedback/Toast/Toast.js +11 -9
- package/dist/components/form/CopyButton/CopyButton.cjs +1 -1
- package/dist/components/form/CopyButton/CopyButton.d.ts +5 -1
- package/dist/components/form/CopyButton/CopyButton.js +17 -15
- package/dist/components/form/Dropzone/Dropzone.cjs +1 -1
- package/dist/components/form/Dropzone/Dropzone.d.ts +7 -1
- package/dist/components/form/Dropzone/Dropzone.js +29 -28
- package/dist/components/form/FileUpload/FileUpload.cjs +1 -1
- package/dist/components/form/FileUpload/FileUpload.d.ts +7 -1
- package/dist/components/form/FileUpload/FileUpload.js +22 -17
- package/dist/components/form/ImageCropper/ImageCropper.cjs +1 -1
- package/dist/components/form/ImageCropper/ImageCropper.js +102 -100
- package/dist/components/form/QueryBuilder/QueryBuilder.cjs +1 -1
- package/dist/components/form/QueryBuilder/QueryBuilder.d.ts +7 -1
- package/dist/components/form/QueryBuilder/QueryBuilder.js +104 -102
- package/dist/components/form/SignaturePad/SignaturePad.cjs +1 -1
- package/dist/components/form/SignaturePad/SignaturePad.d.ts +5 -1
- package/dist/components/form/SignaturePad/SignaturePad.js +47 -47
- package/dist/components/form/ThemeToggle/ThemeToggle.cjs +1 -1
- package/dist/components/form/ThemeToggle/ThemeToggle.js +59 -54
- package/dist/components/media/ImageCompare/ImageCompare.cjs +1 -1
- package/dist/components/media/ImageCompare/ImageCompare.js +33 -31
- package/dist/components/navigation/BackTop/BackTop.cjs +1 -1
- package/dist/components/navigation/BackTop/BackTop.d.ts +4 -0
- package/dist/components/navigation/BackTop/BackTop.js +18 -16
- package/dist/components/navigation/CommandPalette/CommandPalette.cjs +1 -1
- package/dist/components/navigation/CommandPalette/CommandPalette.d.ts +5 -1
- package/dist/components/navigation/CommandPalette/CommandPalette.js +11 -6
- package/dist/components/navigation/Pagination/Pagination.cjs +1 -1
- package/dist/components/navigation/Pagination/Pagination.d.ts +5 -1
- package/dist/components/navigation/Pagination/Pagination.js +65 -63
- package/dist/components/overlay/Menu/Menu.cjs +1 -1
- package/dist/components/overlay/Menu/Menu.d.ts +4 -0
- package/dist/components/overlay/Menu/Menu.js +23 -21
- package/dist/llms-full.txt +33 -1
- package/dist/llms.txt +1 -1
- package/dist/wimui.umd.js +4 -4
- package/package.json +1 -1
|
@@ -22,29 +22,29 @@ var g = u.forwardRef(({ asChild: n = !1, className: r, children: i, page: a, isA
|
|
|
22
22
|
children: n ? /* @__PURE__ */ m(t, { children: i }) : i
|
|
23
23
|
}));
|
|
24
24
|
g.displayName = "PaginationPage";
|
|
25
|
-
var _ = "...", v = ({ total: u, pageSize: v = 10, current: y = 1, onChange: b, onPageSizeChange:
|
|
25
|
+
var _ = "...", v = ({ total: u, pageSize: v = 10, current: y = 1, onChange: b, onPageSizeChange: x, siblingCount: S = 1, className: C, asChild: w = !1, children: T, renderPage: E, hideOnSinglePage: te = !1, simple: ne = !1, showSizeChanger: D = !1, pageSizeOptions: O = [
|
|
26
26
|
10,
|
|
27
27
|
20,
|
|
28
28
|
50,
|
|
29
29
|
100
|
|
30
|
-
], showTotal:
|
|
31
|
-
let { t:
|
|
32
|
-
if (
|
|
33
|
-
let e = Math.max(y -
|
|
30
|
+
], showTotal: k, showQuickJumper: A = !1, labels: j = {}, "aria-label": M, "aria-labelledby": N }) => {
|
|
31
|
+
let { t: P } = n(r), { prevPage: F = P("a11y.go_to_prev_page"), nextPage: I = P("a11y.go_to_next_page"), pageAriaLabel: L = (e) => P("a11y.go_to_page", { page: String(e) }), itemsPerPage: R = P("pagination.items_per_page"), goTo: z = P("pagination.go_to"), go: B = P("pagination.go"), pageSizeAriaLabel: V = P("a11y.items_per_page"), jumpToPageAriaLabel: H = P("a11y.jump_to_page"), navAriaLabel: U = P("a11y.pagination_nav") } = j, [W, G] = f(v), [K, q] = f(""), J = W, Y = Math.ceil(u / J), X = d(() => {
|
|
32
|
+
if (S + 5 >= Y) return Array.from({ length: Y }, (e, t) => t + 1);
|
|
33
|
+
let e = Math.max(y - S, 1), t = Math.min(y + S, Y), n = e > 2, r = t < Y - 2, i = Y;
|
|
34
34
|
if (!n && r) {
|
|
35
|
-
let e = 3 + 2 *
|
|
35
|
+
let e = 3 + 2 * S;
|
|
36
36
|
return [
|
|
37
37
|
...Array.from({ length: e }, (e, t) => t + 1),
|
|
38
38
|
_,
|
|
39
|
-
|
|
39
|
+
Y
|
|
40
40
|
];
|
|
41
41
|
}
|
|
42
42
|
if (n && !r) {
|
|
43
|
-
let e = 3 + 2 *
|
|
43
|
+
let e = 3 + 2 * S;
|
|
44
44
|
return [
|
|
45
45
|
1,
|
|
46
46
|
_,
|
|
47
|
-
...Array.from({ length: e }, (t, n) =>
|
|
47
|
+
...Array.from({ length: e }, (t, n) => Y - e + n + 1)
|
|
48
48
|
];
|
|
49
49
|
}
|
|
50
50
|
return n && r ? [
|
|
@@ -55,45 +55,46 @@ var _ = "...", v = ({ total: u, pageSize: v = 10, current: y = 1, onChange: b, o
|
|
|
55
55
|
i
|
|
56
56
|
] : [];
|
|
57
57
|
}, [
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
Y,
|
|
59
|
+
S,
|
|
60
60
|
y
|
|
61
61
|
]);
|
|
62
|
-
if (
|
|
63
|
-
let
|
|
64
|
-
e < 1 || e >
|
|
65
|
-
},
|
|
66
|
-
|
|
62
|
+
if (te && Y <= 1) return null;
|
|
63
|
+
let Z = (e) => {
|
|
64
|
+
e < 1 || e > Y || e === y || b?.(e, J);
|
|
65
|
+
}, re = (e) => {
|
|
66
|
+
G(e), x?.(e), b?.(1, e);
|
|
67
67
|
}, Q = () => {
|
|
68
|
-
let e = parseInt(
|
|
69
|
-
!isNaN(e) && e >= 1 && e <=
|
|
70
|
-
},
|
|
68
|
+
let e = parseInt(K);
|
|
69
|
+
!isNaN(e) && e >= 1 && e <= Y && (Z(e), q(""));
|
|
70
|
+
}, ie = (e) => {
|
|
71
71
|
e.key === "Enter" && Q();
|
|
72
|
-
},
|
|
72
|
+
}, ae = (y - 1) * J + 1, oe = Math.min(y * J, u), $ = w ? e : "nav", se = (e) => {
|
|
73
73
|
let t = {
|
|
74
74
|
page: e,
|
|
75
75
|
isActive: e === y,
|
|
76
|
-
onClick: () =>
|
|
77
|
-
"aria-label":
|
|
76
|
+
onClick: () => Z(e),
|
|
77
|
+
"aria-label": L(e)
|
|
78
78
|
};
|
|
79
|
-
return
|
|
79
|
+
return E ? E(e, t) : /* @__PURE__ */ m(g, {
|
|
80
80
|
...t,
|
|
81
81
|
children: e
|
|
82
82
|
});
|
|
83
83
|
};
|
|
84
|
-
return
|
|
85
|
-
className: p("wim-pagination", l.root, l.simple,
|
|
86
|
-
"aria-label":
|
|
87
|
-
|
|
84
|
+
return ne ? /* @__PURE__ */ h($, {
|
|
85
|
+
className: p("wim-pagination", l.root, l.simple, C),
|
|
86
|
+
"aria-label": N ? void 0 : M ?? U,
|
|
87
|
+
"aria-labelledby": N,
|
|
88
|
+
children: [/* @__PURE__ */ m(t, { children: T }), /* @__PURE__ */ h("ul", {
|
|
88
89
|
className: l.root,
|
|
89
90
|
children: [
|
|
90
91
|
/* @__PURE__ */ m("li", {
|
|
91
92
|
className: p(l.item, y === 1 && l.disabled),
|
|
92
93
|
children: /* @__PURE__ */ m("button", {
|
|
93
94
|
className: l.button,
|
|
94
|
-
onClick: () =>
|
|
95
|
+
onClick: () => Z(y - 1),
|
|
95
96
|
disabled: y === 1,
|
|
96
|
-
"aria-label":
|
|
97
|
+
"aria-label": F,
|
|
97
98
|
children: /* @__PURE__ */ m(o, {
|
|
98
99
|
component: i,
|
|
99
100
|
size: "sm"
|
|
@@ -105,16 +106,16 @@ var _ = "...", v = ({ total: u, pageSize: v = 10, current: y = 1, onChange: b, o
|
|
|
105
106
|
children: /* @__PURE__ */ h("span", { children: [
|
|
106
107
|
y,
|
|
107
108
|
" / ",
|
|
108
|
-
|
|
109
|
+
Y
|
|
109
110
|
] })
|
|
110
111
|
}),
|
|
111
112
|
/* @__PURE__ */ m("li", {
|
|
112
|
-
className: p(l.item, y ===
|
|
113
|
+
className: p(l.item, y === Y && l.disabled),
|
|
113
114
|
children: /* @__PURE__ */ m("button", {
|
|
114
115
|
className: l.button,
|
|
115
|
-
onClick: () =>
|
|
116
|
-
disabled: y ===
|
|
117
|
-
"aria-label":
|
|
116
|
+
onClick: () => Z(y + 1),
|
|
117
|
+
disabled: y === Y,
|
|
118
|
+
"aria-label": I,
|
|
118
119
|
children: /* @__PURE__ */ m(o, {
|
|
119
120
|
component: a,
|
|
120
121
|
size: "sm"
|
|
@@ -124,27 +125,28 @@ var _ = "...", v = ({ total: u, pageSize: v = 10, current: y = 1, onChange: b, o
|
|
|
124
125
|
]
|
|
125
126
|
})]
|
|
126
127
|
}) : /* @__PURE__ */ m("div", {
|
|
127
|
-
className: p("wim-pagination", l.container,
|
|
128
|
+
className: p("wim-pagination", l.container, C),
|
|
128
129
|
children: /* @__PURE__ */ h("div", {
|
|
129
130
|
className: l.wrapper,
|
|
130
131
|
children: [
|
|
131
|
-
|
|
132
|
+
k && /* @__PURE__ */ m("div", {
|
|
132
133
|
className: l.total,
|
|
133
|
-
children:
|
|
134
|
+
children: k(u, [ae, oe])
|
|
134
135
|
}),
|
|
135
136
|
/* @__PURE__ */ h($, {
|
|
136
137
|
className: l.root,
|
|
137
|
-
"aria-label":
|
|
138
|
-
|
|
138
|
+
"aria-label": N ? void 0 : M ?? U,
|
|
139
|
+
"aria-labelledby": N,
|
|
140
|
+
children: [/* @__PURE__ */ m(t, { children: T }), /* @__PURE__ */ h("ul", {
|
|
139
141
|
className: l.root,
|
|
140
142
|
children: [
|
|
141
143
|
/* @__PURE__ */ m("li", {
|
|
142
144
|
className: p(l.item, y === 1 && l.disabled),
|
|
143
145
|
children: /* @__PURE__ */ m("button", {
|
|
144
146
|
className: l.button,
|
|
145
|
-
onClick: () =>
|
|
147
|
+
onClick: () => Z(y - 1),
|
|
146
148
|
disabled: y === 1,
|
|
147
|
-
"aria-label":
|
|
149
|
+
"aria-label": F,
|
|
148
150
|
children: /* @__PURE__ */ m(o, {
|
|
149
151
|
component: i,
|
|
150
152
|
size: "sm"
|
|
@@ -156,24 +158,24 @@ var _ = "...", v = ({ total: u, pageSize: v = 10, current: y = 1, onChange: b, o
|
|
|
156
158
|
children: /* @__PURE__ */ h("span", { children: [
|
|
157
159
|
y,
|
|
158
160
|
" / ",
|
|
159
|
-
|
|
161
|
+
Y
|
|
160
162
|
] })
|
|
161
163
|
}),
|
|
162
|
-
|
|
164
|
+
X.map((e, t) => e === _ ? /* @__PURE__ */ m("li", {
|
|
163
165
|
className: p(l.item, l.ellipsis),
|
|
164
166
|
"aria-hidden": "true",
|
|
165
167
|
children: _
|
|
166
168
|
}, `ellipsis-${t}`) : /* @__PURE__ */ m("li", {
|
|
167
169
|
className: p(l.item, l.number, e === y && l.active),
|
|
168
|
-
children:
|
|
170
|
+
children: se(e)
|
|
169
171
|
}, e)),
|
|
170
172
|
/* @__PURE__ */ m("li", {
|
|
171
|
-
className: p(l.item, y ===
|
|
173
|
+
className: p(l.item, y === Y && l.disabled),
|
|
172
174
|
children: /* @__PURE__ */ m("button", {
|
|
173
175
|
className: l.button,
|
|
174
|
-
onClick: () =>
|
|
175
|
-
disabled: y ===
|
|
176
|
-
"aria-label":
|
|
176
|
+
onClick: () => Z(y + 1),
|
|
177
|
+
disabled: y === Y,
|
|
178
|
+
"aria-label": I,
|
|
177
179
|
children: /* @__PURE__ */ m(o, {
|
|
178
180
|
component: a,
|
|
179
181
|
size: "sm"
|
|
@@ -183,39 +185,39 @@ var _ = "...", v = ({ total: u, pageSize: v = 10, current: y = 1, onChange: b, o
|
|
|
183
185
|
]
|
|
184
186
|
})]
|
|
185
187
|
}),
|
|
186
|
-
|
|
188
|
+
D && /* @__PURE__ */ m("div", {
|
|
187
189
|
className: l.sizeChanger,
|
|
188
190
|
children: /* @__PURE__ */ m(ee, {
|
|
189
|
-
value: String(
|
|
190
|
-
onChange: (e) =>
|
|
191
|
-
options:
|
|
192
|
-
label: `${e} ${
|
|
191
|
+
value: String(J),
|
|
192
|
+
onChange: (e) => re(Number(e)),
|
|
193
|
+
options: O.map((e) => ({
|
|
194
|
+
label: `${e} ${R}`,
|
|
193
195
|
value: String(e)
|
|
194
196
|
})),
|
|
195
197
|
width: "auto",
|
|
196
|
-
"aria-label":
|
|
198
|
+
"aria-label": V
|
|
197
199
|
})
|
|
198
200
|
}),
|
|
199
|
-
|
|
201
|
+
A && /* @__PURE__ */ h("div", {
|
|
200
202
|
className: l.quickJumper,
|
|
201
203
|
children: [
|
|
202
|
-
/* @__PURE__ */ m("span", { children:
|
|
204
|
+
/* @__PURE__ */ m("span", { children: z }),
|
|
203
205
|
/* @__PURE__ */ m(c, {
|
|
204
206
|
type: "number",
|
|
205
207
|
min: 1,
|
|
206
|
-
max:
|
|
207
|
-
value:
|
|
208
|
-
onChange: (e) =>
|
|
209
|
-
onKeyDown:
|
|
208
|
+
max: Y,
|
|
209
|
+
value: K,
|
|
210
|
+
onChange: (e) => q(e.target.value),
|
|
211
|
+
onKeyDown: ie,
|
|
210
212
|
width: "60px",
|
|
211
|
-
"aria-label":
|
|
213
|
+
"aria-label": H
|
|
212
214
|
}),
|
|
213
215
|
/* @__PURE__ */ m(s, {
|
|
214
216
|
size: "sm",
|
|
215
217
|
variant: "outline",
|
|
216
218
|
onClick: Q,
|
|
217
|
-
disabled: !
|
|
218
|
-
children:
|
|
219
|
+
disabled: !K,
|
|
220
|
+
children: B
|
|
219
221
|
})
|
|
220
222
|
]
|
|
221
223
|
})
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../layout/Transition/Transition.cjs"),r=require("../../../icon/chevron-right.cjs"),i=require("../../media/Icon/Icon.cjs"),a=require("../../_internal/BaseListItem/BaseListItem.cjs"),o=require("./menu.module.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("classnames");c=e.__toESM(c,1);let l=require("react/jsx-runtime");var u=s.default.createContext({expandedItems:new Set,toggleItem:()=>{},containerRef:{current:null},mode:`vertical`,focusedIndex:0,setFocusedIndex:()=>{},registerItem:()=>0}),d=()=>{let e=s.default.useContext(u);if(!e)throw Error(`Menu sub-components must be used within a Menu`);return e},f=({children:e,className:n,asChild:r=!1,mode:i=`vertical`,defaultOpenKeys:a=[]})=>{let[
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../layout/Transition/Transition.cjs"),r=require("../../../icon/chevron-right.cjs"),i=require("../../media/Icon/Icon.cjs"),a=require("../../_internal/BaseListItem/BaseListItem.cjs"),o=require("./menu.module.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("classnames");c=e.__toESM(c,1);let l=require("react/jsx-runtime");var u=s.default.createContext({expandedItems:new Set,toggleItem:()=>{},containerRef:{current:null},mode:`vertical`,focusedIndex:0,setFocusedIndex:()=>{},registerItem:()=>0}),d=()=>{let e=s.default.useContext(u);if(!e)throw Error(`Menu sub-components must be used within a Menu`);return e},f=({children:e,className:n,asChild:r=!1,mode:i=`vertical`,defaultOpenKeys:a=[],"aria-label":d,"aria-labelledby":f})=>{let[p,m]=(0,s.useState)(new Set(a)),[h,g]=(0,s.useState)(0),_=s.default.useRef(0);s.default.useEffect(()=>{_.current=0});let v=()=>{let e=_.current;return _.current+=1,e},y=e=>{m(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},b=s.default.useRef(null),x=e=>{let t=Array.from(b.current?.querySelectorAll(`[role="menuitem"]:not([aria-disabled="true"])`)||[]),n=t.indexOf(document.activeElement);if(n!==-1){if(i===`vertical`||i===`inline`){if(e.key===`ArrowDown`)e.preventDefault(),t[(n+1)%t.length]?.focus();else if(e.key===`ArrowUp`)e.preventDefault(),t[(n-1+t.length)%t.length]?.focus();else if(e.key===`ArrowRight`){let r=t[n];r.getAttribute(`aria-haspopup`)===`true`&&r.getAttribute(`aria-expanded`)===`false`&&(e.preventDefault(),r.click())}else if(e.key===`ArrowLeft`){let r=t[n];r.getAttribute(`aria-haspopup`)===`true`&&r.getAttribute(`aria-expanded`)===`true`&&(e.preventDefault(),r.click())}}else if(i===`horizontal`){if(e.key===`ArrowRight`)e.preventDefault(),t[(n+1)%t.length]?.focus();else if(e.key===`ArrowLeft`)e.preventDefault(),t[(n-1+t.length)%t.length]?.focus();else if(e.key===`ArrowDown`){let r=t[n];r.getAttribute(`aria-haspopup`)===`true`&&r.getAttribute(`aria-expanded`)===`false`&&(e.preventDefault(),r.click())}}e.key===`Home`?(e.preventDefault(),g(0),t[0]?.focus()):e.key===`End`&&(e.preventDefault(),g(t.length-1),t[t.length-1]?.focus())}},S=r?t.Root:`ul`;return(0,l.jsx)(u.Provider,{value:{expandedItems:p,toggleItem:y,containerRef:b,mode:i,focusedIndex:h,setFocusedIndex:g,registerItem:v},children:(0,l.jsx)(S,{ref:b,className:(0,c.default)(`wim-menu`,o.default.root,o.default[i],n),role:`menu`,"aria-label":f?void 0:d,"aria-labelledby":f,onKeyDown:x,children:(0,l.jsx)(t.Slottable,{children:e})})})},p=({children:e,onClick:t,disabled:n=!1,danger:r=!1,className:i,icon:u,asChild:f=!1,...p})=>{let{focusedIndex:m,setFocusedIndex:h,registerItem:g}=d(),[_]=(0,s.useState)(()=>g()),v=m===_,y=e=>{e.stopPropagation(),!n&&t&&t()},b={className:(0,c.default)(o.default.item,i),onClick:y,onFocus:()=>h(_),disabled:n,danger:r,icon:u,role:`menuitem`,tabIndex:v?0:-1,onKeyDown:e=>{!n&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),y(e))},...p};return f?(0,l.jsx)(`li`,{role:`none`,children:(0,l.jsx)(a.BaseListItem,{asChild:!0,...b,children:e})}):(0,l.jsx)(a.BaseListItem,{asChild:!0,...b,children:(0,l.jsx)(`li`,{children:e})})},m=({children:e,title:t,className:n})=>{let r=s.default.useId();return(0,l.jsxs)(`li`,{className:(0,c.default)(o.default.itemGroup,n),role:`none`,children:[t&&(0,l.jsx)(`div`,{id:r,className:o.default.itemGroupTitle,"aria-hidden":`true`,children:t}),(0,l.jsx)(`ul`,{className:o.default.itemGroupList,role:`group`,"aria-labelledby":t?r:void 0,children:e})]})},h=({children:e,title:t,className:u,icon:f,itemKey:p})=>{let{expandedItems:m,toggleItem:h,registerItem:g,focusedIndex:_,setFocusedIndex:v}=d(),y=m.has(p),[b]=(0,s.useState)(()=>g()),x=_===b,S=s.default.useId(),C=e=>{e.stopPropagation(),h(p)};return(0,l.jsxs)(`li`,{className:(0,c.default)(o.default.submenu,y&&o.default.open,u),role:`none`,children:[(0,l.jsx)(a.BaseListItem,{id:S,className:o.default.submenuTitle,onClick:C,onFocus:()=>v(b),icon:f,rightSection:(0,l.jsx)(`span`,{className:(0,c.default)(o.default.submenuArrow,y&&o.default.open),children:(0,l.jsx)(i.Icon,{component:r.default,size:`sm`})}),role:`menuitem`,"aria-haspopup":`true`,"aria-expanded":y,tabIndex:x?0:-1,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),C(e))},children:t}),(0,l.jsx)(n.Transition,{show:y,preset:`fade`,className:o.default.submenuList,children:(0,l.jsx)(`ul`,{className:o.default.submenuList,role:`menu`,"aria-labelledby":S,children:e})})]})},g=({className:e})=>(0,l.jsx)(`li`,{className:(0,c.default)(o.default.divider,e),role:`separator`}),_=Object.assign(f,{Item:p,Group:m,SubMenu:h,Divider:g});exports.Menu=_,exports.default=_,exports.MenuDivider=g,exports.MenuItem=p,exports.MenuItemGroup=m,exports.SubMenu=h;
|
|
@@ -18,6 +18,10 @@ export type MenuProps = {
|
|
|
18
18
|
defaultSelectedKeys?: string[];
|
|
19
19
|
/** Default opened submenu keys */
|
|
20
20
|
defaultOpenKeys?: string[];
|
|
21
|
+
/** Accessible name for the menu. */
|
|
22
|
+
"aria-label"?: string;
|
|
23
|
+
/** ID of the element that labels the menu. Takes precedence over `aria-label`. */
|
|
24
|
+
"aria-labelledby"?: string;
|
|
21
25
|
};
|
|
22
26
|
export type MenuItemProps = {
|
|
23
27
|
children: ReactNode;
|
|
@@ -21,21 +21,21 @@ var f = s.createContext({
|
|
|
21
21
|
let e = s.useContext(f);
|
|
22
22
|
if (!e) throw Error("Menu sub-components must be used within a Menu");
|
|
23
23
|
return e;
|
|
24
|
-
}, m = ({ children: n, className: r, asChild: i = !1, mode: a = "vertical", defaultOpenKeys: d = [] }) => {
|
|
25
|
-
let [
|
|
24
|
+
}, m = ({ children: n, className: r, asChild: i = !1, mode: a = "vertical", defaultOpenKeys: d = [], "aria-label": p, "aria-labelledby": m }) => {
|
|
25
|
+
let [h, g] = c(new Set(d)), [_, v] = c(0), y = s.useRef(0);
|
|
26
26
|
s.useEffect(() => {
|
|
27
|
-
|
|
27
|
+
y.current = 0;
|
|
28
28
|
});
|
|
29
|
-
let
|
|
30
|
-
let e =
|
|
31
|
-
return
|
|
32
|
-
},
|
|
33
|
-
|
|
29
|
+
let b = () => {
|
|
30
|
+
let e = y.current;
|
|
31
|
+
return y.current += 1, e;
|
|
32
|
+
}, x = (e) => {
|
|
33
|
+
g((t) => {
|
|
34
34
|
let n = new Set(t);
|
|
35
35
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
36
36
|
});
|
|
37
|
-
},
|
|
38
|
-
let t = Array.from(
|
|
37
|
+
}, S = s.useRef(null), C = (e) => {
|
|
38
|
+
let t = Array.from(S.current?.querySelectorAll("[role=\"menuitem\"]:not([aria-disabled=\"true\"])") || []), n = t.indexOf(document.activeElement);
|
|
39
39
|
if (n !== -1) {
|
|
40
40
|
if (a === "vertical" || a === "inline") {
|
|
41
41
|
if (e.key === "ArrowDown") e.preventDefault(), t[(n + 1) % t.length]?.focus();
|
|
@@ -55,24 +55,26 @@ var f = s.createContext({
|
|
|
55
55
|
r.getAttribute("aria-haspopup") === "true" && r.getAttribute("aria-expanded") === "false" && (e.preventDefault(), r.click());
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
e.key === "Home" ? (e.preventDefault(),
|
|
58
|
+
e.key === "Home" ? (e.preventDefault(), v(0), t[0]?.focus()) : e.key === "End" && (e.preventDefault(), v(t.length - 1), t[t.length - 1]?.focus());
|
|
59
59
|
}
|
|
60
|
-
},
|
|
60
|
+
}, w = i ? e : "ul";
|
|
61
61
|
return /* @__PURE__ */ u(f.Provider, {
|
|
62
62
|
value: {
|
|
63
|
-
expandedItems:
|
|
64
|
-
toggleItem:
|
|
65
|
-
containerRef:
|
|
63
|
+
expandedItems: h,
|
|
64
|
+
toggleItem: x,
|
|
65
|
+
containerRef: S,
|
|
66
66
|
mode: a,
|
|
67
|
-
focusedIndex:
|
|
68
|
-
setFocusedIndex:
|
|
69
|
-
registerItem:
|
|
67
|
+
focusedIndex: _,
|
|
68
|
+
setFocusedIndex: v,
|
|
69
|
+
registerItem: b
|
|
70
70
|
},
|
|
71
|
-
children: /* @__PURE__ */ u(
|
|
72
|
-
ref:
|
|
71
|
+
children: /* @__PURE__ */ u(w, {
|
|
72
|
+
ref: S,
|
|
73
73
|
className: l("wim-menu", o.root, o[a], r),
|
|
74
74
|
role: "menu",
|
|
75
|
-
|
|
75
|
+
"aria-label": m ? void 0 : p,
|
|
76
|
+
"aria-labelledby": m,
|
|
77
|
+
onKeyDown: C,
|
|
76
78
|
children: /* @__PURE__ */ u(t, { children: n })
|
|
77
79
|
})
|
|
78
80
|
});
|
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.60.0 — a React 19 component library: 228 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
|
|
|
@@ -1075,6 +1075,8 @@ so the unit does not have to be repeated in the label.
|
|
|
1075
1075
|
- `size: Extract<ComponentSize, "sm" | "md" | "lg">` = "md" — Size of the button
|
|
1076
1076
|
- `className: string` — Additional class names
|
|
1077
1077
|
- `aria-label: string` — Accessible label for the button
|
|
1078
|
+
- `aria-labelledby: string` — ID of the element that labels the button. Takes precedence over `aria-label`.
|
|
1079
|
+
- `aria-describedby: string` — ID of the element that describes the button.
|
|
1078
1080
|
- `copyLabel: string` — Tooltip label before copying
|
|
1079
1081
|
- `copiedLabel: string` — Tooltip label after copying
|
|
1080
1082
|
- `asChild: boolean` = false — Whether to render as a child element.
|
|
@@ -1178,6 +1180,9 @@ them. Leave it undefined to let the area track its own selection.
|
|
|
1178
1180
|
- `required: boolean` — Whether to show the required indicator
|
|
1179
1181
|
- `layout: "vertical" | "horizontal"` = "vertical" — Layout direction of label and field
|
|
1180
1182
|
- `size: InteractiveAreaProps["size"]` = "md" — Size of the drop area
|
|
1183
|
+
- `aria-label: string` — Accessible name for the drop area when no visible `label` is provided.
|
|
1184
|
+
- `aria-labelledby: string` — ID of the element that labels the drop area when no visible `label` is provided.
|
|
1185
|
+
- `aria-describedby: string` — ID of the element that describes the drop area. Announced together with the error message.
|
|
1181
1186
|
- **FieldError** — Validation messages
|
|
1182
1187
|
- `content: string` (required) — Error message text
|
|
1183
1188
|
- `className: string` — Additional class names
|
|
@@ -1225,6 +1230,9 @@ it undefined to let the field track its own selection.
|
|
|
1225
1230
|
- `error: string` — Error message
|
|
1226
1231
|
- `required: boolean` — Whether to show the required indicator
|
|
1227
1232
|
- `layout: "vertical" | "horizontal"` = "vertical" — Layout direction of label and field
|
|
1233
|
+
- `aria-label: string` — Accessible name for the choose-file button when no visible `label` is provided.
|
|
1234
|
+
- `aria-labelledby: string` — ID of the element that labels the choose-file button when no visible `label` is provided.
|
|
1235
|
+
- `aria-describedby: string` — ID of the element that describes the choose-file button. Announced together with the error message.
|
|
1228
1236
|
- **FloatButton** — Floating action buttons
|
|
1229
1237
|
- `asChild: boolean` = false — If true, the button will be rendered as its child, merging its props onto that child.
|
|
1230
1238
|
- `iconName: "CircleIcon" | "SquareIcon" | "LoadingIcon" | "ExternalLinkIcon" | "ArrowUpIcon" | string` = "CircleIcon" — Icon name from the library
|
|
@@ -1507,6 +1515,9 @@ so the unit does not have to be repeated in the label.
|
|
|
1507
1515
|
- `className: string` — Additional class name
|
|
1508
1516
|
- `id: string` — Unique ID for the component
|
|
1509
1517
|
- `labels: QueryBuilderLabels` = {} — Labels for internationalization
|
|
1518
|
+
- `aria-label: string` — Accessible name for the query builder region. Takes precedence over `labels.regionAriaLabel`.
|
|
1519
|
+
- `aria-labelledby: string` — ID of the element that labels the query builder region. Takes precedence over `aria-label`.
|
|
1520
|
+
- `aria-describedby: string` — ID of the element that describes the query builder region.
|
|
1510
1521
|
- **Radio** — Single choice
|
|
1511
1522
|
- `asChild: boolean` = false — Whether to render as a child element.
|
|
1512
1523
|
- `children: React.ReactNode` — Label content rendered next to the radio
|
|
@@ -1692,6 +1703,8 @@ so the unit does not have to be repeated in the label.
|
|
|
1692
1703
|
- `required: boolean` — Whether to show the required indicator
|
|
1693
1704
|
- `layout: "vertical" | "horizontal"` = "vertical" — Layout direction of label and field
|
|
1694
1705
|
- `canvasAriaLabel: string` — Aria label for the canvas
|
|
1706
|
+
- `aria-label: string` — Accessible name for the canvas when no visible `label` is provided. Takes precedence over `canvasAriaLabel`.
|
|
1707
|
+
- `aria-labelledby: string` — ID of the element that labels the canvas when no visible `label` is provided.
|
|
1695
1708
|
- **Slider** — An input to capture a numeric value from a specified range by dragging a knob
|
|
1696
1709
|
- `value: number` — Current value (controlled)
|
|
1697
1710
|
- `defaultValue: number` = 0 — Default value (uncontrolled)
|
|
@@ -1990,6 +2003,8 @@ origin while the card it was meant to cover was 1248x75.
|
|
|
1990
2003
|
- `onClose: (id?: string) => void` — Callback when notification is closed
|
|
1991
2004
|
- `closable: boolean` = true — Whether to show close button
|
|
1992
2005
|
- `className: string` — Additional class name
|
|
2006
|
+
- `aria-label: string` — Accessible name for the notification.
|
|
2007
|
+
- `aria-labelledby: string` — ID of the element that labels the notification. Takes precedence over `aria-label`.
|
|
1993
2008
|
- **Progress** — Progress bar
|
|
1994
2009
|
- ⚠️ Not the same as elsewhere: Material's "Progress Indicator" covers indeterminate spinners as well. WIM's `Progress` is determinate and linear only — for the indeterminate case use `Spinner`.
|
|
1995
2010
|
- `value: number` = 0 — Current value of the progress bar.
|
|
@@ -2103,6 +2118,8 @@ follows the theme and never needs a hand-mixed colour.
|
|
|
2103
2118
|
@default true
|
|
2104
2119
|
- `onClose: (id?: string) => void` — Called with the toast id when the toast is closed.
|
|
2105
2120
|
- `className: string` — Additional CSS class name.
|
|
2121
|
+
- `aria-label: string` — Accessible name for the toast.
|
|
2122
|
+
- `aria-labelledby: string` — ID of the element that labels the toast. Takes precedence over `aria-label`.
|
|
2106
2123
|
- **Tour** — Sequential guided walkthroughs to onboard users or highlight features
|
|
2107
2124
|
- `steps: TourStep[]` (required) — Steps of the tour. Each step targets an element via a CSS selector.
|
|
2108
2125
|
- `open: boolean` (required) — Whether the tour is shown.
|
|
@@ -2134,6 +2151,8 @@ follows the theme and never needs a hand-mixed colour.
|
|
|
2134
2151
|
- `className: string` — Additional class names
|
|
2135
2152
|
- `style: React.CSSProperties` — Style attribute
|
|
2136
2153
|
- `aria-label: string` — Accessible label for the button
|
|
2154
|
+
- `aria-labelledby: string` — ID of the element that labels the button. Takes precedence over `aria-label`.
|
|
2155
|
+
- `aria-describedby: string` — ID of the element that describes the button.
|
|
2137
2156
|
- `asChild: boolean` = false — Whether to render as a child element.
|
|
2138
2157
|
- **Breadcrumb** — Location trace (aka Path Bar, Path Control)
|
|
2139
2158
|
- `items: BreadcrumbItem[]` (required) — Items to display, from the root to the current page.
|
|
@@ -2209,6 +2228,8 @@ Useful for URL-based pagination (e.g. wrap with a Link via PaginationPage asChil
|
|
|
2209
2228
|
- `showTotal: (total: number, range: [number, number]) => React.ReactNode` — Function to display the total count
|
|
2210
2229
|
- `showQuickJumper: boolean` = false — Whether to show quick jumper
|
|
2211
2230
|
- `labels: { prevPage?: string; nextPage?: string; pageAriaLabel?: (page: number) => string; itemsPerPage?: string; goTo?: string; go?: string; pageSizeAriaLabel?: string; jumpToPageAriaLabel?: string; navAriaLabel?: string; totalLabel?: string; }` = {} — Labels for internationalization
|
|
2231
|
+
- `aria-label: string` — Accessible name for the navigation landmark. Takes precedence over `labels.navAriaLabel`.
|
|
2232
|
+
- `aria-labelledby: string` — ID of the element that labels the navigation landmark. Takes precedence over `aria-label`.
|
|
2212
2233
|
- **SpeedDial** — Floating action button that expands sub-actions on hover or click.
|
|
2213
2234
|
- `actions: SpeedDialAction[]` (required) — Actions to display when SpeedDial is open
|
|
2214
2235
|
- `icon: keyof typeof ALL_ICONS` = "PlusIcon" — Icon name for the main button when closed
|
|
@@ -2466,6 +2487,8 @@ drops secondary text below the AA contrast floor.
|
|
|
2466
2487
|
- `infiniteScroll: { hasMore: boolean; onLoadMore: () => void; threshold?: number; }` — Infinite-scroll configuration for dynamic loading
|
|
2467
2488
|
- `className: string` — Additional class names
|
|
2468
2489
|
- `ariaLabel: string` — Accessibility label for the grid
|
|
2490
|
+
- `aria-label: string` — Accessible name for the grid. Takes precedence over `ariaLabel`.
|
|
2491
|
+
- `aria-labelledby: string` — ID of the element that labels the grid. Takes precedence over `aria-label`.
|
|
2469
2492
|
- **DescriptionList** — Key-value pairs
|
|
2470
2493
|
- `children: React.ReactNode` (required) — DescriptionListItem elements
|
|
2471
2494
|
- `className: string` — Additional class names
|
|
@@ -2490,6 +2513,8 @@ in; use `"center"` only when the empty state is the only thing in its region.
|
|
|
2490
2513
|
- left: title and description on the left, accordion on the right (desktop and up).
|
|
2491
2514
|
- `accordionProps: Omit<AccordionProps, "children">` — Props passed to the inner Accordion component.
|
|
2492
2515
|
- `className: string` — Additional class names.
|
|
2516
|
+
- `aria-label: string` — Accessible name for the section. A named section is exposed as a region landmark.
|
|
2517
|
+
- `aria-labelledby: string` — ID of the element that labels the section. Takes precedence over `aria-label`.
|
|
2493
2518
|
- **InfiniteScroll** — Infinite scroll control
|
|
2494
2519
|
- `children: React.ReactNode` (required) — Content to display.
|
|
2495
2520
|
- `hasMore: boolean` = false — Whether there is more data to load.
|
|
@@ -2773,6 +2798,8 @@ anything is measured; long text is truncated and read in full by assistive techn
|
|
|
2773
2798
|
- `virtualThreshold: number` = 100 — Node count threshold at which virtualization kicks in.
|
|
2774
2799
|
- `labels: { searchPlaceholder?: string; searchAriaLabel?: string; expandLabel?: (label: string) => string; collapseLabel?: (label: string) => string; treeAriaLabel?: string; }` = {} — Labels for internationalization
|
|
2775
2800
|
- `labelId: string` — Accessibility label ID
|
|
2801
|
+
- `aria-label: string` — Accessible name for the tree. Takes precedence over `labels.treeAriaLabel`.
|
|
2802
|
+
- `aria-labelledby: string` — ID of the element that labels the tree. Takes precedence over `aria-label`.
|
|
2776
2803
|
- `styles: { root?: string; item?: string; search?: string; searchInput?: string; labelContainer?: string; iconWrapper?: string; expandBtn?: string; checkbox?: string; icon?: string; }` — Custom styles for internal parts
|
|
2777
2804
|
- **VirtualList** — Efficiently renders large lists by virtualizing off-screen items
|
|
2778
2805
|
- `items: T[]` (required) — Array of items to display
|
|
@@ -2785,6 +2812,7 @@ anything is measured; long text is truncated and read in full by assistive techn
|
|
|
2785
2812
|
- `role: string` = "list" — Role of the whole list (for accessibility)
|
|
2786
2813
|
- `aria-label: string` — Accessible label
|
|
2787
2814
|
- `aria-labelledby: string` — ID of the element that labels the list
|
|
2815
|
+
- `aria-describedby: string` — ID of the element that describes the list
|
|
2788
2816
|
|
|
2789
2817
|
### overlay — `import { … } from "wimui/overlay"`
|
|
2790
2818
|
|
|
@@ -2855,6 +2883,8 @@ dismissed by an outside click or Escape.
|
|
|
2855
2883
|
- `mode: "vertical" | "horizontal" | "inline"` = "vertical" — Mode of the menu
|
|
2856
2884
|
- `defaultSelectedKeys: string[]` — Default selected keys
|
|
2857
2885
|
- `defaultOpenKeys: string[]` = [] — Default opened submenu keys
|
|
2886
|
+
- `aria-label: string` — Accessible name for the menu.
|
|
2887
|
+
- `aria-labelledby: string` — ID of the element that labels the menu. Takes precedence over `aria-label`.
|
|
2858
2888
|
- **Popconfirm** — Confirmation overlay
|
|
2859
2889
|
- `title: ReactNode` (required) — The title of the confirmation box
|
|
2860
2890
|
- `description: ReactNode` — The description of the confirmation box
|
|
@@ -3470,6 +3500,8 @@ written in the markdown. Default `"2xl"` keeps the historical mapping
|
|
|
3470
3500
|
- `index: number` — Numeric citation index shown as a badge (e.g. 1, 2, 3)
|
|
3471
3501
|
- `domain: string` — Domain label shown below the title (auto-derived from url when omitted)
|
|
3472
3502
|
- `className: string` — Additional CSS class
|
|
3503
|
+
- `aria-label: string` — Accessible name for the citation.
|
|
3504
|
+
- `aria-labelledby: string` — ID of the element that labels the citation. Takes precedence over `aria-label`.
|
|
3473
3505
|
- **StreamingText** — Renders text with a typewriter-like animation, ideal for AI chat responses.
|
|
3474
3506
|
- `content: string` (required) — The markdown text content to render
|
|
3475
3507
|
- `isStreaming: boolean` = false — When true, a blinking cursor is shown at the end of the content
|
package/dist/llms.txt
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## What this is
|
|
6
6
|
|
|
7
|
-
**wimui** v0.
|
|
7
|
+
**wimui** v0.60.0 — a React 19 component library: 228 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
|
|