wimui 0.59.0 → 0.60.1

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.
Files changed (73) hide show
  1. package/dist/components/_internal/useInlineFloating.cjs +2 -0
  2. package/dist/components/_internal/useInlineFloating.d.ts +54 -0
  3. package/dist/components/_internal/useInlineFloating.js +61 -0
  4. package/dist/components/ai/ModelSelector/ModelSelector.cjs +1 -1
  5. package/dist/components/ai/ModelSelector/ModelSelector.js +88 -84
  6. package/dist/components/ai/ModelSelector/model-selector.module.cjs +1 -1
  7. package/dist/components/ai/ModelSelector/model-selector.module.js +1 -1
  8. package/dist/components/ai/SourceCitation/SourceCitation.cjs +1 -1
  9. package/dist/components/ai/SourceCitation/SourceCitation.d.ts +5 -1
  10. package/dist/components/ai/SourceCitation/SourceCitation.js +10 -8
  11. package/dist/components/data-display/DataGrid/DataGrid.cjs +1 -1
  12. package/dist/components/data-display/DataGrid/DataGrid.d.ts +5 -1
  13. package/dist/components/data-display/DataGrid/DataGrid.js +54 -53
  14. package/dist/components/data-display/FAQSection/FAQSection.cjs +1 -1
  15. package/dist/components/data-display/FAQSection/FAQSection.d.ts +5 -1
  16. package/dist/components/data-display/FAQSection/FAQSection.js +5 -3
  17. package/dist/components/data-display/TreeView/TreeView.cjs +1 -1
  18. package/dist/components/data-display/TreeView/TreeView.d.ts +5 -1
  19. package/dist/components/data-display/TreeView/TreeView.js +87 -87
  20. package/dist/components/feedback/Notification/Notification.cjs +1 -1
  21. package/dist/components/feedback/Notification/Notification.d.ts +5 -1
  22. package/dist/components/feedback/Notification/Notification.js +10 -8
  23. package/dist/components/feedback/Toast/Toast.cjs +1 -1
  24. package/dist/components/feedback/Toast/Toast.d.ts +5 -1
  25. package/dist/components/feedback/Toast/Toast.js +11 -9
  26. package/dist/components/form/Cascader/Cascader.cjs +1 -1
  27. package/dist/components/form/Cascader/Cascader.js +89 -85
  28. package/dist/components/form/Cascader/cascader.module.cjs +1 -1
  29. package/dist/components/form/Cascader/cascader.module.js +6 -6
  30. package/dist/components/form/Combobox/Combobox.cjs +1 -1
  31. package/dist/components/form/Combobox/Combobox.js +108 -102
  32. package/dist/components/form/Combobox/combobox.module.cjs +1 -1
  33. package/dist/components/form/Combobox/combobox.module.js +1 -1
  34. package/dist/components/form/DatePicker/DatePicker.cjs +1 -1
  35. package/dist/components/form/DatePicker/DatePicker.js +90 -85
  36. package/dist/components/form/DatePicker/date-picker.module.cjs +1 -1
  37. package/dist/components/form/DatePicker/date-picker.module.js +1 -1
  38. package/dist/components/form/Mentions/Mentions.cjs +1 -1
  39. package/dist/components/form/Mentions/Mentions.js +4 -4
  40. package/dist/components/form/MultiSelect/MultiSelect.cjs +1 -1
  41. package/dist/components/form/MultiSelect/MultiSelect.js +80 -77
  42. package/dist/components/form/MultiSelect/multiselect.module.cjs +1 -1
  43. package/dist/components/form/MultiSelect/multiselect.module.js +1 -1
  44. package/dist/components/form/PhoneInput/PhoneInput.cjs +1 -1
  45. package/dist/components/form/PhoneInput/PhoneInput.js +117 -111
  46. package/dist/components/form/PhoneInput/phone-input.module.cjs +1 -1
  47. package/dist/components/form/PhoneInput/phone-input.module.js +1 -1
  48. package/dist/components/form/Select/Select.cjs +1 -1
  49. package/dist/components/form/Select/Select.js +96 -89
  50. package/dist/components/form/Select/select.module.cjs +1 -1
  51. package/dist/components/form/Select/select.module.js +1 -1
  52. package/dist/components/form/SignaturePad/SignaturePad.cjs +1 -1
  53. package/dist/components/form/SignaturePad/SignaturePad.d.ts +5 -1
  54. package/dist/components/form/SignaturePad/SignaturePad.js +47 -47
  55. package/dist/components/form/TreeSelect/TreeSelect.cjs +1 -1
  56. package/dist/components/form/TreeSelect/TreeSelect.js +115 -112
  57. package/dist/components/form/TreeSelect/tree-select.module.cjs +1 -1
  58. package/dist/components/form/TreeSelect/tree-select.module.js +6 -6
  59. package/dist/components/navigation/CommandPalette/CommandPalette.cjs +1 -1
  60. package/dist/components/navigation/CommandPalette/CommandPalette.d.ts +5 -1
  61. package/dist/components/navigation/CommandPalette/CommandPalette.js +11 -6
  62. package/dist/components/navigation/Pagination/Pagination.cjs +1 -1
  63. package/dist/components/navigation/Pagination/Pagination.d.ts +5 -1
  64. package/dist/components/navigation/Pagination/Pagination.js +65 -63
  65. package/dist/components/overlay/Menu/Menu.cjs +1 -1
  66. package/dist/components/overlay/Menu/Menu.d.ts +4 -0
  67. package/dist/components/overlay/Menu/Menu.js +23 -21
  68. package/dist/llms-full.txt +19 -1
  69. package/dist/llms.txt +1 -1
  70. package/dist/styles.css +1 -1
  71. package/dist/wimui.umd.css +1 -1
  72. package/dist/wimui.umd.js +5 -5
  73. package/package.json +4 -4
