wimui 0.63.0 → 0.63.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.
- package/dist/components/_internal/OverlayBase.cjs +1 -1
- package/dist/components/_internal/OverlayBase.js +31 -30
- package/dist/components/_internal/composeEventHandlers.cjs +2 -0
- package/dist/components/_internal/composeEventHandlers.d.ts +25 -0
- package/dist/components/_internal/composeEventHandlers.js +8 -0
- package/dist/components/ai/ChatUI/ChatUI.cjs +1 -1
- package/dist/components/ai/ChatUI/ChatUI.js +83 -82
- package/dist/components/data-display/Accordion/Accordion.cjs +1 -1
- package/dist/components/data-display/Accordion/Accordion.js +79 -78
- package/dist/components/data-display/PullToRefresh/PullToRefresh.cjs +1 -1
- package/dist/components/data-display/PullToRefresh/PullToRefresh.js +73 -72
- package/dist/components/data-display/SortableList/SortableList.cjs +1 -1
- package/dist/components/data-display/SortableList/SortableList.js +54 -53
- package/dist/components/data-display/SwipeAction/SwipeAction.cjs +1 -1
- package/dist/components/data-display/SwipeAction/SwipeAction.js +77 -76
- package/dist/components/form/Cascader/Cascader.cjs +1 -1
- package/dist/components/form/Cascader/Cascader.js +99 -98
- package/dist/components/form/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/form/DatePicker/DatePicker.js +53 -52
- package/dist/components/form/RangeSlider/RangeSlider.cjs +1 -1
- package/dist/components/form/RangeSlider/RangeSlider.js +109 -108
- package/dist/components/form/Rating/Rating.cjs +1 -1
- package/dist/components/form/Rating/Rating.js +75 -74
- package/dist/components/form/Slider/Slider.cjs +1 -1
- package/dist/components/form/Slider/Slider.js +58 -57
- package/dist/components/form/SmartSearchInput/SmartSearchInput.cjs +1 -1
- package/dist/components/form/SmartSearchInput/SmartSearchInput.js +65 -64
- package/dist/components/form/TimePicker/TimePicker.cjs +1 -1
- package/dist/components/form/TimePicker/TimePicker.js +31 -30
- package/dist/components/layout/InteractiveArea/InteractiveArea.cjs +1 -1
- package/dist/components/layout/InteractiveArea/InteractiveArea.js +1 -1
- package/dist/components/layout/Navbar/Navbar.cjs +1 -1
- package/dist/components/layout/Navbar/Navbar.js +68 -67
- package/dist/components/layout/Splitter/Splitter.cjs +1 -1
- package/dist/components/layout/Splitter/Splitter.js +47 -46
- package/dist/components/layout/Transition/Transition.cjs +1 -1
- package/dist/components/layout/Transition/Transition.js +25 -24
- package/dist/components/media/Audio/Audio.cjs +1 -1
- package/dist/components/media/Audio/Audio.js +39 -38
- package/dist/components/media/Image/Image.cjs +2 -2
- package/dist/components/media/Image/Image.js +96 -95
- package/dist/components/media/ImageCompare/ImageCompare.cjs +1 -1
- package/dist/components/media/ImageCompare/ImageCompare.js +75 -74
- package/dist/components/media/Video/Video.cjs +1 -1
- package/dist/components/media/Video/Video.js +114 -113
- package/dist/components/navigation/SpeedDial/SpeedDial.cjs +1 -1
- package/dist/components/navigation/SpeedDial/SpeedDial.js +47 -46
- package/dist/components/navigation/Tabs/Tabs.cjs +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +87 -86
- package/dist/components/overlay/Popover/Popover.cjs +1 -1
- package/dist/components/overlay/Popover/Popover.js +1 -1
- package/dist/llms-full.txt +1 -1
- package/dist/llms.txt +1 -1
- package/dist/wimui.umd.js +5 -5
- package/package.json +1 -1
|
@@ -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("../../../hooks/useMergedRef.cjs"),r=require("../../_internal/
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../hooks/useMergedRef.cjs"),r=require("../../_internal/composeEventHandlers.cjs"),i=require("../../_internal/useIndicator.cjs"),a=require("./tabs.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l=(0,o.createContext)(null),u=()=>{let e=(0,o.useContext)(l);if(!e)throw Error(`Tabs components must be used within a Tabs`);return e},d=o.default.forwardRef(({asChild:e=!1,defaultValue:n,value:r,onChange:i,orientation:u=`horizontal`,className:d,children:f,...p},m)=>{let[h,g]=(0,o.useState)(n),[_,v]=(0,o.useState)([]),[y,b]=(0,o.useState)([]),x=(0,o.useId)(),S=r!==void 0,C=S?r:h,w=(0,o.useCallback)(e=>{S||g(e),i?.(e)},[S,i]),T=(0,o.useCallback)(e=>{v(t=>t.includes(e)?t:[...t,e])},[]),E=(0,o.useCallback)(e=>{v(t=>t.filter(t=>t!==e))},[]),D=(0,o.useCallback)(e=>{b(t=>t.includes(e)?t:[...t,e])},[]),O=(0,o.useCallback)(e=>{b(t=>t.filter(t=>t!==e))},[]),k=e?t.Root:`div`;return(0,c.jsx)(l.Provider,{value:{value:C,onValueChange:w,orientation:u,id:x,items:_,registerItem:T,unregisterItem:E,panels:y,registerPanel:D,unregisterPanel:O},children:(0,c.jsx)(`div`,{className:a.default.container,children:(0,c.jsx)(k,{ref:m,className:(0,s.default)(`wim-tabs`,a.default.root,a.default[u],d),...p,children:(0,c.jsx)(t.Slottable,{children:f})})})})}),f=o.default.forwardRef(({asChild:e=!1,className:l,children:d,...f},p)=>{let{orientation:m,value:h,items:g,onValueChange:_}=u(),[v,y]=o.default.useState(!1),[b,x]=o.default.useState(0),[S,C]=o.default.useState(0),{containerRef:w,sliderStyle:T,isReady:E}=i.useIndicator({activeSelector:`.${a.default.trigger}.${a.default.active}`,orientation:m,dependence:h}),D=n.useMergedRef(w,p),O=e=>{m!==`vertical`&&(y(!0),x(e.pageX-(w.current?.offsetLeft||0)),C(w.current?.scrollLeft||0))},k=()=>{y(!1)},A=e=>{if(!v||m===`vertical`)return;e.preventDefault();let t=(e.pageX-(w.current?.offsetLeft||0)-b)*1.5;w.current&&(w.current.scrollLeft=S-t)},j=e=>{let t=h?g.indexOf(h):-1,n=-1;if(m===`horizontal`?(e.key===`ArrowRight`&&(n=(t+1)%g.length),e.key===`ArrowLeft`&&(n=(t-1+g.length)%g.length)):(e.key===`ArrowDown`&&(n=(t+1)%g.length),e.key===`ArrowUp`&&(n=(t-1+g.length)%g.length)),e.key===`Home`&&(n=0),e.key===`End`&&(n=g.length-1),n!==-1){e.preventDefault();let t=g[n];t&&(_(t),(w.current?.querySelector(`[data-value="${t}"]`))?.focus())}};return(0,c.jsxs)(e?t.Root:`div`,{ref:D,role:`tablist`,"aria-orientation":m,tabIndex:0,className:(0,s.default)(a.default.list,v&&a.default.dragging,E&&a.default.ready,l),...f,onMouseDown:e=>r.composeEventHandlers(f.onMouseDown,O)(e),onMouseUp:r.composeEventHandlers(f.onMouseUp,k),onMouseLeave:r.composeEventHandlers(f.onMouseLeave,k),onMouseMove:e=>r.composeEventHandlers(f.onMouseMove,A)(e),onKeyDown:e=>r.composeEventHandlers(f.onKeyDown,j)(e),children:[(0,c.jsx)(`div`,{className:a.default.slider,style:T,"aria-hidden":`true`}),(0,c.jsx)(t.Slottable,{children:d})]})}),p=o.default.forwardRef(({asChild:e=!1,value:n,disabled:i=!1,className:l,children:d,...f},p)=>{let{value:m,onValueChange:h,id:g,registerItem:_,unregisterItem:v,panels:y}=u(),b=m===n;return o.default.useEffect(()=>(_(n),()=>v(n)),[n,_,v]),(0,c.jsx)(e?t.Root:`button`,{ref:p,type:e?void 0:`button`,role:`tab`,"aria-selected":b,"aria-controls":y.includes(n)?`wim-tabs-${g}-panel-${n}`:void 0,id:`wim-tabs-${g}-tab-${n}`,"data-value":n,disabled:i,tabIndex:b?0:-1,className:(0,s.default)(a.default.trigger,b&&a.default.active,l),...f,onClick:r.composeEventHandlers(f.onClick,()=>h(n)),children:(0,c.jsx)(t.Slottable,{children:d})})}),m=o.default.forwardRef(({asChild:e=!1,value:n,className:r,children:i,...l},d)=>{let{value:f,id:p,registerPanel:m,unregisterPanel:h}=u(),g=f===n;return o.default.useEffect(()=>(m(n),()=>h(n)),[n,m,h]),g?(0,c.jsx)(e?t.Root:`div`,{ref:d,role:`tabpanel`,id:`wim-tabs-${p}-panel-${n}`,"aria-labelledby":`wim-tabs-${p}-tab-${n}`,tabIndex:0,className:(0,s.default)(a.default.content,r),...l,children:(0,c.jsx)(t.Slottable,{children:i})}):null});d.displayName=`Tabs`,f.displayName=`Tabs.List`,p.displayName=`Tabs.Trigger`,m.displayName=`Tabs.Content`;var h=d;h.List=f,h.Trigger=p,h.Content=m,exports.Tabs=h,exports.default=h,exports.TabsContent=m,exports.TabsList=f,exports.TabsTrigger=p;
|
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Root as e, Slottable as t } from "../../../node_modules/@radix-ui/react-slot/dist/index.js";
|
|
3
3
|
import { useMergedRef as n } from "../../../hooks/useMergedRef.js";
|
|
4
|
-
import {
|
|
5
|
-
import i from "
|
|
6
|
-
import a
|
|
7
|
-
import d from "
|
|
8
|
-
import
|
|
4
|
+
import { composeEventHandlers as r } from "../../_internal/composeEventHandlers.js";
|
|
5
|
+
import { useIndicator as i } from "../../_internal/useIndicator.js";
|
|
6
|
+
import a from "./tabs.module.js";
|
|
7
|
+
import o, { createContext as s, useCallback as c, useContext as l, useId as u, useState as d } from "react";
|
|
8
|
+
import f from "classnames";
|
|
9
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
9
10
|
//#region src/components/navigation/Tabs/Tabs.tsx
|
|
10
|
-
var
|
|
11
|
-
let e =
|
|
11
|
+
var h = s(null), g = () => {
|
|
12
|
+
let e = l(h);
|
|
12
13
|
if (!e) throw Error("Tabs components must be used within a Tabs");
|
|
13
14
|
return e;
|
|
14
|
-
},
|
|
15
|
-
let [v, y] =
|
|
15
|
+
}, _ = o.forwardRef(({ asChild: n = !1, defaultValue: r, value: i, onChange: o, orientation: s = "horizontal", className: l, children: m, ...g }, _) => {
|
|
16
|
+
let [v, y] = d(r), [b, x] = d([]), [S, C] = d([]), w = u(), T = i !== void 0, E = T ? i : v, D = c((e) => {
|
|
16
17
|
T || y(e), o?.(e);
|
|
17
|
-
}, [T, o]), O =
|
|
18
|
+
}, [T, o]), O = c((e) => {
|
|
18
19
|
x((t) => t.includes(e) ? t : [...t, e]);
|
|
19
|
-
}, []), k =
|
|
20
|
+
}, []), k = c((e) => {
|
|
20
21
|
x((t) => t.filter((t) => t !== e));
|
|
21
|
-
}, []), A =
|
|
22
|
+
}, []), A = c((e) => {
|
|
22
23
|
C((t) => t.includes(e) ? t : [...t, e]);
|
|
23
|
-
}, []), j =
|
|
24
|
+
}, []), j = c((e) => {
|
|
24
25
|
C((t) => t.filter((t) => t !== e));
|
|
25
26
|
}, []), M = n ? e : "div";
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ p(h.Provider, {
|
|
27
28
|
value: {
|
|
28
29
|
value: E,
|
|
29
30
|
onValueChange: D,
|
|
30
|
-
orientation:
|
|
31
|
+
orientation: s,
|
|
31
32
|
id: w,
|
|
32
33
|
items: b,
|
|
33
34
|
registerItem: O,
|
|
@@ -36,96 +37,96 @@ var m = o(null), h = () => {
|
|
|
36
37
|
registerPanel: A,
|
|
37
38
|
unregisterPanel: j
|
|
38
39
|
},
|
|
39
|
-
children: /* @__PURE__ */
|
|
40
|
-
className:
|
|
41
|
-
children: /* @__PURE__ */
|
|
40
|
+
children: /* @__PURE__ */ p("div", {
|
|
41
|
+
className: a.container,
|
|
42
|
+
children: /* @__PURE__ */ p(M, {
|
|
42
43
|
ref: _,
|
|
43
|
-
className:
|
|
44
|
+
className: f("wim-tabs", a.root, a[s], l),
|
|
44
45
|
...g,
|
|
45
|
-
children: /* @__PURE__ */
|
|
46
|
+
children: /* @__PURE__ */ p(t, { children: m })
|
|
46
47
|
})
|
|
47
48
|
})
|
|
48
49
|
});
|
|
49
|
-
}),
|
|
50
|
-
let { orientation:
|
|
51
|
-
activeSelector: `.${
|
|
52
|
-
orientation:
|
|
53
|
-
dependence:
|
|
54
|
-
}),
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
|
|
50
|
+
}), v = o.forwardRef(({ asChild: s = !1, className: c, children: l, ...u }, d) => {
|
|
51
|
+
let { orientation: h, value: _, items: v, onValueChange: y } = g(), [b, x] = o.useState(!1), [S, C] = o.useState(0), [w, T] = o.useState(0), { containerRef: E, sliderStyle: D, isReady: O } = i({
|
|
52
|
+
activeSelector: `.${a.trigger}.${a.active}`,
|
|
53
|
+
orientation: h,
|
|
54
|
+
dependence: _
|
|
55
|
+
}), k = n(E, d), A = (e) => {
|
|
56
|
+
h !== "vertical" && (x(!0), C(e.pageX - (E.current?.offsetLeft || 0)), T(E.current?.scrollLeft || 0));
|
|
57
|
+
}, j = () => {
|
|
58
|
+
x(!1);
|
|
59
|
+
}, M = (e) => {
|
|
60
|
+
if (!b || h === "vertical") return;
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
let t = (e.pageX - (E.current?.offsetLeft || 0) - S) * 1.5;
|
|
63
|
+
E.current && (E.current.scrollLeft = w - t);
|
|
64
|
+
}, N = (e) => {
|
|
65
|
+
let t = _ ? v.indexOf(_) : -1, n = -1;
|
|
66
|
+
if (h === "horizontal" ? (e.key === "ArrowRight" && (n = (t + 1) % v.length), e.key === "ArrowLeft" && (n = (t - 1 + v.length) % v.length)) : (e.key === "ArrowDown" && (n = (t + 1) % v.length), e.key === "ArrowUp" && (n = (t - 1 + v.length) % v.length)), e.key === "Home" && (n = 0), e.key === "End" && (n = v.length - 1), n !== -1) {
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
let t = v[n];
|
|
69
|
+
t && (y(t), (E.current?.querySelector(`[data-value="${t}"]`))?.focus());
|
|
70
|
+
}
|
|
58
71
|
};
|
|
59
|
-
return /* @__PURE__ */
|
|
60
|
-
ref:
|
|
72
|
+
return /* @__PURE__ */ m(s ? e : "div", {
|
|
73
|
+
ref: k,
|
|
61
74
|
role: "tablist",
|
|
62
|
-
"aria-orientation":
|
|
75
|
+
"aria-orientation": h,
|
|
63
76
|
tabIndex: 0,
|
|
64
|
-
className:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
onKeyDown: (e) => {
|
|
75
|
-
let t = g ? _.indexOf(g) : -1, n = -1;
|
|
76
|
-
if (m === "horizontal" ? (e.key === "ArrowRight" && (n = (t + 1) % _.length), e.key === "ArrowLeft" && (n = (t - 1 + _.length) % _.length)) : (e.key === "ArrowDown" && (n = (t + 1) % _.length), e.key === "ArrowUp" && (n = (t - 1 + _.length) % _.length)), e.key === "Home" && (n = 0), e.key === "End" && (n = _.length - 1), n !== -1) {
|
|
77
|
-
e.preventDefault();
|
|
78
|
-
let t = _[n];
|
|
79
|
-
t && (v(t), (T.current?.querySelector(`[data-value="${t}"]`))?.focus());
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
...l,
|
|
83
|
-
children: [/* @__PURE__ */ f("div", {
|
|
84
|
-
className: i.slider,
|
|
85
|
-
style: E,
|
|
77
|
+
className: f(a.list, b && a.dragging, O && a.ready, c),
|
|
78
|
+
...u,
|
|
79
|
+
onMouseDown: (e) => r(u.onMouseDown, A)(e),
|
|
80
|
+
onMouseUp: r(u.onMouseUp, j),
|
|
81
|
+
onMouseLeave: r(u.onMouseLeave, j),
|
|
82
|
+
onMouseMove: (e) => r(u.onMouseMove, M)(e),
|
|
83
|
+
onKeyDown: (e) => r(u.onKeyDown, N)(e),
|
|
84
|
+
children: [/* @__PURE__ */ p("div", {
|
|
85
|
+
className: a.slider,
|
|
86
|
+
style: D,
|
|
86
87
|
"aria-hidden": "true"
|
|
87
|
-
}), /* @__PURE__ */
|
|
88
|
+
}), /* @__PURE__ */ p(t, { children: l })]
|
|
88
89
|
});
|
|
89
|
-
}),
|
|
90
|
-
let { value:
|
|
91
|
-
return
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
]), /* @__PURE__ */
|
|
96
|
-
ref:
|
|
90
|
+
}), y = o.forwardRef(({ asChild: n = !1, value: i, disabled: s = !1, className: c, children: l, ...u }, d) => {
|
|
91
|
+
let { value: m, onValueChange: h, id: _, registerItem: v, unregisterItem: y, panels: b } = g(), x = m === i;
|
|
92
|
+
return o.useEffect(() => (v(i), () => y(i)), [
|
|
93
|
+
i,
|
|
94
|
+
v,
|
|
95
|
+
y
|
|
96
|
+
]), /* @__PURE__ */ p(n ? e : "button", {
|
|
97
|
+
ref: d,
|
|
97
98
|
type: n ? void 0 : "button",
|
|
98
99
|
role: "tab",
|
|
99
|
-
"aria-selected":
|
|
100
|
-
"aria-controls":
|
|
101
|
-
id: `wim-tabs-${
|
|
102
|
-
"data-value":
|
|
103
|
-
disabled:
|
|
104
|
-
tabIndex:
|
|
105
|
-
className:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
children: /* @__PURE__ */
|
|
100
|
+
"aria-selected": x,
|
|
101
|
+
"aria-controls": b.includes(i) ? `wim-tabs-${_}-panel-${i}` : void 0,
|
|
102
|
+
id: `wim-tabs-${_}-tab-${i}`,
|
|
103
|
+
"data-value": i,
|
|
104
|
+
disabled: s,
|
|
105
|
+
tabIndex: x ? 0 : -1,
|
|
106
|
+
className: f(a.trigger, x && a.active, c),
|
|
107
|
+
...u,
|
|
108
|
+
onClick: r(u.onClick, () => h(i)),
|
|
109
|
+
children: /* @__PURE__ */ p(t, { children: l })
|
|
109
110
|
});
|
|
110
|
-
}),
|
|
111
|
-
let { value: u, id:
|
|
112
|
-
return
|
|
111
|
+
}), b = o.forwardRef(({ asChild: n = !1, value: r, className: i, children: s, ...c }, l) => {
|
|
112
|
+
let { value: u, id: d, registerPanel: m, unregisterPanel: h } = g(), _ = u === r;
|
|
113
|
+
return o.useEffect(() => (m(r), () => h(r)), [
|
|
113
114
|
r,
|
|
114
115
|
m,
|
|
115
|
-
|
|
116
|
-
]), _ ? /* @__PURE__ */
|
|
116
|
+
h
|
|
117
|
+
]), _ ? /* @__PURE__ */ p(n ? e : "div", {
|
|
117
118
|
ref: l,
|
|
118
119
|
role: "tabpanel",
|
|
119
|
-
id: `wim-tabs-${
|
|
120
|
-
"aria-labelledby": `wim-tabs-${
|
|
120
|
+
id: `wim-tabs-${d}-panel-${r}`,
|
|
121
|
+
"aria-labelledby": `wim-tabs-${d}-tab-${r}`,
|
|
121
122
|
tabIndex: 0,
|
|
122
|
-
className:
|
|
123
|
+
className: f(a.content, i),
|
|
123
124
|
...c,
|
|
124
|
-
children: /* @__PURE__ */
|
|
125
|
+
children: /* @__PURE__ */ p(t, { children: s })
|
|
125
126
|
}) : null;
|
|
126
127
|
});
|
|
127
|
-
|
|
128
|
-
var
|
|
129
|
-
|
|
128
|
+
_.displayName = "Tabs", v.displayName = "Tabs.List", y.displayName = "Tabs.Trigger", b.displayName = "Tabs.Content";
|
|
129
|
+
var x = _;
|
|
130
|
+
x.List = v, x.Trigger = y, x.Content = b;
|
|
130
131
|
//#endregion
|
|
131
|
-
export {
|
|
132
|
+
export { x as Tabs, x as default, b as TabsContent, v as TabsList, y as TabsTrigger };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/common.cjs"),r=require("../../layout/Transition/Transition.cjs"),i=require("../../../icon/close.cjs"),a=require("../../media/Icon/Icon.cjs"),o=require("./popover.module.cjs"),s=require("../../_internal/useFloatingElement.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"),d=require("@floating-ui/react");var f=c.default.createContext(null),p=({children:e,className:t,defaultOpen:n=!1,open:r,onOpenChange:i,placement:a=`bottom-start`,variant:d=`default`})=>{let{isOpen:p,setOpen:m,refs:h,floatingStyles:g,context:_,getReferenceProps:v,getFloatingProps:y}=s.useFloatingElement({placement:a,open:r,defaultOpen:n,onOpenChange:i,trigger:`click`}),b=()=>m(!1),x=c.default.useId(),[S,C]=c.default.useState(`wim-popover-trigger-${x}`);return(0,u.jsx)(f.Provider,{value:{open:p,onOpenChange:m,refs:h,floatingStyles:g,context:_,getReferenceProps:v,getFloatingProps:y,close:b,variant:d,triggerId:S,setTriggerId:C},children:(0,u.jsx)(`div`,{className:(0,l.default)(`wim-popover`,o.default.root,t),children:e})})},m=c.default.forwardRef(({children:e,className:t,asChild:n,...r},i)=>{let a=c.default.useContext(f);if(a==null)throw Error(`Popover components must be wrapped in <Popover />`);let s=e.ref,p=(0,d.useMergeRefs)([a.refs.setReference,i,s??null]),m=n&&c.default.isValidElement(e)?e.props.id:void 0,h=r.id??m??a.triggerId,{setTriggerId:g}=a;if(c.default.useLayoutEffect(()=>{g(h)},[h,g]),n&&c.default.isValidElement(e)){let n=e.props,i=a.getReferenceProps({ref:p,...r,...n,id:h,className:(0,l.default)(t,n.className)});return c.default.cloneElement(e,{...i,"data-state":a.open?`open`:`closed`})}return(0,u.jsx)(`button`,{ref:p,type:`button`,className:(0,l.default)(o.default.trigger,t),"data-state":a.open?`open`:`closed`,...a.getReferenceProps({...r,id:h}),children:e})});m.displayName=`PopoverTrigger`;var h=c.default.forwardRef(({children:e,className:t,align:n,side:i,style:a,modal:s=!1,...p},m)=>{let h=c.default.useContext(f);if(h==null)throw Error(`Popover components must be wrapped in <Popover />`);let{open:g,refs:_,floatingStyles:v,getFloatingProps:y,context:b,triggerId:x}=h,S=p[`aria-label`]!=null||p[`aria-labelledby`]!=null?p[`aria-labelledby`]:x,C=(0,d.useMergeRefs)([_.setFloating,m]);return(0,u.jsx)(d.FloatingPortal,{children:(0,u.jsx)(r.Transition,{show:g,preset:`fade`,children:(0,u.jsx)(d.FloatingFocusManager,{context:b,modal:s,children:(0,u.jsx)(`div`,{ref:C,style:{...v,...a},className:(0,l.default)(o.default.content,o.default[h.variant],t),role:`dialog`,...y(p),"aria-labelledby":S,children:e})})})})});h.displayName=`PopoverContent`;var g=({children:e,className:r,asChild:s,ariaLabel:d,...p})=>{let{t:m}=t.useWimTranslation(n.commonNs),h=d??m(`a11y.close`),g=c.default.useContext(f);if(!g)return null;let{close:_}=g,v=e=>{_(),p.onClick?.(e)};return s&&c.default.isValidElement(e)?c.default.cloneElement(e,{onClick:t=>{e.props.onClick?.(t),v(t)},className:(0,l.default)(r,e.props.className)}):(0,u.jsx)(`button`,{type:`button`,className:(0,l.default)(o.default.close,r),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/common.cjs"),r=require("../../layout/Transition/Transition.cjs"),i=require("../../../icon/close.cjs"),a=require("../../media/Icon/Icon.cjs"),o=require("./popover.module.cjs"),s=require("../../_internal/useFloatingElement.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"),d=require("@floating-ui/react");var f=c.default.createContext(null),p=({children:e,className:t,defaultOpen:n=!1,open:r,onOpenChange:i,placement:a=`bottom-start`,variant:d=`default`})=>{let{isOpen:p,setOpen:m,refs:h,floatingStyles:g,context:_,getReferenceProps:v,getFloatingProps:y}=s.useFloatingElement({placement:a,open:r,defaultOpen:n,onOpenChange:i,trigger:`click`}),b=()=>m(!1),x=c.default.useId(),[S,C]=c.default.useState(`wim-popover-trigger-${x}`);return(0,u.jsx)(f.Provider,{value:{open:p,onOpenChange:m,refs:h,floatingStyles:g,context:_,getReferenceProps:v,getFloatingProps:y,close:b,variant:d,triggerId:S,setTriggerId:C},children:(0,u.jsx)(`div`,{className:(0,l.default)(`wim-popover`,o.default.root,t),children:e})})},m=c.default.forwardRef(({children:e,className:t,asChild:n,...r},i)=>{let a=c.default.useContext(f);if(a==null)throw Error(`Popover components must be wrapped in <Popover />`);let s=e.ref,p=(0,d.useMergeRefs)([a.refs.setReference,i,s??null]),m=n&&c.default.isValidElement(e)?e.props.id:void 0,h=r.id??m??a.triggerId,{setTriggerId:g}=a;if(c.default.useLayoutEffect(()=>{g(h)},[h,g]),n&&c.default.isValidElement(e)){let n=e.props,i=a.getReferenceProps({ref:p,...r,...n,id:h,className:(0,l.default)(t,n.className)});return c.default.cloneElement(e,{...i,"data-state":a.open?`open`:`closed`})}return(0,u.jsx)(`button`,{ref:p,type:`button`,className:(0,l.default)(o.default.trigger,t),"data-state":a.open?`open`:`closed`,...a.getReferenceProps({...r,id:h}),children:e})});m.displayName=`PopoverTrigger`;var h=c.default.forwardRef(({children:e,className:t,align:n,side:i,style:a,modal:s=!1,...p},m)=>{let h=c.default.useContext(f);if(h==null)throw Error(`Popover components must be wrapped in <Popover />`);let{open:g,refs:_,floatingStyles:v,getFloatingProps:y,context:b,triggerId:x}=h,S=p[`aria-label`]!=null||p[`aria-labelledby`]!=null?p[`aria-labelledby`]:x,C=(0,d.useMergeRefs)([_.setFloating,m]);return(0,u.jsx)(d.FloatingPortal,{children:(0,u.jsx)(r.Transition,{show:g,preset:`fade`,children:(0,u.jsx)(d.FloatingFocusManager,{context:b,modal:s,children:(0,u.jsx)(`div`,{ref:C,style:{...v,...a},className:(0,l.default)(o.default.content,o.default[h.variant],t),role:`dialog`,...y(p),"aria-labelledby":S,children:e})})})})});h.displayName=`PopoverContent`;var g=({children:e,className:r,asChild:s,ariaLabel:d,...p})=>{let{t:m}=t.useWimTranslation(n.commonNs),h=d??m(`a11y.close`),g=c.default.useContext(f);if(!g)return null;let{close:_}=g,v=e=>{_(),p.onClick?.(e)};return s&&c.default.isValidElement(e)?c.default.cloneElement(e,{onClick:t=>{e.props.onClick?.(t),v(t)},className:(0,l.default)(r,e.props.className)}):(0,u.jsx)(`button`,{type:`button`,className:(0,l.default)(o.default.close,r),"aria-label":h,...p,onClick:v,children:e||(0,u.jsx)(a.Icon,{component:i.default,size:`sm`})})};exports.Popover=p,exports.PopoverClose=g,exports.PopoverContent=h,exports.PopoverTrigger=m;
|
|
@@ -114,9 +114,9 @@ var _ = ({ children: n, className: o, asChild: u, ariaLabel: d, ...f }) => {
|
|
|
114
114
|
}) : /* @__PURE__ */ l("button", {
|
|
115
115
|
type: "button",
|
|
116
116
|
className: c(a.close, o),
|
|
117
|
-
onClick: v,
|
|
118
117
|
"aria-label": h,
|
|
119
118
|
...f,
|
|
119
|
+
onClick: v,
|
|
120
120
|
children: n || /* @__PURE__ */ l(i, {
|
|
121
121
|
component: r,
|
|
122
122
|
size: "sm"
|
package/dist/llms-full.txt
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## What this is
|
|
6
6
|
|
|
7
|
-
**wimui** v0.63.
|
|
7
|
+
**wimui** v0.63.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
|
|
package/dist/llms.txt
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## What this is
|
|
6
6
|
|
|
7
|
-
**wimui** v0.63.
|
|
7
|
+
**wimui** v0.63.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
|
|