wimui 0.58.0 → 0.59.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.
Files changed (34) hide show
  1. package/dist/components/ai/PromptInput/PromptInput.cjs +1 -1
  2. package/dist/components/ai/PromptInput/PromptInput.js +30 -30
  3. package/dist/components/ai/Terminal/Terminal.cjs +2 -2
  4. package/dist/components/ai/Terminal/Terminal.js +16 -14
  5. package/dist/components/data-display/VirtualList/VirtualList.cjs +1 -1
  6. package/dist/components/data-display/VirtualList/VirtualList.d.ts +2 -0
  7. package/dist/components/data-display/VirtualList/VirtualList.js +15 -14
  8. package/dist/components/form/CopyButton/CopyButton.cjs +1 -1
  9. package/dist/components/form/CopyButton/CopyButton.d.ts +5 -1
  10. package/dist/components/form/CopyButton/CopyButton.js +17 -15
  11. package/dist/components/form/Dropzone/Dropzone.cjs +1 -1
  12. package/dist/components/form/Dropzone/Dropzone.d.ts +7 -1
  13. package/dist/components/form/Dropzone/Dropzone.js +29 -28
  14. package/dist/components/form/FileUpload/FileUpload.cjs +1 -1
  15. package/dist/components/form/FileUpload/FileUpload.d.ts +7 -1
  16. package/dist/components/form/FileUpload/FileUpload.js +22 -17
  17. package/dist/components/form/ImageCropper/ImageCropper.cjs +1 -1
  18. package/dist/components/form/ImageCropper/ImageCropper.js +102 -100
  19. package/dist/components/form/InlineEdit/InlineEdit.cjs +1 -1
  20. package/dist/components/form/InlineEdit/InlineEdit.js +62 -60
  21. package/dist/components/form/QueryBuilder/QueryBuilder.cjs +1 -1
  22. package/dist/components/form/QueryBuilder/QueryBuilder.d.ts +7 -1
  23. package/dist/components/form/QueryBuilder/QueryBuilder.js +104 -102
  24. package/dist/components/form/ThemeToggle/ThemeToggle.cjs +1 -1
  25. package/dist/components/form/ThemeToggle/ThemeToggle.js +59 -54
  26. package/dist/components/media/ImageCompare/ImageCompare.cjs +1 -1
  27. package/dist/components/media/ImageCompare/ImageCompare.js +33 -31
  28. package/dist/components/navigation/BackTop/BackTop.cjs +1 -1
  29. package/dist/components/navigation/BackTop/BackTop.d.ts +4 -0
  30. package/dist/components/navigation/BackTop/BackTop.js +18 -16
  31. package/dist/llms-full.txt +15 -1
  32. package/dist/llms.txt +1 -1
  33. package/dist/wimui.umd.js +4 -4
  34. package/package.json +1 -1
@@ -9,38 +9,38 @@ import o, { useCallback as s, useRef as c, useState as l } from "react";
9
9
  import u from "classnames";
10
10
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
11
11
  //#region src/components/media/ImageCompare/ImageCompare.tsx
