wimui 0.53.0 → 0.54.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/data-display/Kanban/Kanban.cjs +1 -1
- package/dist/components/data-display/Kanban/Kanban.js +22 -17
- package/dist/components/navigation/Anchor/Anchor.cjs +1 -1
- package/dist/components/navigation/Anchor/Anchor.js +1 -0
- package/dist/components/overlay/Dialog/Dialog.cjs +1 -1
- package/dist/components/overlay/Dialog/Dialog.d.ts +14 -3
- package/dist/components/overlay/Dialog/Dialog.js +20 -19
- package/dist/llms-full.txt +15 -10
- package/dist/llms.txt +8 -8
- package/dist/wimui.umd.js +5 -5
- package/package.json +4 -2
|
@@ -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("../../layout/VisuallyHidden/VisuallyHidden.cjs"),a=require("../../../icon/more-horizontal.cjs"),o=require("../../media/Icon/Icon.cjs"),s=require("./kanban.module.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("classnames");l=e.__toESM(l,1);let u=require("react/jsx-runtime");var d=(0,c.forwardRef)(({columns:e,onMove:i,onCardMove:a,className:o,forceMobileUI:d=!1,children:p,asChild:m=!1,...g},
|
|
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("../../layout/VisuallyHidden/VisuallyHidden.cjs"),a=require("../../../icon/more-horizontal.cjs"),o=require("../../media/Icon/Icon.cjs"),s=require("./kanban.module.cjs");let c=require("react");c=e.__toESM(c,1);let l=require("classnames");l=e.__toESM(l,1);let u=require("react/jsx-runtime");var d=(0,c.forwardRef)(({columns:e,onMove:i,onCardMove:a,className:o,forceMobileUI:d=!1,children:p,asChild:m=!1,...g},_)=>{let{t:y}=n.useWimTranslation(r.commonNs),[b,x]=(0,c.useState)(null),[S,C]=(0,c.useState)(null),[w,T]=(0,c.useState)(null),E=i||a,D=(e,t,n)=>{x({itemId:t,columnId:n}),e.dataTransfer.setData(`text/plain`,`${n}:${t}`),e.dataTransfer.effectAllowed=`move`},O=(e,t)=>{e.preventDefault(),C(t)},k=(e,t)=>{e.preventDefault(),C(null);let[n,r]=e.dataTransfer.getData(`text/plain`).split(`:`);E?.(r,n,t),x(null)},A=(e,t,n)=>{E?.(e,t,n),T(null)},j=c.default.useMemo(()=>{if(e)return e;let t=[];return c.default.Children.forEach(p,e=>{if(c.default.isValidElement(e)){let n=e.props;typeof n.id==`string`&&typeof n.title==`string`&&t.push({id:n.id,title:n.title,items:[]})}}),t},[p,e]),M=()=>p||(e?e.map(e=>(0,u.jsx)(v,{id:e.id,title:e.title,cardCount:e.items.length,children:e.items.map(e=>(0,u.jsx)(h,{id:e.id,children:e.content},e.id))},e.id)):null),N=m?t.Root:`div`;return(0,u.jsx)(f.Provider,{value:{draggedItem:b,dragOverColumn:S,setDragOverColumn:C,handleDragStart:D,handleDragOver:O,handleDrop:k,handleMobileMove:A,activeMobileMenu:w,setActiveMobileMenu:T,columns:j},children:(0,u.jsx)(N,{...g,ref:_,className:(0,l.default)(`wim-kanban`,s.default.root,d&&s.default.touch,o),role:`region`,"aria-label":y(`a11y.kanban_board`),tabIndex:0,children:(0,u.jsx)(t.Slottable,{children:M()})})})}),f=c.default.createContext(null),p=()=>{let e=c.default.useContext(f);if(!e)throw Error(`Kanban compound components must be used within Kanban`);return e},m=({id:e,title:t,cardCount:a,children:o,className:d})=>{let{dragOverColumn:f,handleDragOver:m,handleDrop:g,setDragOverColumn:v}=p(),{t:y}=n.useWimTranslation(r.commonNs),b=c.default.useId(),x=c.default.Children.toArray(o),S=x.length>0&&x.every(e=>c.default.isValidElement(e)&&e.type===h);return(0,u.jsxs)(`div`,{className:(0,l.default)(s.default.column,{[s.default.dragOver]:f===e},d),role:`group`,"aria-labelledby":t?b:void 0,onDragOver:t=>m(t,e),onDrop:t=>g(t,e),onDragLeave:()=>v(null),children:[(0,u.jsxs)(`div`,{className:s.default.columnHeader,children:[(0,u.jsx)(`div`,{id:b,className:s.default.columnTitle,"aria-hidden":`true`,children:t}),a!==void 0&&(0,u.jsxs)(`div`,{className:s.default.columnCount,children:[(0,u.jsx)(`span`,{"aria-hidden":`true`,children:a}),(0,u.jsx)(i.VisuallyHidden,{children:y(`a11y.kanban_column_count`,{count:a})})]})]}),(0,u.jsx)(`div`,{className:s.default.columnBody,role:S?`list`:void 0,children:(0,u.jsx)(_.Provider,{value:S,children:o})})]})},h=({id:e,children:t,disabled:i,className:d})=>{let{t:f}=n.useWimTranslation(r.commonNs),{draggedItem:m,handleDragStart:h,handleMobileMove:v,activeMobileMenu:y,setActiveMobileMenu:b,columns:x}=p(),S=c.default.useContext(g),C=c.default.useContext(_);return(0,u.jsxs)(`div`,{role:C?`listitem`:void 0,className:(0,l.default)(s.default.card,{[s.default.dragging]:m?.itemId===e,[s.default.disabled]:i},d),draggable:!i,onDragStart:t=>S&&h(t,e,S),children:[(0,u.jsx)(`div`,{className:s.default.cardContent,children:t}),(0,u.jsxs)(`div`,{className:s.default.cardMove,children:[(0,u.jsx)(`button`,{type:`button`,className:s.default.cardMoveBtn,onClick:()=>b(y===e?null:e),"aria-label":f(`a11y.move_card`),disabled:i,children:(0,u.jsx)(o.Icon,{component:a.default,size:`sm`})}),y===e&&(0,u.jsx)(`div`,{className:s.default.cardMoveMenu,role:`listbox`,"aria-label":f(`a11y.move_to_column`),children:x.filter(e=>e.id!==S).map(t=>(0,u.jsx)(`button`,{type:`button`,className:s.default.cardMoveOption,onClick:()=>S&&v(e,S,t.id),role:`option`,"aria-selected":!1,children:t.title},t.id))})]})]})},g=c.default.createContext(null),_=c.default.createContext(!1),v=e=>(0,u.jsx)(g.Provider,{value:e.id,children:(0,u.jsx)(m,{...e})}),y=d;y.Column=v,y.Card=h,d.displayName=`Kanban`,y.displayName=`KanbanBoard`,m.displayName=`KanbanColumn`,h.displayName=`KanbanCard`,v.displayName=`KanbanColumnWrapper`,exports.Kanban=d,exports.KanbanBoard=y,exports.default=y,exports.KanbanCard=h,exports.KanbanColumn=m;
|
|
@@ -11,7 +11,7 @@ import d from "classnames";
|
|
|
11
11
|
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
12
12
|
//#region src/components/data-display/Kanban/Kanban.tsx
|
|
13
13
|
var m = l(({ columns: i, onMove: a, onCardMove: o, className: l, forceMobileUI: p = !1, children: m, asChild: g = !1, ..._ }, y) => {
|
|
14
|
-
let { t:
|
|
14
|
+
let { t: b } = n(r), [S, C] = u(null), [w, T] = u(null), [E, D] = u(null), O = a || o, k = (e, t, n) => {
|
|
15
15
|
C({
|
|
16
16
|
itemId: t,
|
|
17
17
|
columnId: n
|
|
@@ -37,7 +37,7 @@ var m = l(({ columns: i, onMove: a, onCardMove: o, className: l, forceMobileUI:
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
}), e;
|
|
40
|
-
}, [m, i]), P = () => m || (i ? i.map((e) => /* @__PURE__ */ f(
|
|
40
|
+
}, [m, i]), P = () => m || (i ? i.map((e) => /* @__PURE__ */ f(x, {
|
|
41
41
|
id: e.id,
|
|
42
42
|
title: e.title,
|
|
43
43
|
cardCount: e.items.length,
|
|
@@ -64,7 +64,7 @@ var m = l(({ columns: i, onMove: a, onCardMove: o, className: l, forceMobileUI:
|
|
|
64
64
|
ref: y,
|
|
65
65
|
className: d("wim-kanban", s.root, p && s.touch, l),
|
|
66
66
|
role: "region",
|
|
67
|
-
"aria-label":
|
|
67
|
+
"aria-label": b("a11y.kanban_board"),
|
|
68
68
|
tabIndex: 0,
|
|
69
69
|
children: /* @__PURE__ */ f(t, { children: P() })
|
|
70
70
|
})
|
|
@@ -74,18 +74,18 @@ var m = l(({ columns: i, onMove: a, onCardMove: o, className: l, forceMobileUI:
|
|
|
74
74
|
if (!e) throw Error("Kanban compound components must be used within Kanban");
|
|
75
75
|
return e;
|
|
76
76
|
}, _ = ({ id: e, title: t, cardCount: a, children: o, className: l }) => {
|
|
77
|
-
let { dragOverColumn: u, handleDragOver: m, handleDrop: h, setDragOverColumn: _ } = g(), { t:
|
|
77
|
+
let { dragOverColumn: u, handleDragOver: m, handleDrop: h, setDragOverColumn: _ } = g(), { t: y } = n(r), x = c.useId(), S = c.Children.toArray(o), C = S.length > 0 && S.every((e) => c.isValidElement(e) && e.type === v);
|
|
78
78
|
return /* @__PURE__ */ p("div", {
|
|
79
79
|
className: d(s.column, { [s.dragOver]: u === e }, l),
|
|
80
80
|
role: "group",
|
|
81
|
-
"aria-labelledby": t ?
|
|
81
|
+
"aria-labelledby": t ? x : void 0,
|
|
82
82
|
onDragOver: (t) => m(t, e),
|
|
83
83
|
onDrop: (t) => h(t, e),
|
|
84
84
|
onDragLeave: () => _(null),
|
|
85
85
|
children: [/* @__PURE__ */ p("div", {
|
|
86
86
|
className: s.columnHeader,
|
|
87
87
|
children: [/* @__PURE__ */ f("div", {
|
|
88
|
-
id:
|
|
88
|
+
id: x,
|
|
89
89
|
className: s.columnTitle,
|
|
90
90
|
"aria-hidden": "true",
|
|
91
91
|
children: t
|
|
@@ -94,22 +94,27 @@ var m = l(({ columns: i, onMove: a, onCardMove: o, className: l, forceMobileUI:
|
|
|
94
94
|
children: [/* @__PURE__ */ f("span", {
|
|
95
95
|
"aria-hidden": "true",
|
|
96
96
|
children: a
|
|
97
|
-
}), /* @__PURE__ */ f(i, { children:
|
|
97
|
+
}), /* @__PURE__ */ f(i, { children: y("a11y.kanban_column_count", { count: a }) })]
|
|
98
98
|
})]
|
|
99
99
|
}), /* @__PURE__ */ f("div", {
|
|
100
100
|
className: s.columnBody,
|
|
101
|
-
|
|
101
|
+
role: C ? "list" : void 0,
|
|
102
|
+
children: /* @__PURE__ */ f(b.Provider, {
|
|
103
|
+
value: C,
|
|
104
|
+
children: o
|
|
105
|
+
})
|
|
102
106
|
})]
|
|
103
107
|
});
|
|
104
108
|
}, v = ({ id: e, children: t, disabled: i, className: l }) => {
|
|
105
|
-
let { t: u } = n(r), { draggedItem: m, handleDragStart: h, handleMobileMove: _, activeMobileMenu: v, setActiveMobileMenu:
|
|
109
|
+
let { t: u } = n(r), { draggedItem: m, handleDragStart: h, handleMobileMove: _, activeMobileMenu: v, setActiveMobileMenu: x, columns: S } = g(), C = c.useContext(y), w = c.useContext(b);
|
|
106
110
|
return /* @__PURE__ */ p("div", {
|
|
111
|
+
role: w ? "listitem" : void 0,
|
|
107
112
|
className: d(s.card, {
|
|
108
113
|
[s.dragging]: m?.itemId === e,
|
|
109
114
|
[s.disabled]: i
|
|
110
115
|
}, l),
|
|
111
116
|
draggable: !i,
|
|
112
|
-
onDragStart: (t) =>
|
|
117
|
+
onDragStart: (t) => C && h(t, e, C),
|
|
113
118
|
children: [/* @__PURE__ */ f("div", {
|
|
114
119
|
className: s.cardContent,
|
|
115
120
|
children: t
|
|
@@ -118,7 +123,7 @@ var m = l(({ columns: i, onMove: a, onCardMove: o, className: l, forceMobileUI:
|
|
|
118
123
|
children: [/* @__PURE__ */ f("button", {
|
|
119
124
|
type: "button",
|
|
120
125
|
className: s.cardMoveBtn,
|
|
121
|
-
onClick: () =>
|
|
126
|
+
onClick: () => x(v === e ? null : e),
|
|
122
127
|
"aria-label": u("a11y.move_card"),
|
|
123
128
|
disabled: i,
|
|
124
129
|
children: /* @__PURE__ */ f(o, {
|
|
@@ -129,10 +134,10 @@ var m = l(({ columns: i, onMove: a, onCardMove: o, className: l, forceMobileUI:
|
|
|
129
134
|
className: s.cardMoveMenu,
|
|
130
135
|
role: "listbox",
|
|
131
136
|
"aria-label": u("a11y.move_to_column"),
|
|
132
|
-
children:
|
|
137
|
+
children: S.filter((e) => e.id !== C).map((t) => /* @__PURE__ */ f("button", {
|
|
133
138
|
type: "button",
|
|
134
139
|
className: s.cardMoveOption,
|
|
135
|
-
onClick: () =>
|
|
140
|
+
onClick: () => C && _(e, C, t.id),
|
|
136
141
|
role: "option",
|
|
137
142
|
"aria-selected": !1,
|
|
138
143
|
children: t.title
|
|
@@ -140,10 +145,10 @@ var m = l(({ columns: i, onMove: a, onCardMove: o, className: l, forceMobileUI:
|
|
|
140
145
|
})]
|
|
141
146
|
})]
|
|
142
147
|
});
|
|
143
|
-
}, y = c.createContext(null), b = (e) => /* @__PURE__ */ f(y.Provider, {
|
|
148
|
+
}, y = c.createContext(null), b = c.createContext(!1), x = (e) => /* @__PURE__ */ f(y.Provider, {
|
|
144
149
|
value: e.id,
|
|
145
150
|
children: /* @__PURE__ */ f(_, { ...e })
|
|
146
|
-
}),
|
|
147
|
-
|
|
151
|
+
}), S = m;
|
|
152
|
+
S.Column = x, S.Card = v, m.displayName = "Kanban", S.displayName = "KanbanBoard", _.displayName = "KanbanColumn", v.displayName = "KanbanCard", x.displayName = "KanbanColumnWrapper";
|
|
148
153
|
//#endregion
|
|
149
|
-
export { m as Kanban,
|
|
154
|
+
export { m as Kanban, S as KanbanBoard, S as default, v as KanbanCard, _ as KanbanColumn };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("./anchor.module.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("classnames");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a=({items:e=[],bounds:a=5,offset:o=0,direction:s=`vertical`,className:c,style:l})=>{let[u,d]=(0,n.useState)(``),[f,p]=(0,n.useState)({}),m=(0,n.useRef)(null),h=(e,t)=>{e.preventDefault();let n=t.replace(`#`,``),r=document.getElementById(n);r&&(window.scrollTo({top:r.offsetTop-o,behavior:`smooth`}),d(t))};(0,n.useLayoutEffect)(()=>{let t=()=>{let t=(e,n)=>{let r=[];return e.forEach(e=>{r.push({href:e.href,parentHref:n}),e.children&&(r=r.concat(t(e.children,n||e.href)))}),r},n=t(e),r=``,i=window.scrollY||document.documentElement.scrollTop,c=document.documentElement.scrollHeight,l=document.documentElement.clientHeight;if(i>0&&Math.ceil(i+l)>=c&&n.length>0){let e=n[n.length-1];r=s===`horizontal`&&e.parentHref?e.parentHref:e.href}else for(let e of n){let t=e.href.replace(`#`,``),n=document.getElementById(t);if(n){if(n.getBoundingClientRect().top<=o+a)r=s===`horizontal`&&e.parentHref?e.parentHref:e.href;else break}}r&&r!==u&&d(r)};return window.addEventListener(`scroll`,t),t(),()=>window.removeEventListener(`scroll`,t)},[e,o,a,u,s]),(0,n.useLayoutEffect)(()=>{if(!u||!m.current)return;let e=m.current.querySelector(`a[href="${u}"]`);if(e){let n=m.current.getBoundingClientRect();if(s===`vertical`){let t=e.getBoundingClientRect();p({top:t.top-n.top,height:t.height,opacity:1})}else{let r=m.current.querySelector(`.${t.default.list}`);if(r){let t=e.getBoundingClientRect(),i=r.getBoundingClientRect(),a=t.left-i.left+r.scrollLeft,o=a-i.width/2+t.width/2,s=r.scrollWidth-i.width,c=Math.max(0,Math.min(o,s)),l=a-c+(i.left-n.left);p({left:l,width:t.width,opacity:1}),r.scrollTo({left:c,behavior:`smooth`})}else{let t=e.getBoundingClientRect();p({left:t.left-m.current.getBoundingClientRect().left,width:t.width,opacity:1})}}}else p({opacity:0})},[u,s]);let g=e=>(0,i.jsx)(`ul`,{className:(0,r.default)(t.default.list,t.default[s]),children:e.map(e=>(0,i.jsxs)(`li`,{className:(0,r.default)(t.default.item,u===e.href&&t.default.active),children:[(0,i.jsx)(`a`,{href:e.href,className:t.default.link,onClick:t=>h(t,e.href),title:typeof e.title==`string`?e.title:void 0,children:e.title}),e.children&&s===`vertical`&&g(e.children)]},e.key))});return(0,i.jsxs)(`div`,{className:(0,r.default)(`wim-anchor`,t.default.root,t.default[s],c),style:l,ref:m,children:[(0,i.jsx)(`div`,{className:t.default.ink,children:(0,i.jsx)(`span`,{className:t.default.inkBall,style:f})}),g(e)]})};exports.Anchor=a,exports.default=a;
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("./anchor.module.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("classnames");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a=({items:e=[],bounds:a=5,offset:o=0,direction:s=`vertical`,className:c,style:l})=>{let[u,d]=(0,n.useState)(``),[f,p]=(0,n.useState)({}),m=(0,n.useRef)(null),h=(e,t)=>{e.preventDefault();let n=t.replace(`#`,``),r=document.getElementById(n);r&&(window.scrollTo({top:r.offsetTop-o,behavior:`smooth`}),d(t))};(0,n.useLayoutEffect)(()=>{let t=()=>{let t=(e,n)=>{let r=[];return e.forEach(e=>{r.push({href:e.href,parentHref:n}),e.children&&(r=r.concat(t(e.children,n||e.href)))}),r},n=t(e),r=``,i=window.scrollY||document.documentElement.scrollTop,c=document.documentElement.scrollHeight,l=document.documentElement.clientHeight;if(i>0&&Math.ceil(i+l)>=c&&n.length>0){let e=n[n.length-1];r=s===`horizontal`&&e.parentHref?e.parentHref:e.href}else for(let e of n){let t=e.href.replace(`#`,``),n=document.getElementById(t);if(n){if(n.getBoundingClientRect().top<=o+a)r=s===`horizontal`&&e.parentHref?e.parentHref:e.href;else break}}r&&r!==u&&d(r)};return window.addEventListener(`scroll`,t),t(),()=>window.removeEventListener(`scroll`,t)},[e,o,a,u,s]),(0,n.useLayoutEffect)(()=>{if(!u||!m.current)return;let e=m.current.querySelector(`a[href="${u}"]`);if(e){let n=m.current.getBoundingClientRect();if(s===`vertical`){let t=e.getBoundingClientRect();p({top:t.top-n.top,height:t.height,opacity:1})}else{let r=m.current.querySelector(`.${t.default.list}`);if(r){let t=e.getBoundingClientRect(),i=r.getBoundingClientRect(),a=t.left-i.left+r.scrollLeft,o=a-i.width/2+t.width/2,s=r.scrollWidth-i.width,c=Math.max(0,Math.min(o,s)),l=a-c+(i.left-n.left);p({left:l,width:t.width,opacity:1}),r.scrollTo({left:c,behavior:`smooth`})}else{let t=e.getBoundingClientRect();p({left:t.left-m.current.getBoundingClientRect().left,width:t.width,opacity:1})}}}else p({opacity:0})},[u,s]);let g=e=>(0,i.jsx)(`ul`,{className:(0,r.default)(t.default.list,t.default[s]),children:e.map(e=>(0,i.jsxs)(`li`,{className:(0,r.default)(t.default.item,u===e.href&&t.default.active),children:[(0,i.jsx)(`a`,{href:e.href,className:t.default.link,"aria-current":u===e.href?`location`:void 0,onClick:t=>h(t,e.href),title:typeof e.title==`string`?e.title:void 0,children:e.title}),e.children&&s===`vertical`&&g(e.children)]},e.key))});return(0,i.jsxs)(`div`,{className:(0,r.default)(`wim-anchor`,t.default.root,t.default[s],c),style:l,ref:m,children:[(0,i.jsx)(`div`,{className:t.default.ink,children:(0,i.jsx)(`span`,{className:t.default.inkBall,style:f})}),g(e)]})};exports.Anchor=a,exports.default=a;
|
|
@@ -85,6 +85,7 @@ var s = ({ items: s = [], bounds: c = 5, offset: l = 0, direction: u = "vertical
|
|
|
85
85
|
children: [/* @__PURE__ */ a("a", {
|
|
86
86
|
href: t.href,
|
|
87
87
|
className: e.link,
|
|
88
|
+
"aria-current": p === t.href ? "location" : void 0,
|
|
88
89
|
onClick: (e) => v(e, t.href),
|
|
89
90
|
title: typeof t.title == "string" ? t.title : void 0,
|
|
90
91
|
children: t.title
|
|
@@ -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("../../_internal/OverlayBase.cjs"),r=require("./dialog.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=(0,i.createContext)(void 0),c=()=>{let e=(0,i.useContext)(s);if(!e)throw Error(`Dialog sub-components must be used within Dialog`);return e},l=({children:e,open:t,onOpenChange:n,defaultOpen:r=!1,closeOnOverlayClick:a
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../_internal/OverlayBase.cjs"),r=require("./dialog.module.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("classnames");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s=(0,i.createContext)(void 0),c=()=>{let e=(0,i.useContext)(s);if(!e)throw Error(`Dialog sub-components must be used within Dialog`);return e},l=({children:e,open:t,onOpenChange:n,defaultOpen:r=!1,role:a=`dialog`,closeOnOverlayClick:c=a!==`alertdialog`})=>{let[l,u]=(0,i.useState)(r),d=t!==void 0,f=d?t:l,p=e=>{d||u(e),n?.(e)},m=`wim-dialog-${(0,i.useId)()}`,h=`${m}-title`,g=`${m}-description`;return(0,o.jsx)(s.Provider,{value:{titleId:h,descriptionId:g,open:f,onOpenChange:p,closeOnOverlayClick:c,role:a},children:e})};l.displayName=`Dialog`;var u=({children:e,className:n,onClick:r,asChild:i=!1,...a})=>{let{onOpenChange:s}=c();return(0,o.jsx)(i?t.Root:`button`,{type:`button`,className:n,onClick:e=>{r?.(e),s(!0)},...a,children:(0,o.jsx)(t.Slottable,{children:e})})};u.displayName=`Dialog.Trigger`;var d=({children:e,className:n,onClick:r,asChild:i=!1,...a})=>{let{onOpenChange:s}=c();return(0,o.jsx)(i?t.Root:`button`,{type:`button`,className:n,onClick:e=>{r?.(e),s(!1)},...a,children:(0,o.jsx)(t.Slottable,{children:e})})};d.displayName=`Dialog.Close`;var f=({children:e,className:i,asChild:s=!1,open:l,onOpenChange:u,role:d,...f})=>{let{open:p,onOpenChange:m,titleId:h,descriptionId:g,closeOnOverlayClick:_,role:v}=c(),y=l===void 0?p:l,b=u===void 0?m:u,x=s?t.Root:`div`;return(0,o.jsx)(n.OverlayBase,{...f,open:y,onOpenChange:b,closeOnOverlayClick:_,overlayClassName:r.default.overlay,role:d??v,"aria-labelledby":h,"aria-describedby":g,children:(0,o.jsx)(x,{className:(0,a.default)(`wim-dialog`,r.default.content,i),children:(0,o.jsx)(t.Slottable,{children:e})})})};f.displayName=`Dialog.Content`;var p=({children:e,className:t,...n})=>(0,o.jsx)(`div`,{className:(0,a.default)(r.default.header,t),"data-testid":`dialog-header`,...n,children:e});p.displayName=`Dialog.Header`;var m=({children:e,className:t,layout:n,...i})=>(0,o.jsx)(`div`,{className:(0,a.default)(r.default.footer,t),"data-layout":n,"data-testid":`dialog-footer`,...i,children:e});m.displayName=`Dialog.Footer`;var h=({children:e,className:t,...n})=>{let{titleId:i}=c();return(0,o.jsx)(`h2`,{id:i,className:(0,a.default)(r.default.title,t),"data-testid":`dialog-title`,...n,children:e})};h.displayName=`Dialog.Title`;var g=({children:e,className:t,...n})=>{let{descriptionId:i}=c();return(0,o.jsx)(`p`,{id:i,className:(0,a.default)(r.default.description,t),"data-testid":`dialog-description`,...n,children:e})};g.displayName=`Dialog.Description`;var _=e=>(0,o.jsx)(l,{...e});_.displayName=`Dialog`,_.Trigger=u,_.Content=f,_.Close=d,_.Header=p,_.Footer=m,_.Title=h,_.Description=g,exports.Dialog=_,exports.default=_,exports.DialogClose=d,exports.DialogContent=f,exports.DialogDescription=g,exports.DialogFooter=m,exports.DialogHeader=p,exports.DialogTitle=h,exports.DialogTrigger=u,exports.useDialog=c;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { OverlayBase } from '../../_internal/OverlayBase';
|
|
3
|
+
/** The ARIA role the dialog content announces itself with. */
|
|
4
|
+
export type DialogRole = "dialog" | "alertdialog";
|
|
3
5
|
type DialogContextType = {
|
|
4
6
|
titleId: string;
|
|
5
7
|
descriptionId: string;
|
|
6
8
|
open: boolean;
|
|
7
9
|
onOpenChange: (open: boolean) => void;
|
|
8
10
|
closeOnOverlayClick: boolean;
|
|
11
|
+
role: DialogRole;
|
|
9
12
|
};
|
|
10
13
|
export declare const useDialog: () => DialogContextType;
|
|
11
14
|
export interface DialogProps {
|
|
@@ -31,10 +34,18 @@ export interface DialogProps {
|
|
|
31
34
|
*/
|
|
32
35
|
className?: string;
|
|
33
36
|
/**
|
|
34
|
-
* Whether clicking the overlay closes the dialog.
|
|
35
|
-
*
|
|
37
|
+
* Whether clicking the overlay closes the dialog. Defaults to true, except
|
|
38
|
+
* when role is "alertdialog", where it defaults to false.
|
|
36
39
|
*/
|
|
37
40
|
closeOnOverlayClick?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* ARIA role of the dialog content. Use "alertdialog" for a dialog that
|
|
43
|
+
* interrupts the user and needs a response before they can continue, such as
|
|
44
|
+
* confirming a destructive action. An alert dialog does not close when the
|
|
45
|
+
* overlay is clicked unless closeOnOverlayClick is set; Escape still closes it.
|
|
46
|
+
* @default "dialog"
|
|
47
|
+
*/
|
|
48
|
+
role?: DialogRole;
|
|
38
49
|
}
|
|
39
50
|
export interface DialogTriggerProps extends React.ComponentPropsWithoutRef<"button"> {
|
|
40
51
|
asChild?: boolean;
|
|
@@ -54,7 +65,7 @@ export interface DialogContentProps extends Partial<React.ComponentPropsWithoutR
|
|
|
54
65
|
asChild?: boolean;
|
|
55
66
|
}
|
|
56
67
|
export declare const DialogContent: {
|
|
57
|
-
({ children, className, asChild, open: propsOpen, onOpenChange: propsOnOpenChange, ...props }: DialogContentProps): React.JSX.Element;
|
|
68
|
+
({ children, className, asChild, open: propsOpen, onOpenChange: propsOnOpenChange, role: propsRole, ...props }: DialogContentProps): React.JSX.Element;
|
|
58
69
|
displayName: string;
|
|
59
70
|
};
|
|
60
71
|
export declare const DialogHeader: {
|
|
@@ -10,17 +10,18 @@ var u = i(void 0), d = () => {
|
|
|
10
10
|
let e = a(u);
|
|
11
11
|
if (!e) throw Error("Dialog sub-components must be used within Dialog");
|
|
12
12
|
return e;
|
|
13
|
-
}, f = ({ children: e, open: t, onOpenChange: n, defaultOpen: r = !1,
|
|
14
|
-
let [
|
|
15
|
-
|
|
16
|
-
},
|
|
13
|
+
}, f = ({ children: e, open: t, onOpenChange: n, defaultOpen: r = !1, role: i = "dialog", closeOnOverlayClick: a = i !== "alertdialog" }) => {
|
|
14
|
+
let [c, d] = s(r), f = t !== void 0, p = f ? t : c, m = (e) => {
|
|
15
|
+
f || d(e), n?.(e);
|
|
16
|
+
}, h = `wim-dialog-${o()}`, g = `${h}-title`, _ = `${h}-description`;
|
|
17
17
|
return /* @__PURE__ */ l(u.Provider, {
|
|
18
18
|
value: {
|
|
19
|
-
titleId:
|
|
20
|
-
descriptionId:
|
|
21
|
-
open:
|
|
22
|
-
onOpenChange:
|
|
23
|
-
closeOnOverlayClick:
|
|
19
|
+
titleId: g,
|
|
20
|
+
descriptionId: _,
|
|
21
|
+
open: p,
|
|
22
|
+
onOpenChange: m,
|
|
23
|
+
closeOnOverlayClick: a,
|
|
24
|
+
role: i
|
|
24
25
|
},
|
|
25
26
|
children: e
|
|
26
27
|
});
|
|
@@ -52,18 +53,18 @@ var m = ({ children: n, className: r, onClick: i, asChild: a = !1, ...o }) => {
|
|
|
52
53
|
});
|
|
53
54
|
};
|
|
54
55
|
m.displayName = "Dialog.Close";
|
|
55
|
-
var h = ({ children: i, className: a, asChild: o = !1, open: s, onOpenChange: u,
|
|
56
|
-
let { open:
|
|
56
|
+
var h = ({ children: i, className: a, asChild: o = !1, open: s, onOpenChange: u, role: f, ...p }) => {
|
|
57
|
+
let { open: m, onOpenChange: h, titleId: g, descriptionId: _, closeOnOverlayClick: v, role: y } = d(), b = s === void 0 ? m : s, x = u === void 0 ? h : u, S = o ? e : "div";
|
|
57
58
|
return /* @__PURE__ */ l(n, {
|
|
58
|
-
...
|
|
59
|
-
open:
|
|
60
|
-
onOpenChange:
|
|
61
|
-
closeOnOverlayClick:
|
|
59
|
+
...p,
|
|
60
|
+
open: b,
|
|
61
|
+
onOpenChange: x,
|
|
62
|
+
closeOnOverlayClick: v,
|
|
62
63
|
overlayClassName: r.overlay,
|
|
63
|
-
role:
|
|
64
|
-
"aria-labelledby":
|
|
65
|
-
"aria-describedby":
|
|
66
|
-
children: /* @__PURE__ */ l(
|
|
64
|
+
role: f ?? y,
|
|
65
|
+
"aria-labelledby": g,
|
|
66
|
+
"aria-describedby": _,
|
|
67
|
+
children: /* @__PURE__ */ l(S, {
|
|
67
68
|
className: c("wim-dialog", r.content, a),
|
|
68
69
|
children: /* @__PURE__ */ l(t, { children: i })
|
|
69
70
|
})
|
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.54.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
|
|
|
@@ -854,7 +854,7 @@ number of pixels. Prefer the token so the gap follows the theme.
|
|
|
854
854
|
@default "2xl"
|
|
855
855
|
- `verticalSpacing: number | string` — Vertical spacing between rows (defaults to `spacing`)
|
|
856
856
|
- `minChildWidth: number | string` — Minimum width of each child; columns wrap automatically to fit
|
|
857
|
-
- **Splitter** — Split and resize panels
|
|
857
|
+
- **Splitter** — Split and resize panels (aka Resizable, Resizable Panels, Split Pane)
|
|
858
858
|
- `orientation: "horizontal" | "vertical"` = "horizontal" — The orientation of the splitter.
|
|
859
859
|
- `children: React.ReactNode` (required) — The components to render within the splitter. Usually a combination of `Splitter.Panel` and `Splitter.Handle`.
|
|
860
860
|
- **Stack** — Vertical/Horizontal alignment
|
|
@@ -1051,7 +1051,7 @@ Use it when the field already does the same thing from the keyboard.
|
|
|
1051
1051
|
so the unit does not have to be repeated in the label.
|
|
1052
1052
|
- `styles: { root?: string; inner?: string; icon?: string; icons?: string; iconItem?: string; iconButton?: string; }` — Custom styles for internal parts
|
|
1053
1053
|
- `asChild: boolean` = false — Whether to render as a child element.
|
|
1054
|
-
- **Combobox** — Select with search
|
|
1054
|
+
- **Combobox** — Select with search (aka Autocomplete, Auto Complete)
|
|
1055
1055
|
- `options: ComboboxOption[]` = [] — List of suggestion options
|
|
1056
1056
|
- `onChange: (option: ComboboxOption) => void` — Callback when an option is selected
|
|
1057
1057
|
- `placeholder: string` — Placeholder for the input
|
|
@@ -1198,7 +1198,7 @@ still do their job for assistive technology.
|
|
|
1198
1198
|
- `htmlFor: string` — ID of the element the label points to
|
|
1199
1199
|
- `errorId: string` — ID of the error message element
|
|
1200
1200
|
- `styles: { root?: string; labelWrapper?: string; label?: string; content?: string; error?: string; }` — Custom styles for internal parts
|
|
1201
|
-
- **FileUpload** — File selection
|
|
1201
|
+
- **FileUpload** — File selection (aka Upload, File Input)
|
|
1202
1202
|
- `label: React.ReactNode` — Field label
|
|
1203
1203
|
- `buttonLabel: React.ReactNode` — Label of the file selection button
|
|
1204
1204
|
- `noFileLabel: React.ReactNode` — Text shown when no file is selected
|
|
@@ -1407,7 +1407,7 @@ so the unit does not have to be repeated in the label.
|
|
|
1407
1407
|
- `allowDecimal: boolean` = false — Whether to allow decimal points (effective only when mode="number")
|
|
1408
1408
|
- `allowNegative: boolean` = false — Whether to allow negative numbers (effective only when mode="number")
|
|
1409
1409
|
- `asChild: boolean` = false — Whether to render as a child element.
|
|
1410
|
-
- **OtpInput** — One-time password fields
|
|
1410
|
+
- **OtpInput** — One-time password fields (aka Pin Input, Input OTP, PIN Code Input)
|
|
1411
1411
|
- `length: number` = 6 — Number of digits
|
|
1412
1412
|
- `value: string` = "" — Current value (controlled)
|
|
1413
1413
|
- `onChange: (value: string) => void` — Callback when the value changes
|
|
@@ -2061,7 +2061,7 @@ follows the theme and never needs a hand-mixed colour.
|
|
|
2061
2061
|
- `label: string` — Text label displayed next to the spinner.
|
|
2062
2062
|
- `labelPosition: "right" | "bottom"` = "right" — Position of the label relative to the spinner.
|
|
2063
2063
|
@default "right"
|
|
2064
|
-
- **Toast** — Non-intrusive floating messages that provide feedback on system operations
|
|
2064
|
+
- **Toast** — Non-intrusive floating messages that provide feedback on system operations (aka Message, Sonner)
|
|
2065
2065
|
- `id: string` — Identifier of the toast, passed to onClose. Used by ToastProvider to manage a stack.
|
|
2066
2066
|
- `title: string` — Title of the toast.
|
|
2067
2067
|
- `description: string` — Description text displayed below the title.
|
|
@@ -2208,7 +2208,7 @@ Defaults to a translated "Open menu" / "Close menu" (en / ja / pt), following th
|
|
|
2208
2208
|
- `ariaLabel: string` — Accessibility label for the navigation
|
|
2209
2209
|
- `onChange: (current: number) => void` — Callback function when a step is clicked (if applicable)
|
|
2210
2210
|
- `asChild: boolean` — Whether to use the Radix Slot pattern
|
|
2211
|
-
- **TabBar** — Mobile bottom navigation
|
|
2211
|
+
- **TabBar** — Mobile bottom navigation (aka Bottom Navigation, Bottom Tab Bar)
|
|
2212
2212
|
- `fixed: boolean` = true — Pins the bar to the bottom of the **viewport**. Defaults to `true`.
|
|
2213
2213
|
|
|
2214
2214
|
The pin is `position: fixed`, so the bar leaves whatever container you put
|
|
@@ -2642,7 +2642,7 @@ renders inline, next to whatever follows it.
|
|
|
2642
2642
|
- `asChild: boolean` = false — If true, the component will be rendered as its child.
|
|
2643
2643
|
- `onSortEnd: (oldIndex: number, newIndex: number) => void` — Callback called when reordering is completed.
|
|
2644
2644
|
- `disabled: boolean` = false — Whether the entire list is disabled.
|
|
2645
|
-
- **Stats** — A component to highlight key performance indicators and metrics
|
|
2645
|
+
- **Stats** — A component to highlight key performance indicators and metrics (aka Statistic, Stat)
|
|
2646
2646
|
- `variant: React.ComponentProps<typeof Card>["variant"]` = "outline" — Visual style variant of the card
|
|
2647
2647
|
- `asChild: boolean` = false — If true, the card will be rendered as its child, merging its props onto that child.
|
|
2648
2648
|
- `interactive: boolean` = false — Whether the card is clickable: shows hover and press feedback and a pointer cursor
|
|
@@ -2773,8 +2773,13 @@ anything is measured; long text is truncated and read in full by assistive techn
|
|
|
2773
2773
|
- `defaultOpen: boolean` = false — Initial open state for uncontrolled usage.
|
|
2774
2774
|
@default false
|
|
2775
2775
|
- `className: string` — Additional CSS class name.
|
|
2776
|
-
- `closeOnOverlayClick: boolean` =
|
|
2777
|
-
|
|
2776
|
+
- `closeOnOverlayClick: boolean` = role !== "alertdialog" — Whether clicking the overlay closes the dialog. Defaults to true, except
|
|
2777
|
+
when role is "alertdialog", where it defaults to false.
|
|
2778
|
+
- `role: "dialog" | "alertdialog"` = "dialog" — ARIA role of the dialog content. Use "alertdialog" for a dialog that
|
|
2779
|
+
interrupts the user and needs a response before they can continue, such as
|
|
2780
|
+
confirming a destructive action. An alert dialog does not close when the
|
|
2781
|
+
overlay is clicked unless closeOnOverlayClick is set; Escape still closes it.
|
|
2782
|
+
@default "dialog"
|
|
2778
2783
|
- **Drawer** — Slide-out detail panels (aka Navigation Drawer)
|
|
2779
2784
|
- `children: React.ReactNode` (required) — Drawer parts (DrawerTrigger, DrawerContent, etc.).
|
|
2780
2785
|
- `open: boolean` — Controlled open state. Use together with onOpenChange.
|
package/dist/llms.txt
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## What this is
|
|
6
6
|
|
|
7
|
-
**wimui** v0.
|
|
7
|
+
**wimui** v0.54.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
|
|
|
@@ -221,7 +221,7 @@ export function BillingOverview() {
|
|
|
221
221
|
- **ScrollArea** — A custom scrollbar component that provides high-performance, cross-browser consistent themes while maintaining a native-like feel.
|
|
222
222
|
- **Sidebar** — A collapsible navigation or informational panel on the side of the screen (aka Source List, Inspector)
|
|
223
223
|
- **SimpleGrid** — Responsive fixed grid
|
|
224
|
-
- **Splitter** — Split and resize panels
|
|
224
|
+
- **Splitter** — Split and resize panels (aka Resizable, Resizable Panels, Split Pane)
|
|
225
225
|
- **Stack** — Vertical/Horizontal alignment
|
|
226
226
|
- **Toolbar** — Action strip for IconButton, ToggleGroup, and related controls with toolbar keyboard navigation. (aka Action Bar)
|
|
227
227
|
- **Transition** — Utilities for managing smooth enter and leave animations with CSS classes
|
|
@@ -237,7 +237,7 @@ export function BillingOverview() {
|
|
|
237
237
|
- **CheckboxGroup** — Shared state checkboxes
|
|
238
238
|
- **ColorInput** — Input with color preview (aka Color Well, Color Field)
|
|
239
239
|
- **ColorPicker** — Color selection picker
|
|
240
|
-
- **Combobox** — Select with search
|
|
240
|
+
- **Combobox** — Select with search (aka Autocomplete, Auto Complete)
|
|
241
241
|
- **CopyButton** — Copy to clipboard
|
|
242
242
|
- **CounterTextarea** — Textarea with character count display
|
|
243
243
|
- **CreditCardInput** — Payment card input with brand detection
|
|
@@ -247,7 +247,7 @@ export function BillingOverview() {
|
|
|
247
247
|
- **FieldError** — Validation messages
|
|
248
248
|
- **Fieldset** — Form grouping
|
|
249
249
|
- **FieldTemplate** — Standardizes label placement, required markings, and error message display for all form-related components.
|
|
250
|
-
- **FileUpload** — File selection
|
|
250
|
+
- **FileUpload** — File selection (aka Upload, File Input)
|
|
251
251
|
- **FloatButton** — Floating action buttons
|
|
252
252
|
- **IconButton** — A square button containing only an icon without a text label.
|
|
253
253
|
- **ImageCropper** — Front-end image cropping and rotation tool.
|
|
@@ -260,7 +260,7 @@ export function BillingOverview() {
|
|
|
260
260
|
- **Mentions** — @ / # suggestions
|
|
261
261
|
- **MultiSelect** — Multiple selection
|
|
262
262
|
- **NumberInput** — Input with step adjustments (aka Spin Button, Numeric Stepper)
|
|
263
|
-
- **OtpInput** — One-time password fields
|
|
263
|
+
- **OtpInput** — One-time password fields (aka Pin Input, Input OTP, PIN Code Input)
|
|
264
264
|
- **PasswordInput** — Password with toggle
|
|
265
265
|
- **PasswordStrength** — Visual meter to indicate password security level. (aka Strength Meter)
|
|
266
266
|
- **PhoneInput** — International phone number input
|
|
@@ -305,7 +305,7 @@ export function BillingOverview() {
|
|
|
305
305
|
- **Skeleton** — Placeholder for content loading states. (aka Shimmer)
|
|
306
306
|
- **Snackbar** — Bottom notifications
|
|
307
307
|
- **Spinner** — A rotating icon indicating background activity or data fetching (aka Activity Indicator)
|
|
308
|
-
- **Toast** — Non-intrusive floating messages that provide feedback on system operations
|
|
308
|
+
- **Toast** — Non-intrusive floating messages that provide feedback on system operations (aka Message, Sonner)
|
|
309
309
|
- **Tour** — Sequential guided walkthroughs to onboard users or highlight features
|
|
310
310
|
|
|
311
311
|
### navigation — `import { … } from "wimui/navigation"`
|
|
@@ -323,7 +323,7 @@ export function BillingOverview() {
|
|
|
323
323
|
- **SpeedDial** — Floating action button that expands sub-actions on hover or click.
|
|
324
324
|
- **Stepper** — Visual sequence steps
|
|
325
325
|
- ⚠️ Not the same as elsewhere: In Apple HIG and macOS, a "Stepper" is the control that increments a number — that is `NumberInput` here. WIM's `Stepper` shows progress through a sequence of steps, which is what Material calls a Stepper.
|
|
326
|
-
- **TabBar** — Mobile bottom navigation
|
|
326
|
+
- **TabBar** — Mobile bottom navigation (aka Bottom Navigation, Bottom Tab Bar)
|
|
327
327
|
- **TabNavigation** — Tab-based navigation
|
|
328
328
|
- **Tabs** — A container to organize related content into switchable view panels
|
|
329
329
|
|
|
@@ -363,7 +363,7 @@ export function BillingOverview() {
|
|
|
363
363
|
- **RelativeTime** — Display a timestamp as a localized relative phrase ("3 minutes ago", "yesterday") that updates automatically as time passes.
|
|
364
364
|
- **ScheduleView** — Displays tasks or events on a chronological timeline or calendar view.
|
|
365
365
|
- **SortableList** — Item rearrangement and reordering
|
|
366
|
-
- **Stats** — A component to highlight key performance indicators and metrics
|
|
366
|
+
- **Stats** — A component to highlight key performance indicators and metrics (aka Statistic, Stat)
|
|
367
367
|
- **SwipeableList** — Container for SwipeAction rows that keeps at most one row open at a time. (aka Swipeable List)
|
|
368
368
|
- **SwipeAction** — Mobile-friendly swipe actions (delete, archive) for list items.
|
|
369
369
|
- **Table** — Rows and columns for displaying structured data efficiently
|