@vellira-ui/react 2.117.2 → 2.118.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/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +58 -7
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5000,14 +5000,65 @@ function Xi({ accessibilityLabel: e = "Switch", checked: t, defaultChecked: n =
|
|
|
5000
5000
|
})
|
|
5001
5001
|
});
|
|
5002
5002
|
}
|
|
5003
|
+
var Zi = {
|
|
5004
|
+
textarea: "_textarea_1oele_1",
|
|
5005
|
+
sm: "_sm_1oele_58",
|
|
5006
|
+
md: "_md_1oele_62",
|
|
5007
|
+
lg: "_lg_1oele_66"
|
|
5008
|
+
}, Qi = i(({ id: e, label: t, description: n, error: r, placeholder: i, value: a, defaultValue: o, size: s, disabled: c = !1, required: u = !1, invalid: d = !1, wrapperClassName: f, className: p, style: m, rows: h = 3, onChange: _, onValueChange: v, "aria-describedby": y, "aria-invalid": b, "aria-labelledby": x, ...S }, C) => {
|
|
5009
|
+
let w = l(), T = Ir(), E = !!(t || n || r), D = e ?? (E ? void 0 : T?.controlId) ?? w, O = s ?? T?.size ?? "md", k = re[O], A = {
|
|
5010
|
+
"--textarea-font-size": `${k.fontSize}px`,
|
|
5011
|
+
"--textarea-line-height": `${k.lineHeight}px`
|
|
5012
|
+
}, j = d || !!r || !E && !!T?.invalid, M = c || !E && !!T?.disabled, N = u || !E && !!T?.required, P = n ? `${D}-description` : void 0, F = r ? `${D}-error` : void 0, I = [
|
|
5013
|
+
y,
|
|
5014
|
+
!E && !y ? T?.ariaDescribedBy : void 0,
|
|
5015
|
+
P,
|
|
5016
|
+
F
|
|
5017
|
+
].filter(Boolean).join(" "), L = (e) => {
|
|
5018
|
+
v?.(e.currentTarget.value), _?.(e);
|
|
5019
|
+
}, R = /* @__PURE__ */ g("textarea", {
|
|
5020
|
+
...S,
|
|
5021
|
+
ref: C,
|
|
5022
|
+
id: D,
|
|
5023
|
+
rows: h,
|
|
5024
|
+
className: J(Zi.textarea, Zi[O], p),
|
|
5025
|
+
style: {
|
|
5026
|
+
...A,
|
|
5027
|
+
...m
|
|
5028
|
+
},
|
|
5029
|
+
value: a,
|
|
5030
|
+
defaultValue: o,
|
|
5031
|
+
placeholder: i,
|
|
5032
|
+
disabled: M,
|
|
5033
|
+
required: N,
|
|
5034
|
+
"aria-invalid": j ? !0 : b,
|
|
5035
|
+
"aria-labelledby": x ?? (E ? void 0 : T?.ariaLabelledBy),
|
|
5036
|
+
"aria-describedby": I || void 0,
|
|
5037
|
+
onChange: L
|
|
5038
|
+
});
|
|
5039
|
+
return !E && T ? R : /* @__PURE__ */ g(Kr, {
|
|
5040
|
+
id: D,
|
|
5041
|
+
label: t,
|
|
5042
|
+
description: n,
|
|
5043
|
+
error: r,
|
|
5044
|
+
required: N,
|
|
5045
|
+
disabled: M,
|
|
5046
|
+
invalid: j,
|
|
5047
|
+
size: O,
|
|
5048
|
+
className: f,
|
|
5049
|
+
bindControl: !1,
|
|
5050
|
+
children: R
|
|
5051
|
+
});
|
|
5052
|
+
});
|
|
5053
|
+
Qi.displayName = "Textarea";
|
|
5003
5054
|
//#endregion
|
|
5004
5055
|
//#region src/theme/ThemeContext.ts
|
|
5005
|
-
var
|
|
5056
|
+
var $i = r(null), ea = (e) => e === "highContrast" ? "high-contrast" : e, ta = ({ theme: e, defaultTheme: t = "light", onThemeChange: n, syncDocument: r = !0, children: i }) => {
|
|
5006
5057
|
let [a, o] = vt({
|
|
5007
5058
|
value: e,
|
|
5008
5059
|
defaultValue: t,
|
|
5009
5060
|
onChange: n
|
|
5010
|
-
}), s =
|
|
5061
|
+
}), s = ea(a);
|
|
5011
5062
|
c(() => {
|
|
5012
5063
|
if (!r || typeof document > "u") return;
|
|
5013
5064
|
let { documentElement: e } = document, t = e.dataset.velliraTheme;
|
|
@@ -5023,7 +5074,7 @@ var Zi = r(null), Qi = (e) => e === "highContrast" ? "high-contrast" : e, $i = (
|
|
|
5023
5074
|
theme: a,
|
|
5024
5075
|
setTheme: o
|
|
5025
5076
|
}), [a, o]);
|
|
5026
|
-
return /* @__PURE__ */ g(
|
|
5077
|
+
return /* @__PURE__ */ g($i.Provider, {
|
|
5027
5078
|
value: l,
|
|
5028
5079
|
children: /* @__PURE__ */ g("div", {
|
|
5029
5080
|
"data-vellira-theme": s,
|
|
@@ -5031,13 +5082,13 @@ var Zi = r(null), Qi = (e) => e === "highContrast" ? "high-contrast" : e, $i = (
|
|
|
5031
5082
|
})
|
|
5032
5083
|
});
|
|
5033
5084
|
};
|
|
5034
|
-
|
|
5085
|
+
ta.displayName = "ThemeProvider";
|
|
5035
5086
|
//#endregion
|
|
5036
5087
|
//#region src/theme/useTheme.ts
|
|
5037
|
-
function
|
|
5038
|
-
let e = s(
|
|
5088
|
+
function na() {
|
|
5089
|
+
let e = s($i);
|
|
5039
5090
|
if (!e) throw Error("useTheme must be used within ThemeProvider.");
|
|
5040
5091
|
return e;
|
|
5041
5092
|
}
|
|
5042
5093
|
//#endregion
|
|
5043
|
-
export { q as Accordion, Ri as Button, Ui as Checkbox, Yt as Dropdown, Kr as FormField, Ji as Input, Cn as Modal, Hn as Popover, Et as Portal, Tt as PortalProvider, Jn as Radio, rr as RadioGroup, $r as Select, Xi as Switch, yi as Tabs,
|
|
5094
|
+
export { q as Accordion, Ri as Button, Ui as Checkbox, Yt as Dropdown, Kr as FormField, Ji as Input, Cn as Modal, Hn as Popover, Et as Portal, Tt as PortalProvider, Jn as Radio, rr as RadioGroup, $r as Select, Xi as Switch, yi as Tabs, Qi as Textarea, ta as ThemeProvider, Ii as Tooltip, na as useTheme };
|