12
- var p = (e) => Math.max(0, Math.min(100, e)), m = o.forwardRef(({ before: o, after: m, beforeAlt: h = "", afterAlt: g = "", beforeLabel: _, afterLabel: v, defaultPosition: y = 50, position: b, onPositionChange: x, orientation: S = "horizontal", width: C, height: w, radius: T = "md", labels: E, className: D, ...O }, k) => {
13
- let { t: A } = e(t), { handleAriaLabel: j = A("imageCompare.handle") } = E ?? {}, M = b !== void 0, [N, P] = l(p(y)), F = p(M ? b : N), I = S === "vertical", L = c(null), R = c(!1), z = s((e) => {
14
- L.current = e, typeof k == "function" ? k(e) : k && (k.current = e);
15
- }, [k]), B = s((e) => {
12
+ var p = (e) => Math.max(0, Math.min(100, e)), m = o.forwardRef(({ before: o, after: m, beforeAlt: h = "", afterAlt: g = "", beforeLabel: _, afterLabel: v, defaultPosition: y = 50, position: b, onPositionChange: x, orientation: S = "horizontal", width: C, height: w, radius: T = "md", labels: E, className: D, "aria-label": O, "aria-labelledby": k, "aria-describedby": A, ...j }, M) => {
13
+ let { t: N } = e(t), { handleAriaLabel: P = N("imageCompare.handle") } = E ?? {}, F = b !== void 0, [I, L] = l(p(y)), R = p(F ? b : I), z = S === "vertical", B = c(null), V = c(!1), H = s((e) => {
14
+ B.current = e, typeof M == "function" ? M(e) : M && (M.current = e);
15
+ }, [M]), U = s((e) => {
16
16
  let t = p(e);
17
- M || P(t), x?.(t);
18
- }, [M, x]), V = s((e, t) => {
19
- let n = L.current?.getBoundingClientRect();
17
+ F || L(t), x?.(t);
18
+ }, [F, x]), W = s((e, t) => {
19
+ let n = B.current?.getBoundingClientRect();
20
20
  if (!n) return;
21
- let r = I ? (t - n.top) / n.height * 100 : (e - n.left) / n.width * 100;
22
- B(r);
23
- }, [I, B]), H = (e) => {
24
- R.current = !0, e.currentTarget.setPointerCapture(e.pointerId), V(e.clientX, e.clientY);
25
- }, U = (e) => {
26
- R.current && V(e.clientX, e.clientY);
27
- }, W = (e) => {
28
- R.current = !1, e.currentTarget.releasePointerCapture?.(e.pointerId);
29
- }, G = (e) => {
30
- let t = e.shiftKey ? 10 : 2, n = I ? "ArrowUp" : "ArrowLeft", r = I ? "ArrowDown" : "ArrowRight";
31
- e.key === n ? (e.preventDefault(), B(F - t)) : e.key === r ? (e.preventDefault(), B(F + t)) : e.key === "Home" ? (e.preventDefault(), B(0)) : e.key === "End" && (e.preventDefault(), B(100));
32
- }, K = I ? { clipPath: `inset(0 0 ${100 - F}% 0)` } : { clipPath: `inset(0 ${100 - F}% 0 0)` }, q = I ? { top: `${F}%` } : { left: `${F}%` };
21
+ let r = z ? (t - n.top) / n.height * 100 : (e - n.left) / n.width * 100;
22
+ U(r);
23
+ }, [z, U]), G = (e) => {
24
+ V.current = !0, e.currentTarget.setPointerCapture(e.pointerId), W(e.clientX, e.clientY);
25
+ }, K = (e) => {
26
+ V.current && W(e.clientX, e.clientY);
27
+ }, q = (e) => {
28
+ V.current = !1, e.currentTarget.releasePointerCapture?.(e.pointerId);
29
+ }, J = (e) => {
30
+ let t = e.shiftKey ? 10 : 2, n = z ? "ArrowUp" : "ArrowLeft", r = z ? "ArrowDown" : "ArrowRight";
31
+ e.key === n ? (e.preventDefault(), U(R - t)) : e.key === r ? (e.preventDefault(), U(R + t)) : e.key === "Home" ? (e.preventDefault(), U(0)) : e.key === "End" && (e.preventDefault(), U(100));
32
+ }, Y = z ? { clipPath: `inset(0 0 ${100 - R}% 0)` } : { clipPath: `inset(0 ${100 - R}% 0 0)` }, X = z ? { top: `${R}%` } : { left: `${R}%` };
33
33
  return /* @__PURE__ */ f("div", {
34
- ref: z,
35
- className: u("wim-image-compare", a.root, I && a.vertical, a[`radius-${T}`], D),
34
+ ref: H,
35
+ className: u("wim-image-compare", a.root, z && a.vertical, a[`radius-${T}`], D),
36
36
  style: {
37
37
  width: C,
38
38
  height: w
39
39
  },
40
- onPointerDown: H,
41
- onPointerMove: U,
42
- onPointerUp: W,
43
- ...O,
40
+ onPointerDown: G,
41
+ onPointerMove: K,
42
+ onPointerUp: q,
43
+ ...j,
44
44
  children: [
45
45
  /* @__PURE__ */ d("img", {
46
46
  className: a.image,
@@ -54,7 +54,7 @@ var p = (e) => Math.max(0, Math.min(100, e)), m = o.forwardRef(({ before: o, aft
54
54
  }),
55
55
  /* @__PURE__ */ f("div", {
56
56
  className: a.beforeLayer,
57
- style: K,
57
+ style: Y,
58
58
  children: [/* @__PURE__ */ d("img", {
59
59
  className: a.image,
60
60
  src: o,
@@ -67,7 +67,7 @@ var p = (e) => Math.max(0, Math.min(100, e)), m = o.forwardRef(({ before: o, aft
67
67
  }),
68
68
  /* @__PURE__ */ f("div", {
69
69
  className: a.divider,
70
- style: q,
70
+ style: X,
71
71
  children: [/* @__PURE__ */ d("span", {
72
72
  className: a.line,
73
73
  "aria-hidden": "true"
@@ -75,13 +75,15 @@ var p = (e) => Math.max(0, Math.min(100, e)), m = o.forwardRef(({ before: o, aft
75
75
  type: "button",
76
76
  className: a.handle,
77
77
  role: "slider",
78
- "aria-label": j,
78
+ "aria-label": k ? void 0 : O ?? P,
79
+ "aria-labelledby": k,
80
+ "aria-describedby": A,
79
81
  "aria-orientation": S,
80
- "aria-valuenow": Math.round(F),
82
+ "aria-valuenow": Math.round(R),
81
83
  "aria-valuemin": 0,
82
84
  "aria-valuemax": 100,
83
- onKeyDown: G,
84
- onPointerDown: H,
85
+ onKeyDown: J,
86
+ onPointerDown: G,
85
87
  children: [/* @__PURE__ */ d(i, {
86
88
  component: n,
87
89
  size: "sm",
@@ -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("../../../i18n/useWimTranslation.cjs"),r=require("../../../i18n/generated/common.cjs"),i=require("../../../icon/chevron-up.cjs"),a=require("../../media/Icon/Icon.cjs"),o=require("./backtop.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.forwardRef(({target:e=()=>window,visibilityHeight:u=400,onClick:d,children:f,className:p,style:m,"aria-label":h,asChild:g=!1},_)=>{let{t:v}=n.useWimTranslation(r.commonNs),[y,b]=(0,s.useState)(!1),x=(0,s.useCallback)(e=>e===window||e instanceof Window?window.pageYOffset||document.documentElement.scrollTop:e instanceof Document?document.documentElement.scrollTop:e.scrollTop,[]),S=(0,s.useCallback)(()=>{let t=e();if(!t)return;let n=x(t);b(n>u)},[e,u,x]);(0,s.useEffect)(()=>{let t=e();if(t)return requestAnimationFrame(S),t.addEventListener(`scroll`,S),()=>{t.removeEventListener(`scroll`,S)}},[e,S]);let C=t=>{let n=e();n&&(n===window||n instanceof Window?window.scrollTo({top:0,behavior:`smooth`}):n instanceof Document?document.documentElement.scrollTo({top:0,behavior:`smooth`}):n.scrollTo({top:0,behavior:`smooth`}),d?.(t))},w=(0,l.jsx)(`div`,{className:o.default.content,children:(0,l.jsx)(a.Icon,{component:i.default,className:o.default.icon})});return(0,l.jsx)(g?t.Root:`div`,{ref:_,className:(0,c.default)(`wim-back-top`,o.default.root,!y&&o.default.hidden,p),style:m,onClick:C,role:`button`,tabIndex:0,"aria-label":h??v(`a11y.back_to_top`),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&e.currentTarget.click()},children:(0,l.jsx)(t.Slottable,{children:f||w})})});u.displayName=`BackTop`,exports.BackTop=u,exports.default=u;
2
+ const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../i18n/useWimTranslation.cjs"),r=require("../../../i18n/generated/common.cjs"),i=require("../../../icon/chevron-up.cjs"),a=require("../../media/Icon/Icon.cjs"),o=require("./backtop.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.forwardRef(({target:e=()=>window,visibilityHeight:u=400,onClick:d,children:f,className:p,style:m,"aria-label":h,"aria-labelledby":g,"aria-describedby":_,asChild:v=!1},y)=>{let{t:b}=n.useWimTranslation(r.commonNs),[x,S]=(0,s.useState)(!1),C=(0,s.useCallback)(e=>e===window||e instanceof Window?window.pageYOffset||document.documentElement.scrollTop:e instanceof Document?document.documentElement.scrollTop:e.scrollTop,[]),w=(0,s.useCallback)(()=>{let t=e();if(!t)return;let n=C(t);S(n>u)},[e,u,C]);(0,s.useEffect)(()=>{let t=e();if(t)return requestAnimationFrame(w),t.addEventListener(`scroll`,w),()=>{t.removeEventListener(`scroll`,w)}},[e,w]);let T=t=>{let n=e();n&&(n===window||n instanceof Window?window.scrollTo({top:0,behavior:`smooth`}):n instanceof Document?document.documentElement.scrollTo({top:0,behavior:`smooth`}):n.scrollTo({top:0,behavior:`smooth`}),d?.(t))},E=(0,l.jsx)(`div`,{className:o.default.content,children:(0,l.jsx)(a.Icon,{component:i.default,className:o.default.icon})});return(0,l.jsx)(v?t.Root:`div`,{ref:y,className:(0,c.default)(`wim-back-top`,o.default.root,!x&&o.default.hidden,p),style:m,onClick:T,role:`button`,tabIndex:0,"aria-label":g?void 0:h??b(`a11y.back_to_top`),"aria-labelledby":g,"aria-describedby":_,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&e.currentTarget.click()},children:(0,l.jsx)(t.Slottable,{children:f||E})})});u.displayName=`BackTop`,exports.BackTop=u,exports.default=u;
@@ -14,6 +14,10 @@ export interface BackTopProps {
14
14
  style?: React.CSSProperties;
15
15
  /** Accessible label for the button */
16
16
  "aria-label"?: string;
17
+ /** ID of the element that labels the button. Takes precedence over `aria-label`. */
18
+ "aria-labelledby"?: string;
19
+ /** ID of the element that describes the button. */
20
+ "aria-describedby"?: string;
17
21
  /** Whether to render as a child element. */
18
22
  asChild?: boolean;
19
23
  }
@@ -9,24 +9,24 @@ import s, { useCallback as c, useEffect as l, useState as u } from "react";
9
9
  import d from "classnames";
10
10
  import { jsx as f } from "react/jsx-runtime";
11
11
  //#region src/components/navigation/BackTop/BackTop.tsx
12
- var p = s.forwardRef(({ target: s = () => window, visibilityHeight: p = 400, onClick: m, children: h, className: g, style: _, "aria-label": v, asChild: y = !1 }, b) => {
13
- let { t: x } = n(r), [S, C] = u(!1), w = c((e) => e === window || e instanceof Window ? window.pageYOffset || document.documentElement.scrollTop : e instanceof Document ? document.documentElement.scrollTop : e.scrollTop, []), T = c(() => {
12
+ var p = s.forwardRef(({ target: s = () => window, visibilityHeight: p = 400, onClick: m, children: h, className: g, style: _, "aria-label": v, "aria-labelledby": y, "aria-describedby": b, asChild: x = !1 }, S) => {
13
+ let { t: C } = n(r), [w, T] = u(!1), E = c((e) => e === window || e instanceof Window ? window.pageYOffset || document.documentElement.scrollTop : e instanceof Document ? document.documentElement.scrollTop : e.scrollTop, []), D = c(() => {
14
14
  let e = s();
15
15
  if (!e) return;
16
- let t = w(e);
17
- C(t > p);
16
+ let t = E(e);
17
+ T(t > p);
18
18
  }, [
19
19
  s,
20
20
  p,
21
- w
21
+ E
22
22
  ]);
23
23
  l(() => {
24
24
  let e = s();
25
- if (e) return requestAnimationFrame(T), e.addEventListener("scroll", T), () => {
26
- e.removeEventListener("scroll", T);
25
+ if (e) return requestAnimationFrame(D), e.addEventListener("scroll", D), () => {
26
+ e.removeEventListener("scroll", D);
27
27
  };
28
- }, [s, T]);
29
- let E = (e) => {
28
+ }, [s, D]);
29
+ let O = (e) => {
30
30
  let t = s();
31
31
  t && (t === window || t instanceof Window ? window.scrollTo({
32
32
  top: 0,
@@ -38,25 +38,27 @@ var p = s.forwardRef(({ target: s = () => window, visibilityHeight: p = 400, onC
38
38
  top: 0,
39
39
  behavior: "smooth"
40
40
  }), m?.(e));
41
- }, D = /* @__PURE__ */ f("div", {
41
+ }, k = /* @__PURE__ */ f("div", {
42
42
  className: o.content,
43
43
  children: /* @__PURE__ */ f(a, {
44
44
  component: i,
45
45
  className: o.icon
46
46
  })
47
47
  });
48
- return /* @__PURE__ */ f(y ? e : "div", {
49
- ref: b,
50
- className: d("wim-back-top", o.root, !S && o.hidden, g),
48
+ return /* @__PURE__ */ f(x ? e : "div", {
49
+ ref: S,
50
+ className: d("wim-back-top", o.root, !w && o.hidden, g),
51
51
  style: _,
52
- onClick: E,
52
+ onClick: O,
53
53
  role: "button",
54
54
  tabIndex: 0,
55
- "aria-label": v ?? x("a11y.back_to_top"),
55
+ "aria-label": y ? void 0 : v ?? C("a11y.back_to_top"),
56
+ "aria-labelledby": y,
57
+ "aria-describedby": b,
56
58
  onKeyDown: (e) => {
57
59
  (e.key === "Enter" || e.key === " ") && e.currentTarget.click();
58
60
  },
59
- children: /* @__PURE__ */ f(t, { children: h || D })
61
+ children: /* @__PURE__ */ f(t, { children: h || k })
60
62
  });
61
63
  });
62
64
  p.displayName = "BackTop";
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## What this is
6
6
 
7
- **wimui** v0.58.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.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).
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
@@ -2134,6 +2145,8 @@ follows the theme and never needs a hand-mixed colour.
2134
2145
  - `className: string` — Additional class names
2135
2146
  - `style: React.CSSProperties` — Style attribute
2136
2147
  - `aria-label: string` — Accessible label for the button
2148
+ - `aria-labelledby: string` — ID of the element that labels the button. Takes precedence over `aria-label`.
2149
+ - `aria-describedby: string` — ID of the element that describes the button.
2137
2150
  - `asChild: boolean` = false — Whether to render as a child element.
2138
2151
  - **Breadcrumb** — Location trace (aka Path Bar, Path Control)
2139
2152
  - `items: BreadcrumbItem[]` (required) — Items to display, from the root to the current page.
@@ -2785,6 +2798,7 @@ anything is measured; long text is truncated and read in full by assistive techn
2785
2798
  - `role: string` = "list" — Role of the whole list (for accessibility)
2786
2799
  - `aria-label: string` — Accessible label
2787
2800
  - `aria-labelledby: string` — ID of the element that labels the list
2801
+ - `aria-describedby: string` — ID of the element that describes the list
2788
2802
 
2789
2803
  ### overlay — `import { … } from "wimui/overlay"`
2790
2804
 
package/dist/llms.txt CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## What this is
6
6
 
7
- **wimui** v0.58.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.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).
8
8
 
9
9
  ## Install & required setup
10
10