@vellira-ui/react 2.73.3 → 2.75.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 +35 -7
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4901,14 +4901,42 @@ var $ = {
|
|
|
4901
4901
|
});
|
|
4902
4902
|
});
|
|
4903
4903
|
Hi.displayName = "Input";
|
|
4904
|
+
var Ui = {
|
|
4905
|
+
root: "_root_tczcc_1",
|
|
4906
|
+
thumb: "_thumb_tczcc_54"
|
|
4907
|
+
};
|
|
4908
|
+
//#endregion
|
|
4909
|
+
//#region src/primitives/Switch/Switch.tsx
|
|
4910
|
+
function Wi({ accessibilityLabel: e = "Switch", checked: t, defaultChecked: n = !1, disabled: r = !1, required: i = !1, invalid: a = !1, onCheckedChange: o }) {
|
|
4911
|
+
let [s, c] = E(n), l = t !== void 0, u = l ? t : s;
|
|
4912
|
+
return /* @__PURE__ */ d("button", {
|
|
4913
|
+
type: "button",
|
|
4914
|
+
role: "switch",
|
|
4915
|
+
"aria-label": e,
|
|
4916
|
+
"aria-checked": u,
|
|
4917
|
+
disabled: r,
|
|
4918
|
+
"aria-required": i || void 0,
|
|
4919
|
+
"aria-invalid": a || void 0,
|
|
4920
|
+
"data-state": u ? "checked" : "unchecked",
|
|
4921
|
+
className: Ui.root,
|
|
4922
|
+
onClick: () => {
|
|
4923
|
+
let e = !u;
|
|
4924
|
+
l || c(e), o?.(e);
|
|
4925
|
+
},
|
|
4926
|
+
children: /* @__PURE__ */ d("span", {
|
|
4927
|
+
className: Ui.thumb,
|
|
4928
|
+
"aria-hidden": "true"
|
|
4929
|
+
})
|
|
4930
|
+
});
|
|
4931
|
+
}
|
|
4904
4932
|
//#endregion
|
|
4905
4933
|
//#region src/theme/ThemeContext.ts
|
|
4906
|
-
var
|
|
4934
|
+
var Gi = g(null), Ki = (e) => e === "highContrast" ? "high-contrast" : e, qi = ({ theme: e, defaultTheme: t = "light", onThemeChange: n, syncDocument: r = !0, children: i }) => {
|
|
4907
4935
|
let [a, o] = ut({
|
|
4908
4936
|
value: e,
|
|
4909
4937
|
defaultValue: t,
|
|
4910
4938
|
onChange: n
|
|
4911
|
-
}), s =
|
|
4939
|
+
}), s = Ki(a);
|
|
4912
4940
|
x(() => {
|
|
4913
4941
|
if (!r || typeof document > "u") return;
|
|
4914
4942
|
let { documentElement: e } = document, t = e.dataset.velliraTheme;
|
|
@@ -4924,7 +4952,7 @@ var Ui = g(null), Wi = (e) => e === "highContrast" ? "high-contrast" : e, Gi = (
|
|
|
4924
4952
|
theme: a,
|
|
4925
4953
|
setTheme: o
|
|
4926
4954
|
}), [a, o]);
|
|
4927
|
-
return /* @__PURE__ */ d(
|
|
4955
|
+
return /* @__PURE__ */ d(Gi.Provider, {
|
|
4928
4956
|
value: c,
|
|
4929
4957
|
children: /* @__PURE__ */ d("div", {
|
|
4930
4958
|
"data-vellira-theme": s,
|
|
@@ -4932,13 +4960,13 @@ var Ui = g(null), Wi = (e) => e === "highContrast" ? "high-contrast" : e, Gi = (
|
|
|
4932
4960
|
})
|
|
4933
4961
|
});
|
|
4934
4962
|
};
|
|
4935
|
-
|
|
4963
|
+
qi.displayName = "ThemeProvider";
|
|
4936
4964
|
//#endregion
|
|
4937
4965
|
//#region src/theme/useTheme.ts
|
|
4938
|
-
function
|
|
4939
|
-
let e = b(
|
|
4966
|
+
function Ji() {
|
|
4967
|
+
let e = b(Gi);
|
|
4940
4968
|
if (!e) throw Error("useTheme must be used within ThemeProvider.");
|
|
4941
4969
|
return e;
|
|
4942
4970
|
}
|
|
4943
4971
|
//#endregion
|
|
4944
|
-
export { Mi as Button, Li as Checkbox, Vt as Dropdown, Br as FormField, Hi as Input, _n as Modal, In as Popover, vt as Portal, _t as PortalProvider, Hn as Radio, Zn as RadioGroup, qr as Select, pi as Tabs,
|
|
4972
|
+
export { Mi as Button, Li as Checkbox, Vt as Dropdown, Br as FormField, Hi as Input, _n as Modal, In as Popover, vt as Portal, _t as PortalProvider, Hn as Radio, Zn as RadioGroup, qr as Select, Wi as Switch, pi as Tabs, qi as ThemeProvider, Ai as Tooltip, Ji as useTheme };
|