wimui 0.62.2 → 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/_internal/observeMove.cjs +2 -0
- package/dist/components/_internal/observeMove.d.ts +16 -0
- package/dist/components/_internal/observeMove.js +44 -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/feedback/Tour/Tour.cjs +1 -1
- package/dist/components/feedback/Tour/Tour.js +91 -88
- package/dist/components/form/Button/Button.cjs +1 -1
- package/dist/components/form/Button/Button.d.ts +2 -2
- package/dist/components/form/Button/Button.js +14 -12
- 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/Textarea/Textarea.cjs +1 -1
- package/dist/components/form/Textarea/Textarea.js +4 -4
- package/dist/components/form/TimePicker/TimePicker.cjs +1 -1
- package/dist/components/form/TimePicker/TimePicker.js +31 -30
- package/dist/components/layout/Dashboard/Dashboard.cjs +1 -1
- package/dist/components/layout/Dashboard/Dashboard.js +3 -2
- 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 -66
- 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 -73
- package/dist/components/media/Video/Video.cjs +1 -1
- package/dist/components/media/Video/Video.js +114 -113
- package/dist/components/navigation/Affix/Affix.cjs +1 -1
- package/dist/components/navigation/Affix/Affix.js +39 -36
- package/dist/components/navigation/Menubar/Menubar.cjs +1 -1
- package/dist/components/navigation/Menubar/Menubar.js +67 -61
- 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/Dropdown/Dropdown.cjs +1 -1
- package/dist/components/overlay/Dropdown/Dropdown.js +42 -36
- package/dist/components/overlay/Popover/Popover.cjs +1 -1
- package/dist/components/overlay/Popover/Popover.js +1 -1
- package/dist/llms-full.txt +3 -3
- package/dist/llms.txt +1 -1
- package/dist/wimui.umd.js +5 -5
- package/package.json +1 -1
|
@@ -1,106 +1,107 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Root as e, Slottable as t } from "../../../node_modules/@radix-ui/react-slot/dist/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import i from "
|
|
6
|
-
import
|
|
7
|
-
import d from "
|
|
8
|
-
import
|
|
3
|
+
import { composeEventHandlers as n } from "../../_internal/composeEventHandlers.js";
|
|
4
|
+
import { FieldTemplate as r } from "../FieldTemplate/FieldTemplate.js";
|
|
5
|
+
import { useSliderCommon as i } from "../../../utilities/slider-utils.js";
|
|
6
|
+
import a from "./slider.module.js";
|
|
7
|
+
import { forwardRef as o, useCallback as s, useEffect as c, useId as l, useRef 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/form/Slider/Slider.tsx
|
|
10
|
-
var
|
|
11
|
-
let N =
|
|
11
|
+
var h = o(({ value: o, defaultValue: h = 0, min: g = 0, max: _ = 100, step: v = 1, disabled: y = !1, onChange: b, onAfterChange: x, className: S, name: C, label: w, error: T, required: E, layout: ee = "vertical", id: te, "aria-label": ne, "aria-labelledby": re, "aria-describedby": D, asChild: O = !1, styles: k, children: A, ...j }, M) => {
|
|
12
|
+
let N = o !== void 0, [P, F] = d(h), I = N ? o : P, L = u(null), R = u(null), z = u(null), B = u(null), V = u(!1), H = u(I), U = l(), W = te || U, G = `wim-slider-label-${W}`, K = `wim-slider-error-${W}`, { calculateValue: q } = i(g, _, v), J = s((e) => (e - g) / (_ - g) * 100, [g, _]), Y = s((e) => {
|
|
12
13
|
let t = J(e);
|
|
13
14
|
z.current && (z.current.style.width = `${t}%`), R.current && (R.current.style.left = `${t}%`, R.current.setAttribute("aria-valuenow", String(e))), B.current && (B.current.value = String(e));
|
|
14
15
|
}, [J]);
|
|
15
|
-
|
|
16
|
+
c(() => {
|
|
16
17
|
V.current || Y(I);
|
|
17
18
|
}, [I, Y]);
|
|
18
19
|
let X = (e) => {
|
|
19
|
-
if (
|
|
20
|
+
if (y) return;
|
|
20
21
|
V.current = !0;
|
|
21
22
|
let t = "touches" in e ? e.touches[0].clientX : e.clientX, n = q(t, L.current);
|
|
22
|
-
H.current = n, Y(n),
|
|
23
|
-
}, Z =
|
|
24
|
-
if (!V.current ||
|
|
23
|
+
H.current = n, Y(n), b?.(n), e.preventDefault();
|
|
24
|
+
}, Z = s((e) => {
|
|
25
|
+
if (!V.current || y) return;
|
|
25
26
|
let t = "touches" in e ? e.touches[0].clientX : e.clientX, n = q(t, L.current);
|
|
26
|
-
H.current = n, Y(n),
|
|
27
|
+
H.current = n, Y(n), b?.(n);
|
|
27
28
|
}, [
|
|
28
|
-
v,
|
|
29
|
-
q,
|
|
30
29
|
y,
|
|
30
|
+
q,
|
|
31
|
+
b,
|
|
31
32
|
Y
|
|
32
|
-
]), Q =
|
|
33
|
+
]), Q = s(() => {
|
|
33
34
|
if (V.current) {
|
|
34
35
|
V.current = !1;
|
|
35
36
|
let e = H.current;
|
|
36
|
-
N || F(e),
|
|
37
|
+
N || F(e), x?.(e);
|
|
37
38
|
}
|
|
38
|
-
}, [N,
|
|
39
|
-
|
|
39
|
+
}, [N, x]);
|
|
40
|
+
c(() => (document.addEventListener("mousemove", Z), document.addEventListener("mouseup", Q), document.addEventListener("touchmove", Z, { passive: !1 }), document.addEventListener("touchend", Q), () => {
|
|
40
41
|
document.removeEventListener("mousemove", Z), document.removeEventListener("mouseup", Q), document.removeEventListener("touchmove", Z), document.removeEventListener("touchend", Q);
|
|
41
42
|
}), [Z, Q]);
|
|
42
|
-
let
|
|
43
|
-
if (
|
|
43
|
+
let ie = (e) => {
|
|
44
|
+
if (y) return;
|
|
44
45
|
let t;
|
|
45
|
-
if (e.key === "ArrowLeft" || e.key === "ArrowDown") t = Math.max(
|
|
46
|
-
else if (e.key === "ArrowRight" || e.key === "ArrowUp") t = Math.min(
|
|
47
|
-
else if (e.key === "Home") t =
|
|
48
|
-
else if (e.key === "End") t =
|
|
46
|
+
if (e.key === "ArrowLeft" || e.key === "ArrowDown") t = Math.max(g, I - v);
|
|
47
|
+
else if (e.key === "ArrowRight" || e.key === "ArrowUp") t = Math.min(_, I + v);
|
|
48
|
+
else if (e.key === "Home") t = g;
|
|
49
|
+
else if (e.key === "End") t = _;
|
|
49
50
|
else return;
|
|
50
|
-
N || F(t),
|
|
51
|
+
N || F(t), b?.(t), e.preventDefault();
|
|
51
52
|
}, $ = J(I);
|
|
52
|
-
return /* @__PURE__ */
|
|
53
|
-
label:
|
|
54
|
-
error:
|
|
55
|
-
required:
|
|
56
|
-
layout:
|
|
53
|
+
return /* @__PURE__ */ p(r, {
|
|
54
|
+
label: w,
|
|
55
|
+
error: T,
|
|
56
|
+
required: E,
|
|
57
|
+
layout: ee,
|
|
57
58
|
labelId: G,
|
|
58
59
|
errorId: K,
|
|
59
|
-
className:
|
|
60
|
+
className: S,
|
|
60
61
|
styles: k,
|
|
61
|
-
children: /* @__PURE__ */
|
|
62
|
+
children: /* @__PURE__ */ m(O ? e : "div", {
|
|
62
63
|
role: "presentation",
|
|
63
|
-
className:
|
|
64
|
-
onMouseDown: X,
|
|
65
|
-
onTouchStart: X,
|
|
64
|
+
className: f("wim-slider", a.root, y && a.disabled, T && a.danger),
|
|
66
65
|
ref: M,
|
|
67
66
|
...j,
|
|
67
|
+
onMouseDown: n(j.onMouseDown, X),
|
|
68
|
+
onTouchStart: n(j.onTouchStart, X),
|
|
68
69
|
children: [
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
className:
|
|
70
|
+
/* @__PURE__ */ m("div", {
|
|
71
|
+
className: a.trackContainer,
|
|
71
72
|
ref: L,
|
|
72
|
-
children: [/* @__PURE__ */
|
|
73
|
+
children: [/* @__PURE__ */ p("div", {
|
|
73
74
|
ref: z,
|
|
74
|
-
className:
|
|
75
|
+
className: a.track,
|
|
75
76
|
style: { width: `${$}%` }
|
|
76
|
-
}), /* @__PURE__ */
|
|
77
|
+
}), /* @__PURE__ */ p("div", {
|
|
77
78
|
ref: R,
|
|
78
|
-
className:
|
|
79
|
+
className: a.thumb,
|
|
79
80
|
style: { left: `${$}%` },
|
|
80
81
|
role: "slider",
|
|
81
|
-
"aria-valuemin":
|
|
82
|
-
"aria-valuemax":
|
|
82
|
+
"aria-valuemin": g,
|
|
83
|
+
"aria-valuemax": _,
|
|
83
84
|
"aria-valuenow": I,
|
|
84
|
-
"aria-disabled":
|
|
85
|
-
"aria-labelledby":
|
|
86
|
-
"aria-label":
|
|
87
|
-
"aria-describedby": [D,
|
|
88
|
-
"aria-invalid":
|
|
89
|
-
tabIndex:
|
|
90
|
-
onKeyDown:
|
|
85
|
+
"aria-disabled": y,
|
|
86
|
+
"aria-labelledby": w ? G : re,
|
|
87
|
+
"aria-label": w ? void 0 : ne,
|
|
88
|
+
"aria-describedby": [D, T ? K : void 0].filter(Boolean).join(" ") || void 0,
|
|
89
|
+
"aria-invalid": T ? !0 : void 0,
|
|
90
|
+
tabIndex: y ? -1 : 0,
|
|
91
|
+
onKeyDown: ie
|
|
91
92
|
})]
|
|
92
93
|
}),
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ p("input", {
|
|
94
95
|
ref: B,
|
|
95
96
|
type: "hidden",
|
|
96
|
-
name:
|
|
97
|
+
name: C,
|
|
97
98
|
value: I
|
|
98
99
|
}),
|
|
99
|
-
O ? /* @__PURE__ */
|
|
100
|
+
O ? /* @__PURE__ */ p(t, { children: A }) : null
|
|
100
101
|
]
|
|
101
102
|
})
|
|
102
103
|
});
|
|
103
104
|
});
|
|
104
|
-
|
|
105
|
+
h.displayName = "Slider";
|
|
105
106
|
//#endregion
|
|
106
|
-
export {
|
|
107
|
+
export { h as Slider, h as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../InputBase/InputBase.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../_internal/composeEventHandlers.cjs"),r=require("../InputBase/InputBase.cjs"),i=require("../../../i18n/generated/form.cjs"),a=require("../FieldTemplate/FieldTemplate.cjs"),o=require("../../../hooks/useAutoResize.cjs"),s=require("../../_internal/FieldCharacterCount/FieldCharacterCount.cjs"),c=require("./smart-search-input.module.cjs");let l=require("react");l=e.__toESM(l,1);let u=require("classnames");u=e.__toESM(u,1);let d=require("react/jsx-runtime");var f=(0,l.forwardRef)(({intent:e=`default`,variant:f=`outline`,fullWidth:p=!1,width:m,label:h,error:g,required:_,layout:v,maxRows:y=8,allowClear:b=!0,onClear:x,onSubmit:S,onChange:C,value:w,defaultValue:T=``,placeholder:E,disabled:D,className:O,id:k,maxLength:A,"aria-label":j,...M},N)=>{let{t:P}=t.useWimTranslation(i.formNs),F=w!==void 0,[I,L]=l.default.useState(T),R=F?w:I,z=o.useAutoResize(R,y);l.default.useImperativeHandle(N,()=>z.current);let B=(0,l.useId)(),V=k||`smart-search-${B}`,H=g?`${V}-error`:void 0,U=h?`${V}-label`:void 0,W=(0,l.useCallback)(e=>{let t=e.target.value;F||L(t),C?.(t)},[F,C]),G=(0,l.useCallback)(()=>{R.trim()&&!D&&S?.(R.trim())},[R,D,S]),K=(0,l.useCallback)(e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),G())},[G]),q=()=>{F||L(``),C?.(``),x?.(),z.current?.focus()},J=g?`danger`:e;return(0,d.jsx)(a.FieldTemplate,{label:h,error:g,required:_,layout:v,htmlFor:V,labelId:U,errorId:H,className:(0,u.default)(`wim-smart-search-input`,O,p&&c.default.fullWidth),children:(0,d.jsxs)(`div`,{className:c.default.container,children:[(0,d.jsx)(r.InputBase,{intent:J,variant:f,fullWidth:p,width:m,disabled:D,leftIcon:`SearchIcon`,styles:{icon:c.default.icon,icons:c.default.icons},allowClear:b,hasValue:!!R,onClear:q,children:(0,d.jsx)(`textarea`,{id:V,ref:z,className:(0,u.default)(c.default.textarea,c.default[f]),value:R,onChange:W,placeholder:E,rows:1,disabled:D,maxLength:A,"aria-label":j??(h?void 0:P(`smart_search.input_label`)),...M,onKeyDown:n.composeEventHandlers(M.onKeyDown,K)})}),(0,d.jsx)(s.FieldCharacterCount,{count:R.length,maxLength:A,className:c.default.charCount})]})})});f.displayName=`SmartSearchInput`,exports.SmartSearchInput=f;
|
|
@@ -1,79 +1,80 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import o from "
|
|
9
|
-
import s
|
|
10
|
-
import d from "
|
|
11
|
-
import
|
|
3
|
+
import { composeEventHandlers as t } from "../../_internal/composeEventHandlers.js";
|
|
4
|
+
import { InputBase as n } from "../InputBase/InputBase.js";
|
|
5
|
+
import { formNs as r } from "../../../i18n/generated/form.js";
|
|
6
|
+
import { FieldTemplate as i } from "../FieldTemplate/FieldTemplate.js";
|
|
7
|
+
import { useAutoResize as a } from "../../../hooks/useAutoResize.js";
|
|
8
|
+
import { FieldCharacterCount as o } from "../../_internal/FieldCharacterCount/FieldCharacterCount.js";
|
|
9
|
+
import s from "./smart-search-input.module.js";
|
|
10
|
+
import c, { forwardRef as l, useCallback as u, useId as d } from "react";
|
|
11
|
+
import f from "classnames";
|
|
12
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
12
13
|
//#region src/components/form/SmartSearchInput/SmartSearchInput.tsx
|
|
13
|
-
var
|
|
14
|
-
let { t:
|
|
15
|
-
|
|
16
|
-
let
|
|
14
|
+
var h = l(({ intent: l = "default", variant: h = "outline", fullWidth: g = !1, width: _, label: v, error: y, required: b, layout: x, maxRows: S = 8, allowClear: C = !0, onClear: w, onSubmit: T, onChange: E, value: D, defaultValue: O = "", placeholder: k, disabled: A, className: j, id: M, maxLength: N, "aria-label": P, ...F }, I) => {
|
|
15
|
+
let { t: L } = e(r), R = D !== void 0, [z, B] = c.useState(O), V = R ? D : z, H = a(V, S);
|
|
16
|
+
c.useImperativeHandle(I, () => H.current);
|
|
17
|
+
let U = d(), W = M || `smart-search-${U}`, G = y ? `${W}-error` : void 0, K = v ? `${W}-label` : void 0, q = u((e) => {
|
|
17
18
|
let t = e.target.value;
|
|
18
|
-
|
|
19
|
-
}, [
|
|
20
|
-
|
|
19
|
+
R || B(t), E?.(t);
|
|
20
|
+
}, [R, E]), J = u(() => {
|
|
21
|
+
V.trim() && !A && T?.(V.trim());
|
|
21
22
|
}, [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
]),
|
|
26
|
-
e.key === "Enter" && !e.shiftKey && (e.preventDefault(),
|
|
27
|
-
}, [
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
label:
|
|
32
|
-
error:
|
|
33
|
-
required:
|
|
34
|
-
layout:
|
|
35
|
-
htmlFor:
|
|
36
|
-
labelId:
|
|
37
|
-
errorId:
|
|
38
|
-
className:
|
|
39
|
-
children: /* @__PURE__ */
|
|
40
|
-
className:
|
|
41
|
-
children: [/* @__PURE__ */
|
|
42
|
-
intent:
|
|
43
|
-
variant:
|
|
44
|
-
fullWidth:
|
|
45
|
-
width:
|
|
46
|
-
disabled:
|
|
23
|
+
V,
|
|
24
|
+
A,
|
|
25
|
+
T
|
|
26
|
+
]), Y = u((e) => {
|
|
27
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), J());
|
|
28
|
+
}, [J]), X = () => {
|
|
29
|
+
R || B(""), E?.(""), w?.(), H.current?.focus();
|
|
30
|
+
}, Z = y ? "danger" : l;
|
|
31
|
+
return /* @__PURE__ */ p(i, {
|
|
32
|
+
label: v,
|
|
33
|
+
error: y,
|
|
34
|
+
required: b,
|
|
35
|
+
layout: x,
|
|
36
|
+
htmlFor: W,
|
|
37
|
+
labelId: K,
|
|
38
|
+
errorId: G,
|
|
39
|
+
className: f("wim-smart-search-input", j, g && s.fullWidth),
|
|
40
|
+
children: /* @__PURE__ */ m("div", {
|
|
41
|
+
className: s.container,
|
|
42
|
+
children: [/* @__PURE__ */ p(n, {
|
|
43
|
+
intent: Z,
|
|
44
|
+
variant: h,
|
|
45
|
+
fullWidth: g,
|
|
46
|
+
width: _,
|
|
47
|
+
disabled: A,
|
|
47
48
|
leftIcon: "SearchIcon",
|
|
48
49
|
styles: {
|
|
49
|
-
icon:
|
|
50
|
-
icons:
|
|
50
|
+
icon: s.icon,
|
|
51
|
+
icons: s.icons
|
|
51
52
|
},
|
|
52
|
-
allowClear:
|
|
53
|
-
hasValue: !!
|
|
54
|
-
onClear:
|
|
55
|
-
children: /* @__PURE__ */
|
|
56
|
-
id:
|
|
57
|
-
ref:
|
|
58
|
-
className:
|
|
59
|
-
value:
|
|
60
|
-
onChange:
|
|
61
|
-
|
|
62
|
-
placeholder: O,
|
|
53
|
+
allowClear: C,
|
|
54
|
+
hasValue: !!V,
|
|
55
|
+
onClear: X,
|
|
56
|
+
children: /* @__PURE__ */ p("textarea", {
|
|
57
|
+
id: W,
|
|
58
|
+
ref: H,
|
|
59
|
+
className: f(s.textarea, s[h]),
|
|
60
|
+
value: V,
|
|
61
|
+
onChange: q,
|
|
62
|
+
placeholder: k,
|
|
63
63
|
rows: 1,
|
|
64
|
-
disabled:
|
|
65
|
-
maxLength:
|
|
66
|
-
"aria-label":
|
|
67
|
-
...
|
|
64
|
+
disabled: A,
|
|
65
|
+
maxLength: N,
|
|
66
|
+
"aria-label": P ?? (v ? void 0 : L("smart_search.input_label")),
|
|
67
|
+
...F,
|
|
68
|
+
onKeyDown: t(F.onKeyDown, Y)
|
|
68
69
|
})
|
|
69
|
-
}), /* @__PURE__ */
|
|
70
|
-
count:
|
|
71
|
-
maxLength:
|
|
72
|
-
className:
|
|
70
|
+
}), /* @__PURE__ */ p(o, {
|
|
71
|
+
count: V.length,
|
|
72
|
+
maxLength: N,
|
|
73
|
+
className: s.charCount
|
|
73
74
|
})]
|
|
74
75
|
})
|
|
75
76
|
});
|
|
76
77
|
});
|
|
77
|
-
|
|
78
|
+
h.displayName = "SmartSearchInput";
|
|
78
79
|
//#endregion
|
|
79
|
-
export {
|
|
80
|
+
export { h as SmartSearchInput };
|
|
@@ -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("../FieldTemplate/FieldTemplate.cjs"),r=require("./textarea.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=i.default.forwardRef(({asChild:e=!1,children:s,intent:c=`default`,variant:l=`outline`,fullWidth:u=!1,fieldSizing:d=`fixed`,className:f,disabled:p,label:m,error:h,required:g,layout:_,id:v,width:y,...b},x)=>{let S=p,C=h?`danger`:c,w=i.default.useId(),T=v||`wim-textarea-${w}`,E=h?`${T}-error`:void 0,D=m?`${T}-label`:void 0,O=typeof y==`string`&&[`xs`,`sm`,`md`,`lg`,`xl`].includes(y),k=y!==void 0&&!O&&!u,A=O&&!u?y:void 0,j=A?r.default[`width${A.charAt(0).toUpperCase()}${A.slice(1)}`]:void 0;return(0,o.jsx)(n.FieldTemplate,{label:m,error:h,required:g,layout:_,labelId:D,errorId:E,className:f,children:(0,o.jsx)(e?t.Root:`textarea`,{id:T,ref:x,className:(0,a.default)(`wim-textarea`,r.default.root,r.default[C],S&&r.default.disabled,r.default[l],u&&r.default.fullWidth,k&&r.default.hasCustomWidth,j,d===`content`&&r.default.fieldSizingContent),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../FieldTemplate/FieldTemplate.cjs"),r=require("./textarea.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=i.default.forwardRef(({asChild:e=!1,children:s,intent:c=`default`,variant:l=`outline`,fullWidth:u=!1,fieldSizing:d=`fixed`,className:f,disabled:p,label:m,error:h,required:g,layout:_,id:v,width:y,...b},x)=>{let S=p,C=h?`danger`:c,w=i.default.useId(),T=v||`wim-textarea-${w}`,E=h?`${T}-error`:void 0,D=m?`${T}-label`:void 0,O=typeof y==`string`&&[`xs`,`sm`,`md`,`lg`,`xl`].includes(y),k=y!==void 0&&!O&&!u,A=O&&!u?y:void 0,j=A?r.default[`width${A.charAt(0).toUpperCase()}${A.slice(1)}`]:void 0;return(0,o.jsx)(n.FieldTemplate,{label:m,error:h,required:g,layout:_,labelId:D,errorId:E,className:f,children:(0,o.jsx)(e?t.Root:`textarea`,{id:T,ref:x,className:(0,a.default)(`wim-textarea`,r.default.root,r.default[C],S&&r.default.disabled,r.default[l],u&&r.default.fullWidth,k&&r.default.hasCustomWidth,j,d===`content`&&r.default.fieldSizingContent),disabled:S,"aria-invalid":C===`danger`,"aria-describedby":E,"aria-labelledby":m?D:void 0,"aria-required":g,...b,style:{...k?{"--wim-input-width":typeof y==`number`?`${y}px`:y}:{},...b.style},placeholder:b.placeholder,"aria-label":b[`aria-label`],children:e?(0,o.jsx)(t.Slottable,{children:s}):s})})});s.displayName=`Textarea`,exports.Textarea=s;
|
|
@@ -26,16 +26,16 @@ var s = i.forwardRef(({ asChild: s = !1, children: c, intent: l = "default", var
|
|
|
26
26
|
id: E,
|
|
27
27
|
ref: S,
|
|
28
28
|
className: a("wim-textarea", r.root, r[w], C && r.disabled, r[u], d && r.fullWidth, A && r.hasCustomWidth, M, f === "content" && r.fieldSizingContent),
|
|
29
|
-
style: {
|
|
30
|
-
...A ? { "--wim-input-width": typeof b == "number" ? `${b}px` : b } : {},
|
|
31
|
-
...x.style
|
|
32
|
-
},
|
|
33
29
|
disabled: C,
|
|
34
30
|
"aria-invalid": w === "danger",
|
|
35
31
|
"aria-describedby": D,
|
|
36
32
|
"aria-labelledby": h ? O : void 0,
|
|
37
33
|
"aria-required": _,
|
|
38
34
|
...x,
|
|
35
|
+
style: {
|
|
36
|
+
...A ? { "--wim-input-width": typeof b == "number" ? `${b}px` : b } : {},
|
|
37
|
+
...x.style
|
|
38
|
+
},
|
|
39
39
|
placeholder: x.placeholder,
|
|
40
40
|
"aria-label": x["aria-label"],
|
|
41
41
|
children: s ? /* @__PURE__ */ o(t, { children: c }) : c
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../hooks/useMergedRef.cjs"),n=require("../Input/input.module.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../hooks/useMergedRef.cjs"),n=require("../../_internal/composeEventHandlers.cjs"),r=require("../Input/input.module.cjs"),i=require("../Input/Input.cjs"),a=require("./time-picker.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.forwardRef)(({intent:e=`default`,variant:l=`outline`,fullWidth:u=!1,className:d,disabled:f,allowClear:p=!0,value:m,defaultValue:h,onChange:g,..._},v)=>{let y=m!==void 0,[b,x]=(0,o.useState)(h??``),S=y?m:b,C=(0,o.useRef)(null),w=t.useMergedRef(v,C),T=p&&!!S&&!f,E=T?void 0:`ClockIcon`,D=e=>{y||x(e.target.value),g?.(e)},O=()=>{C.current?.showPicker?.()};return(0,c.jsx)(i.Input,{ref:w,type:`time`,allowClear:T,intent:e,variant:l,fullWidth:u,className:(0,s.default)(`wim-time-picker`,d),inputClassName:(0,s.default)(r.default.root,a.default.input),disabled:f,value:m,defaultValue:h,onChange:D,rightIcon:E,rightIconColor:f||T?void 0:`primary`,rightIconDecorative:!0,..._,onRightIconClick:T?_.onRightIconClick:n.composeEventHandlers(_.onRightIconClick,O)})});l.displayName=`TimePicker`,exports.TimePicker=l;
|
|
@@ -1,38 +1,39 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useMergedRef as e } from "../../../hooks/useMergedRef.js";
|
|
3
|
-
import t from "
|
|
4
|
-
import
|
|
5
|
-
import r from "
|
|
6
|
-
import
|
|
7
|
-
import s from "
|
|
8
|
-
import
|
|
3
|
+
import { composeEventHandlers as t } from "../../_internal/composeEventHandlers.js";
|
|
4
|
+
import n from "../Input/input.module.js";
|
|
5
|
+
import { Input as r } from "../Input/Input.js";
|
|
6
|
+
import i from "./time-picker.module.js";
|
|
7
|
+
import { forwardRef as a, useRef as o, useState as s } from "react";
|
|
8
|
+
import c from "classnames";
|
|
9
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
9
10
|
//#region src/components/form/TimePicker/TimePicker.tsx
|
|
10
|
-
var
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
var u = a(({ intent: a = "default", variant: u = "outline", fullWidth: d = !1, className: f, disabled: p, allowClear: m = !0, value: h, defaultValue: g, onChange: _, ...v }, y) => {
|
|
12
|
+
let b = h !== void 0, [x, S] = s(g ?? ""), C = b ? h : x, w = o(null), T = e(y, w), E = m && !!C && !p, D = E ? void 0 : "ClockIcon", O = (e) => {
|
|
13
|
+
b || S(e.target.value), _?.(e);
|
|
14
|
+
}, k = () => {
|
|
15
|
+
w.current?.showPicker?.();
|
|
16
|
+
};
|
|
17
|
+
return /* @__PURE__ */ l(r, {
|
|
18
|
+
ref: T,
|
|
14
19
|
type: "time",
|
|
15
|
-
allowClear:
|
|
16
|
-
intent:
|
|
17
|
-
variant:
|
|
18
|
-
fullWidth:
|
|
19
|
-
className:
|
|
20
|
-
inputClassName:
|
|
21
|
-
disabled:
|
|
22
|
-
value:
|
|
23
|
-
defaultValue:
|
|
24
|
-
onChange:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
rightIcon: E,
|
|
28
|
-
rightIconColor: f || T ? void 0 : "primary",
|
|
29
|
-
onRightIconClick: T ? void 0 : () => {
|
|
30
|
-
C.current?.showPicker?.();
|
|
31
|
-
},
|
|
20
|
+
allowClear: E,
|
|
21
|
+
intent: a,
|
|
22
|
+
variant: u,
|
|
23
|
+
fullWidth: d,
|
|
24
|
+
className: c("wim-time-picker", f),
|
|
25
|
+
inputClassName: c(n.root, i.input),
|
|
26
|
+
disabled: p,
|
|
27
|
+
value: h,
|
|
28
|
+
defaultValue: g,
|
|
29
|
+
onChange: O,
|
|
30
|
+
rightIcon: D,
|
|
31
|
+
rightIconColor: p || E ? void 0 : "primary",
|
|
32
32
|
rightIconDecorative: !0,
|
|
33
|
-
...
|
|
33
|
+
...v,
|
|
34
|
+
onRightIconClick: E ? v.onRightIconClick : t(v.onRightIconClick, k)
|
|
34
35
|
});
|
|
35
36
|
});
|
|
36
|
-
|
|
37
|
+
u.displayName = "TimePicker";
|
|
37
38
|
//#endregion
|
|
38
|
-
export {
|
|
39
|
+
export { u as TimePicker };
|
|
@@ -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/components.cjs"),r=require("../../../icon/close.cjs"),i=require("../../../icon/edit.cjs"),a=require("../../../icon/plus.cjs"),o=require("../../media/Icon/Icon.cjs"),s=require("../../data-display/Card/Card.cjs"),c=require("../../form/Button/Button.cjs"),l=require("./dashboard.module.cjs");let u=require("react");u=e.__toESM(u,1);let d=require("classnames");d=e.__toESM(d,1);let f=require("react/jsx-runtime");var p=(0,u.createContext)(null),m=()=>{let e=(0,u.useContext)(p);if(!e)throw Error(`Dashboard subcomponents must be used within Dashboard`);return e},h=u.default.forwardRef(({widgets:e,editable:r,defaultEditable:s=!1,onEditChange:m,onRemove:h,onAdd:_,columns:v=3,gap:y=`md`,showEditToggle:b,titleLevel:x=3,label:S,className:C,style:w,children:T,...E},D)=>{let{t:O}=t.useWimTranslation(n.componentsNs),k=r!==void 0,[A,j]=(0,u.useState)(s),M=k?r:A,N=(0,u.useCallback)(()=>{let e=!M;k||j(e),m?.(e)},[M,k,m]),P={"--dashboard-columns":v,...w},F=b??(r!==void 0||s||h!==void 0||_!==void 0),I=(0,u.useMemo)(()=>({editable:M??!1,onRemove:h,titleLevel:x}),[M,h,x]),L=`h${Math.max(2,x-1)}`;return(0,f.jsx)(p.Provider,{value:I,children:(0,f.jsxs)(`div`,{ref:D,className:(0,d.default)(`wim-dashboard`,l.default.root,C),role:`group`,"aria-label":S??O(`dashboard_widget.label`),...E,children:[(S||F)&&(0,f.jsxs)(`div`,{className:l.default.header,children:[S&&(0,f.jsx)(L,{className:l.default.heading,children:S}),F&&(0,f.jsx)(c.Button,{size:`sm`,variant:M?`solid`:`outline`,intent:`default`,className:void 0,onClick:N,"aria-pressed":M,"aria-label":O(M?`dashboard_widget.exit_edit`:`dashboard_widget.enter_edit`),icon:(0,f.jsx)(o.Icon,{component:i.default,size:`sm`}),children:O(M?`dashboard_widget.exit_edit`:`dashboard_widget.enter_edit`)})]}),(0,f.jsxs)(`div`,{className:(0,d.default)(l.default.grid,l.default[`gap-${y}`]),style:P,role:`region`,"aria-label":O(`dashboard_widget.grid_label`),children:[e?e.map(e=>(0,f.jsx)(g,{widget:e},e.id)):T,M&&_&&(0,f.jsx)(c.Button,{asChild:!0,className:l.default.addButton,onClick:_,"aria-label":O(`dashboard_widget.add_widget`),children:(0,f.jsxs)(`button`,{type:`button`,children:[(0,f.jsx)(o.Icon,{component:a.default,size:`md`}),(0,f.jsx)(`span`,{children:O(`dashboard_widget.add_widget`)})]})})]})]})})});h.displayName=`Dashboard`;var g=({widget:e,className:i,...a})=>{let{editable:u,onRemove:p,titleLevel:h}=m(),g=`h${h}`,{t:_}=t.useWimTranslation(n.componentsNs),{id:v,title:y,description:b,content:x,span:S=1,rowSpan:C=1}=e;return(0,f.jsxs)(s.Card,{variant:`outline`,padding:`md`,radius:`md`,className:(0,d.default)(l.default.widget,l.default[`span-${S}`],l.default[`row-${C}`],{[l.default.editMode]:u},i),style:{"--widget-span":S,"--widget-row-span":C
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../i18n/generated/components.cjs"),r=require("../../../icon/close.cjs"),i=require("../../../icon/edit.cjs"),a=require("../../../icon/plus.cjs"),o=require("../../media/Icon/Icon.cjs"),s=require("../../data-display/Card/Card.cjs"),c=require("../../form/Button/Button.cjs"),l=require("./dashboard.module.cjs");let u=require("react");u=e.__toESM(u,1);let d=require("classnames");d=e.__toESM(d,1);let f=require("react/jsx-runtime");var p=(0,u.createContext)(null),m=()=>{let e=(0,u.useContext)(p);if(!e)throw Error(`Dashboard subcomponents must be used within Dashboard`);return e},h=u.default.forwardRef(({widgets:e,editable:r,defaultEditable:s=!1,onEditChange:m,onRemove:h,onAdd:_,columns:v=3,gap:y=`md`,showEditToggle:b,titleLevel:x=3,label:S,className:C,style:w,children:T,...E},D)=>{let{t:O}=t.useWimTranslation(n.componentsNs),k=r!==void 0,[A,j]=(0,u.useState)(s),M=k?r:A,N=(0,u.useCallback)(()=>{let e=!M;k||j(e),m?.(e)},[M,k,m]),P={"--dashboard-columns":v,...w},F=b??(r!==void 0||s||h!==void 0||_!==void 0),I=(0,u.useMemo)(()=>({editable:M??!1,onRemove:h,titleLevel:x}),[M,h,x]),L=`h${Math.max(2,x-1)}`;return(0,f.jsx)(p.Provider,{value:I,children:(0,f.jsxs)(`div`,{ref:D,className:(0,d.default)(`wim-dashboard`,l.default.root,C),role:`group`,"aria-label":S??O(`dashboard_widget.label`),...E,children:[(S||F)&&(0,f.jsxs)(`div`,{className:l.default.header,children:[S&&(0,f.jsx)(L,{className:l.default.heading,children:S}),F&&(0,f.jsx)(c.Button,{size:`sm`,variant:M?`solid`:`outline`,intent:`default`,className:void 0,onClick:N,"aria-pressed":M,"aria-label":O(M?`dashboard_widget.exit_edit`:`dashboard_widget.enter_edit`),icon:(0,f.jsx)(o.Icon,{component:i.default,size:`sm`}),children:O(M?`dashboard_widget.exit_edit`:`dashboard_widget.enter_edit`)})]}),(0,f.jsxs)(`div`,{className:(0,d.default)(l.default.grid,l.default[`gap-${y}`]),style:P,role:`region`,"aria-label":O(`dashboard_widget.grid_label`),children:[e?e.map(e=>(0,f.jsx)(g,{widget:e},e.id)):T,M&&_&&(0,f.jsx)(c.Button,{asChild:!0,className:l.default.addButton,onClick:_,"aria-label":O(`dashboard_widget.add_widget`),children:(0,f.jsxs)(`button`,{type:`button`,children:[(0,f.jsx)(o.Icon,{component:a.default,size:`md`}),(0,f.jsx)(`span`,{children:O(`dashboard_widget.add_widget`)})]})})]})]})})});h.displayName=`Dashboard`;var g=({widget:e,className:i,...a})=>{let{editable:u,onRemove:p,titleLevel:h}=m(),g=`h${h}`,{t:_}=t.useWimTranslation(n.componentsNs),{id:v,title:y,description:b,content:x,span:S=1,rowSpan:C=1}=e;return(0,f.jsxs)(s.Card,{variant:`outline`,padding:`md`,radius:`md`,className:(0,d.default)(l.default.widget,l.default[`span-${S}`],l.default[`row-${C}`],{[l.default.editMode]:u},i),...a,style:{"--widget-span":S,"--widget-row-span":C,...a.style},children:[(0,f.jsxs)(`div`,{className:l.default.widgetHeader,children:[(0,f.jsxs)(`div`,{className:l.default.widgetMeta,children:[(0,f.jsx)(g,{className:l.default.widgetTitle,children:y}),b&&(0,f.jsx)(`p`,{className:l.default.widgetDescription,children:b})]}),u&&p&&(0,f.jsx)(c.Button,{size:`sm`,variant:`ghost`,intent:`danger`,className:l.default.removeButton,onClick:()=>p(v),"aria-label":_(`dashboard_widget.remove_widget`,{title:y}),icon:(0,f.jsx)(o.Icon,{component:r.default,size:`sm`})})]}),(0,f.jsx)(`div`,{className:l.default.widgetContent,children:x})]})};g.displayName=`DashboardWidgetCard`,exports.Dashboard=h,exports.DashboardWidgetCard=g;
|
|
@@ -93,11 +93,12 @@ var x = ({ widget: r, className: i, ...l }) => {
|
|
|
93
93
|
padding: "md",
|
|
94
94
|
radius: "md",
|
|
95
95
|
className: h(c.widget, c[`span-${C}`], c[`row-${w}`], { [c.editMode]: u }, i),
|
|
96
|
+
...l,
|
|
96
97
|
style: {
|
|
97
98
|
"--widget-span": C,
|
|
98
|
-
"--widget-row-span": w
|
|
99
|
+
"--widget-row-span": w,
|
|
100
|
+
...l.style
|
|
99
101
|
},
|
|
100
|
-
...l,
|
|
101
102
|
children: [/* @__PURE__ */ _("div", {
|
|
102
103
|
className: c.widgetHeader,
|
|
103
104
|
children: [/* @__PURE__ */ _("div", {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("./interactive-area.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=n.default.forwardRef(({title:e,description:n,icon:a,actions:o,variant:s=`dashed`,bgVariant:c=`default`,size:l=`md`,align:u=`center`,isDragging:d=!1,isClickable:f=!1,disabled:p=!1,className:m,children:h,styles:g,..._},v)=>(0,i.jsx)(`div`,{ref:v,className:(0,r.default)(`wim-interactive-area`,t.default.root,t.default[s],t.default[c],t.default[l],u===`center`?t.default.alignCenter:t.default.alignStart,d&&t.default.dragging,f&&!p&&t.default.clickable,p&&t.default.disabled,m),"data-variant":s,"data-bg-variant":c,"data-size":l,"data-align":u,"data-disabled":p,"data-dragging":d,role:f&&!p?`button`:_[`aria-label`]||_[`aria-labelledby`]?`group`:void 0,tabIndex:f&&!p?0:void 0,"aria-disabled":p||void 0,onKeyDown:e=>{f&&!p&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.currentTarget.click()),_.onKeyDown?.(e)}
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("./interactive-area.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=n.default.forwardRef(({title:e,description:n,icon:a,actions:o,variant:s=`dashed`,bgVariant:c=`default`,size:l=`md`,align:u=`center`,isDragging:d=!1,isClickable:f=!1,disabled:p=!1,className:m,children:h,styles:g,..._},v)=>(0,i.jsx)(`div`,{ref:v,className:(0,r.default)(`wim-interactive-area`,t.default.root,t.default[s],t.default[c],t.default[l],u===`center`?t.default.alignCenter:t.default.alignStart,d&&t.default.dragging,f&&!p&&t.default.clickable,p&&t.default.disabled,m),"data-variant":s,"data-bg-variant":c,"data-size":l,"data-align":u,"data-disabled":p,"data-dragging":d,role:f&&!p?`button`:_[`aria-label`]||_[`aria-labelledby`]?`group`:void 0,tabIndex:f&&!p?0:void 0,"aria-disabled":p||void 0,..._,onKeyDown:e=>{f&&!p&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.currentTarget.click()),_.onKeyDown?.(e)},onClick:e=>{if(p){e.preventDefault();return}_.onClick?.(e)},children:(0,i.jsxs)(`div`,{className:(0,r.default)(t.default.inner,g?.inner),children:[a&&(0,i.jsx)(`div`,{className:(0,r.default)(t.default.icon,g?.icon),children:a}),(e||n)&&(0,i.jsxs)(`div`,{className:t.default.text,children:[e&&(0,i.jsx)(`div`,{className:(0,r.default)(t.default.title,g?.title),children:e}),n&&(0,i.jsx)(`div`,{className:(0,r.default)(t.default.description,g?.description),children:n})]}),h&&(0,i.jsx)(`div`,{className:(0,r.default)(t.default.content,g?.content),children:h}),o&&(0,i.jsx)(`div`,{className:(0,r.default)(t.default.actions,g?.actions),children:o})]})}));a.displayName=`InteractiveArea`,exports.InteractiveArea=a;
|
|
@@ -16,10 +16,10 @@ var a = t.forwardRef(({ title: t, description: a, icon: o, actions: s, variant:
|
|
|
16
16
|
role: p && !m ? "button" : v["aria-label"] || v["aria-labelledby"] ? "group" : void 0,
|
|
17
17
|
tabIndex: p && !m ? 0 : void 0,
|
|
18
18
|
"aria-disabled": m || void 0,
|
|
19
|
+
...v,
|
|
19
20
|
onKeyDown: (e) => {
|
|
20
21
|
p && !m && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.currentTarget.click()), v.onKeyDown?.(e);
|
|
21
22
|
},
|
|
22
|
-
...v,
|
|
23
23
|
onClick: (e) => {
|
|
24
24
|
if (m) {
|
|
25
25
|
e.preventDefault();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../navigation/HamburgerMenu/HamburgerMenu.cjs"),n=require("../../overlay/Drawer/Drawer.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../navigation/HamburgerMenu/HamburgerMenu.cjs"),n=require("../../_internal/composeEventHandlers.cjs"),r=require("../../overlay/Drawer/Drawer.cjs"),i=require("./navbar.module.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("classnames");o=e.__toESM(o,1);let s=require("react/jsx-runtime");var c=(0,a.createContext)(void 0),l=a.default.forwardRef(({className:e,children:t,fixed:n,sticky:r,transparent:l,glass:u,bordered:d,fluid:f,defaultMenuOpen:p=!1,isMenuOpen:m,onMenuOpenChange:h,...g},_)=>{let[v,y]=(0,a.useState)(p),b=m??v;return(0,s.jsx)(c.Provider,{value:{isMenuOpen:b,setIsMenuOpen:e=>{y(e),h?.(e)}},children:(0,s.jsx)(`nav`,{ref:_,className:(0,o.default)(`wim-navbar`,i.default.root,n&&i.default.fixed,r&&i.default.sticky,l&&i.default.transparent,u&&i.default.glass,d&&i.default.bordered,e),...g,children:(0,s.jsx)(`div`,{className:(0,o.default)(i.default.container,f&&i.default.fluid),children:t})})})});l.displayName=`Navbar`;var u=a.default.forwardRef(({className:e,children:t,...n},r)=>(0,s.jsx)(`div`,{ref:r,className:(0,o.default)(i.default.brand,e),...n,children:t}));u.displayName=`Navbar.Brand`;var d=a.default.forwardRef(({className:e,children:t,justify:n=`end`,hiddenOnMobile:r,...a},c)=>(0,s.jsx)(`div`,{ref:c,className:(0,o.default)(i.default.content,i.default[n],r&&i.default.hiddenMobile,e),...a,children:t}));d.displayName=`Navbar.Content`;var f=a.default.forwardRef(({className:e,children:t,active:n,...r},a)=>(0,s.jsx)(`div`,{ref:a,className:(0,o.default)(i.default.item,n&&i.default.active,e),...r,children:t}));f.displayName=`Navbar.Item`;var p=a.default.forwardRef(({className:e,children:t,active:n,...r},a)=>(0,s.jsx)(`a`,{ref:a,className:(0,o.default)(i.default.link,n&&i.default.active,e),...r,children:t}));p.displayName=`Navbar.Link`;var m=a.default.forwardRef(({className:e,...n},r)=>{let o=(0,a.useContext)(c);if(!o)throw Error(`NavbarToggle must be used within a Navbar`);let{isMenuOpen:l,setIsMenuOpen:u}=o;return(0,s.jsx)(`div`,{className:i.default.toggle,children:(0,s.jsx)(t.HamburgerMenu,{ref:r,open:l,onOpenChange:u,className:e,...n})})});m.displayName=`Navbar.Toggle`;var h=a.default.forwardRef(({className:e,children:t,position:n=`top`,...l},u)=>{let d=(0,a.useContext)(c);if(!d)throw Error(`NavbarMenu must be used within a Navbar`);let{isMenuOpen:f,setIsMenuOpen:p}=d;return(0,s.jsx)(r.Drawer,{open:f,onOpenChange:p,side:n,children:(0,s.jsx)(r.DrawerContent,{...l,className:(0,o.default)(i.default.menu,e),children:t})})});h.displayName=`Navbar.Menu`;var g=a.default.forwardRef(({className:e,children:t,active:r,...l},u)=>{let{setIsMenuOpen:d}=(0,a.useContext)(c)||{},f=e=>{d?.(!1),l.onClick?.(e)};return(0,s.jsx)(`div`,{ref:u,className:(0,o.default)(i.default.menuItem,r&&i.default.active,e),role:`button`,tabIndex:0,...l,onClick:f,onKeyDown:n.composeEventHandlers(l.onKeyDown,e=>{(e.key===`Enter`||e.key===` `)&&e.currentTarget.click()}),children:t})});g.displayName=`Navbar.MenuItem`;var _=Object.assign(l,{Brand:u,Content:d,Item:f,Link:p,Toggle:m,Menu:h,MenuItem:g});exports.Navbar=_,exports.default=_,exports.NavbarBrand=u,exports.NavbarContent=d,exports.NavbarItem=f,exports.NavbarLink=p,exports.NavbarMenu=h,exports.NavbarMenuItem=g,exports.NavbarToggle=m;
|