@@ -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: te, siblingCount: x = 1, className: S, asChild: C = !1, children: w, renderPage: T, hideOnSinglePage: E = !1, simple: D = !1, showSizeChanger: O = !1, pageSizeOptions: k = [
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: A, showQuickJumper: j = !1, labels: M = {} }) => {
31
- let { t: N } = n(r), { prevPage: P = N("a11y.go_to_prev_page"), nextPage: F = N("a11y.go_to_next_page"), pageAriaLabel: I = (e) => N("a11y.go_to_page", { page: String(e) }), itemsPerPage: L = N("pagination.items_per_page"), goTo: R = N("pagination.go_to"), go: z = N("pagination.go"), pageSizeAriaLabel: B = N("a11y.items_per_page"), jumpToPageAriaLabel: V = N("a11y.jump_to_page"), navAriaLabel: H = N("a11y.pagination_nav") } = M, [U, W] = f(v), [G, K] = f(""), q = U, J = Math.ceil(u / q), Y = d(() => {
32
- if (x + 5 >= J) return Array.from({ length: J }, (e, t) => t + 1);
33
- let e = Math.max(y - x, 1), t = Math.min(y + x, J), n = e > 2, r = t < J - 2, i = J;
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 * x;
35
+ let e = 3 + 2 * S;
36
36
  return [
37
37
  ...Array.from({ length: e }, (e, t) => t + 1),
38
38
  _,
39
- J
39
+ Y
40
40
  ];
41
41
  }
42
42
  if (n && !r) {
43
- let e = 3 + 2 * x;
43
+ let e = 3 + 2 * S;
44
44
  return [
45
45
  1,
46
46
  _,
47
- ...Array.from({ length: e }, (t, n) => J - e + n + 1)
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
- J,
59
- x,
58
+ Y,
59
+ S,
60
60
  y
61
61
  ]);
62
- if (E && J <= 1) return null;
63
- let X = (e) => {
64
- e < 1 || e > J || e === y || b?.(e, q);
65
- }, Z = (e) => {
66
- W(e), te?.(e), b?.(1, e);
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(G);
69
- !isNaN(e) && e >= 1 && e <= J && (X(e), K(""));
70
- }, ne = (e) => {
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
- }, re = (y - 1) * q + 1, ie = Math.min(y * q, u), $ = C ? e : "nav", ae = (e) => {
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: () => X(e),
77
- "aria-label": I(e)
76
+ onClick: () => Z(e),
77
+ "aria-label": L(e)
78
78
  };
79
- return T ? T(e, t) : /* @__PURE__ */ m(g, {
79
+ return E ? E(e, t) : /* @__PURE__ */ m(g, {
80
80
  ...t,
81
81
  children: e
82
82
  });
83
83
  };
84
- return D ? /* @__PURE__ */ h($, {
85
- className: p("wim-pagination", l.root, l.simple, S),
86
- "aria-label": H,
87
- children: [/* @__PURE__ */ m(t, { children: w }), /* @__PURE__ */ h("ul", {
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: () => X(y - 1),
95
+ onClick: () => Z(y - 1),
95
96
  disabled: y === 1,
96
- "aria-label": P,
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
- J
109
+ Y
109
110
  ] })
110
111
  }),
111
112
  /* @__PURE__ */ m("li", {
112
- className: p(l.item, y === J && l.disabled),
113
+ className: p(l.item, y === Y && l.disabled),
113
114
  children: /* @__PURE__ */ m("button", {
114
115
  className: l.button,
115
- onClick: () => X(y + 1),
116
- disabled: y === J,
117
- "aria-label": F,
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, S),
128
+ className: p("wim-pagination", l.container, C),
128
129
  children: /* @__PURE__ */ h("div", {
129
130
  className: l.wrapper,
130
131
  children: [
131
- A && /* @__PURE__ */ m("div", {
132
+ k && /* @__PURE__ */ m("div", {
132
133
  className: l.total,
133
- children: A(u, [re, ie])
134
+ children: k(u, [ae, oe])
134
135
  }),
135
136
  /* @__PURE__ */ h($, {
136
137
  className: l.root,
137
- "aria-label": H,
138
- children: [/* @__PURE__ */ m(t, { children: w }), /* @__PURE__ */ h("ul", {
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: () => X(y - 1),
147
+ onClick: () => Z(y - 1),
146
148
  disabled: y === 1,
147
- "aria-label": P,
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
- J
161
+ Y
160
162
  ] })
161
163
  }),
162
- Y.map((e, t) => e === _ ? /* @__PURE__ */ m("li", {
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: ae(e)
170
+ children: se(e)
169
171
  }, e)),
170
172
  /* @__PURE__ */ m("li", {
171
- className: p(l.item, y === J && l.disabled),
173
+ className: p(l.item, y === Y && l.disabled),
172
174
  children: /* @__PURE__ */ m("button", {
173
175
  className: l.button,
174
- onClick: () => X(y + 1),
175
- disabled: y === J,
176
- "aria-label": F,
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
- O && /* @__PURE__ */ m("div", {
188
+ D && /* @__PURE__ */ m("div", {
187
189
  className: l.sizeChanger,
188
190
  children: /* @__PURE__ */ m(ee, {
189
- value: String(q),
190
- onChange: (e) => Z(Number(e)),
191
- options: k.map((e) => ({
192
- label: `${e} ${L}`,
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": B
198
+ "aria-label": V
197
199
  })
198
200
  }),
199
- j && /* @__PURE__ */ h("div", {
201
+ A && /* @__PURE__ */ h("div", {
200
202
  className: l.quickJumper,
201
203
  children: [
202
- /* @__PURE__ */ m("span", { children: R }),
204
+ /* @__PURE__ */ m("span", { children: z }),
203
205
  /* @__PURE__ */ m(c, {
204
206
  type: "number",
205
207
  min: 1,
206
- max: J,
207
- value: G,
208
- onChange: (e) => K(e.target.value),
209
- onKeyDown: ne,
208
+ max: Y,
209
+ value: K,
210
+ onChange: (e) => q(e.target.value),
211
+ onKeyDown: ie,
210
212
  width: "60px",
211
- "aria-label": V
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: !G,
218
- children: z
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[d,f]=(0,s.useState)(new Set(a)),[p,m]=(0,s.useState)(0),h=s.default.useRef(0);s.default.useEffect(()=>{h.current=0});let g=()=>{let e=h.current;return h.current+=1,e},_=e=>{f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},v=s.default.useRef(null),y=e=>{let t=Array.from(v.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(),m(0),t[0]?.focus()):e.key===`End`&&(e.preventDefault(),m(t.length-1),t[t.length-1]?.focus())}},b=r?t.Root:`ul`;return(0,l.jsx)(u.Provider,{value:{expandedItems:d,toggleItem:_,containerRef:v,mode:i,focusedIndex:p,setFocusedIndex:m,registerItem:g},children:(0,l.jsx)(b,{ref:v,className:(0,c.default)(`wim-menu`,o.default.root,o.default[i],n),role:`menu`,onKeyDown:y,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;
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 [p, m] = c(new Set(d)), [h, g] = c(0), _ = s.useRef(0);
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
- _.current = 0;
27
+ y.current = 0;
28
28
  });
29
- let v = () => {
30
- let e = _.current;
31
- return _.current += 1, e;
32
- }, y = (e) => {
33
- m((t) => {
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
- }, b = s.useRef(null), x = (e) => {
38
- let t = Array.from(b.current?.querySelectorAll("[role=\"menuitem\"]:not([aria-disabled=\"true\"])") || []), n = t.indexOf(document.activeElement);
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(), g(0), t[0]?.focus()) : e.key === "End" && (e.preventDefault(), g(t.length - 1), t[t.length - 1]?.focus());
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
- }, S = i ? e : "ul";
60
+ }, w = i ? e : "ul";
61
61
  return /* @__PURE__ */ u(f.Provider, {
62
62
  value: {
63
- expandedItems: p,
64
- toggleItem: y,
65
- containerRef: b,
63
+ expandedItems: h,
64
+ toggleItem: x,
65
+ containerRef: S,
66
66
  mode: a,
67
- focusedIndex: h,
68
- setFocusedIndex: g,
69
- registerItem: v
67
+ focusedIndex: _,
68
+ setFocusedIndex: v,
69
+ registerItem: b
70
70
  },
71
- children: /* @__PURE__ */ u(S, {
72
- ref: b,
71
+ children: /* @__PURE__ */ u(w, {
72
+ ref: S,
73
73
  className: l("wim-menu", o.root, o[a], r),
74
74
  role: "menu",
75
- onKeyDown: x,
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
  });
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## What this is
6
6
 
7
- **wimui** v0.59.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).
7
+ **wimui** v0.60.1 — 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
 
@@ -1703,6 +1703,8 @@ so the unit does not have to be repeated in the label.
1703
1703
  - `required: boolean` — Whether to show the required indicator
1704
1704
  - `layout: "vertical" | "horizontal"` = "vertical" — Layout direction of label and field
1705
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.
1706
1708
  - **Slider** — An input to capture a numeric value from a specified range by dragging a knob
1707
1709
  - `value: number` — Current value (controlled)
1708
1710
  - `defaultValue: number` = 0 — Default value (uncontrolled)
@@ -2001,6 +2003,8 @@ origin while the card it was meant to cover was 1248x75.
2001
2003
  - `onClose: (id?: string) => void` — Callback when notification is closed
2002
2004
  - `closable: boolean` = true — Whether to show close button
2003
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`.
2004
2008
  - **Progress** — Progress bar
2005
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`.
2006
2010
  - `value: number` = 0 — Current value of the progress bar.
@@ -2114,6 +2118,8 @@ follows the theme and never needs a hand-mixed colour.
2114
2118
  @default true
2115
2119
  - `onClose: (id?: string) => void` — Called with the toast id when the toast is closed.
2116
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`.
2117
2123
  - **Tour** — Sequential guided walkthroughs to onboard users or highlight features
2118
2124
  - `steps: TourStep[]` (required) — Steps of the tour. Each step targets an element via a CSS selector.
2119
2125
  - `open: boolean` (required) — Whether the tour is shown.
@@ -2222,6 +2228,8 @@ Useful for URL-based pagination (e.g. wrap with a Link via PaginationPage asChil
2222
2228
  - `showTotal: (total: number, range: [number, number]) => React.ReactNode` — Function to display the total count
2223
2229
  - `showQuickJumper: boolean` = false — Whether to show quick jumper
2224
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`.
2225
2233
  - **SpeedDial** — Floating action button that expands sub-actions on hover or click.
2226
2234
  - `actions: SpeedDialAction[]` (required) — Actions to display when SpeedDial is open
2227
2235
  - `icon: keyof typeof ALL_ICONS` = "PlusIcon" — Icon name for the main button when closed
@@ -2479,6 +2487,8 @@ drops secondary text below the AA contrast floor.
2479
2487
  - `infiniteScroll: { hasMore: boolean; onLoadMore: () => void; threshold?: number; }` — Infinite-scroll configuration for dynamic loading
2480
2488
  - `className: string` — Additional class names
2481
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`.
2482
2492
  - **DescriptionList** — Key-value pairs
2483
2493
  - `children: React.ReactNode` (required) — DescriptionListItem elements
2484
2494
  - `className: string` — Additional class names
@@ -2503,6 +2513,8 @@ in; use `"center"` only when the empty state is the only thing in its region.
2503
2513
  - left: title and description on the left, accordion on the right (desktop and up).
2504
2514
  - `accordionProps: Omit<AccordionProps, "children">` — Props passed to the inner Accordion component.
2505
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`.
2506
2518
  - **InfiniteScroll** — Infinite scroll control
2507
2519
  - `children: React.ReactNode` (required) — Content to display.
2508
2520
  - `hasMore: boolean` = false — Whether there is more data to load.
@@ -2786,6 +2798,8 @@ anything is measured; long text is truncated and read in full by assistive techn
2786
2798
  - `virtualThreshold: number` = 100 — Node count threshold at which virtualization kicks in.
2787
2799
  - `labels: { searchPlaceholder?: string; searchAriaLabel?: string; expandLabel?: (label: string) => string; collapseLabel?: (label: string) => string; treeAriaLabel?: string; }` = {} — Labels for internationalization
2788
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`.
2789
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
2790
2804
  - **VirtualList** — Efficiently renders large lists by virtualizing off-screen items
2791
2805
  - `items: T[]` (required) — Array of items to display
@@ -2869,6 +2883,8 @@ dismissed by an outside click or Escape.
2869
2883
  - `mode: "vertical" | "horizontal" | "inline"` = "vertical" — Mode of the menu
2870
2884
  - `defaultSelectedKeys: string[]` — Default selected keys
2871
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`.
2872
2888
  - **Popconfirm** — Confirmation overlay
2873
2889
  - `title: ReactNode` (required) — The title of the confirmation box
2874
2890
  - `description: ReactNode` — The description of the confirmation box
@@ -3484,6 +3500,8 @@ written in the markdown. Default `"2xl"` keeps the historical mapping
3484
3500
  - `index: number` — Numeric citation index shown as a badge (e.g. 1, 2, 3)
3485
3501
  - `domain: string` — Domain label shown below the title (auto-derived from url when omitted)
3486
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`.
3487
3505
  - **StreamingText** — Renders text with a typewriter-like animation, ideal for AI chat responses.
3488
3506
  - `content: string` (required) — The markdown text content to render
3489
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.59.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).
7
+ **wimui** v0.60.1 — 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