jaguar-form 1.0.7 → 1.0.8
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/README.md +4 -0
- package/dist/{Cascader-iWlk7VJR.js → Cascader-COGUcdDS.js} +4 -4
- package/dist/{Select-CoEW4UIq.js → Select-BxwT7MHH.js} +81 -77
- package/dist/{TreeSelect-BWksr9iW.js → TreeSelect-W5sgU5nW.js} +4 -4
- package/dist/{compound-BW6G7E_-.js → compound-nXxRSVJu.js} +27 -27
- package/dist/compound.js +1 -1
- package/dist/core.js +1 -1
- package/dist/date-time.js +1 -1
- package/dist/{form-B-BSf2n1.js → form-D6O5PqrZ.js} +62 -49
- package/dist/form.js +3 -3
- package/dist/{icons-BwE05e0C.js → icons-B1dOXz-r.js} +1 -1
- package/dist/{image-upload-D9oPG0Eh.js → image-upload-BFVs81x3.js} +46 -42
- package/dist/image-upload.js +1 -1
- package/dist/index.js +15 -15
- package/dist/input.js +1 -1
- package/dist/inputs-w_es2t_C.js +862 -0
- package/dist/{lazy-tree-C9l9lzQw.js → lazy-tree-DNvNf_Yv.js} +20 -17
- package/dist/{pickers-Bci1y8cc.js → pickers-5zLmSrsp.js} +3 -3
- package/dist/select.js +2 -2
- package/dist/selection-CA_66JX9.js +223 -0
- package/dist/{slider-AM0Egz9P.js → slider-Bhd1Z4LP.js} +35 -35
- package/dist/slider.js +1 -1
- package/dist/{store-CFSQW-Fv.js → store-C9eBd8Y7.js} +205 -194
- package/dist/style.css +1 -1
- package/dist/tree-select.js +1 -1
- package/dist/types/components/extended-inputs.d.ts +4 -1
- package/dist/types/components/image-upload/index.d.ts +1 -1
- package/dist/types/components/inputs.d.ts +28 -8
- package/dist/types/config/index.d.ts +32 -1
- package/dist/types/entries/input.d.ts +2 -2
- package/dist/types/form/index.d.ts +3 -0
- package/dist/types/form/store.d.ts +1 -0
- package/dist/types/primitives/Control.d.ts +7 -2
- package/dist/{useControllable-QDX_UWRh.js → useControllable-Dt38Jg9E.js} +54 -21
- package/package.json +1 -1
- package/dist/inputs-DpZdLaoP.js +0 -718
- package/dist/selection-DCIzhR5q.js +0 -197
|
@@ -3,7 +3,34 @@ import { a as n, o as r } from "./locale-yHkdw2xz.js";
|
|
|
3
3
|
import { createContext as i, useContext as a, useEffect as o, useMemo as s, useState as c } from "react";
|
|
4
4
|
import { jsx as l } from "react/jsx-runtime";
|
|
5
5
|
// src/types.ts
|
|
6
|
-
var u = (...e) => e.filter(Boolean).join(" ")
|
|
6
|
+
var u = (...e) => e.filter(Boolean).join(" ");
|
|
7
|
+
// src/config/index.tsx
|
|
8
|
+
function d(e) {
|
|
9
|
+
return typeof e == "boolean" ? e : e.enabled !== !1;
|
|
10
|
+
}
|
|
11
|
+
function f(e, t = 160) {
|
|
12
|
+
return typeof e == "object" && Number.isFinite(e.duration) ? Math.max(0, e.duration) : t;
|
|
13
|
+
}
|
|
14
|
+
function p(e) {
|
|
15
|
+
let t = e.motion;
|
|
16
|
+
return C({
|
|
17
|
+
...typeof t == "object" ? {
|
|
18
|
+
...t.duration === void 0 ? {} : { transitionDuration: `${f(t)}ms` },
|
|
19
|
+
...t.easing ? { transitionEasing: t.easing } : {}
|
|
20
|
+
} : {},
|
|
21
|
+
...e.tokens
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function m(e, t) {
|
|
25
|
+
return t ? {
|
|
26
|
+
...e,
|
|
27
|
+
...Object.fromEntries(Object.entries(t).map(([t, n]) => [t, {
|
|
28
|
+
...e?.[t],
|
|
29
|
+
...n
|
|
30
|
+
}]))
|
|
31
|
+
} : e;
|
|
32
|
+
}
|
|
33
|
+
var h = {
|
|
7
34
|
theme: "system",
|
|
8
35
|
size: "medium",
|
|
9
36
|
variant: "outlined",
|
|
@@ -14,8 +41,8 @@ var u = (...e) => e.filter(Boolean).join(" "), d = {
|
|
|
14
41
|
icons: {},
|
|
15
42
|
iconRegistry: {},
|
|
16
43
|
tokens: {}
|
|
17
|
-
},
|
|
18
|
-
function
|
|
44
|
+
}, g = i(h), _ = () => a(g);
|
|
45
|
+
function v(e) {
|
|
19
46
|
let t = n(e), i = (e, n) => r(t, e, n), a = Object.fromEntries(Object.keys(t.messages ?? {}).map((e) => [e, i(e)]));
|
|
20
47
|
return {
|
|
21
48
|
...t,
|
|
@@ -23,9 +50,9 @@ function m(e) {
|
|
|
23
50
|
text: a
|
|
24
51
|
};
|
|
25
52
|
}
|
|
26
|
-
var
|
|
27
|
-
function
|
|
28
|
-
let i =
|
|
53
|
+
var y = i(v(h.locale)), b = () => a(y), x = () => b().text;
|
|
54
|
+
function S({ children: n, ...r }) {
|
|
55
|
+
let i = _(), a = s(() => ({
|
|
29
56
|
...i,
|
|
30
57
|
...r,
|
|
31
58
|
icons: {
|
|
@@ -47,7 +74,12 @@ function v({ children: n, ...r }) {
|
|
|
47
74
|
form: {
|
|
48
75
|
...i.form,
|
|
49
76
|
...r.form
|
|
50
|
-
}
|
|
77
|
+
},
|
|
78
|
+
components: m(i.components, r.components),
|
|
79
|
+
motion: typeof r.motion == "object" && typeof i.motion == "object" ? {
|
|
80
|
+
...i.motion,
|
|
81
|
+
...r.motion
|
|
82
|
+
} : r.motion ?? i.motion
|
|
51
83
|
}), [
|
|
52
84
|
i,
|
|
53
85
|
r.theme,
|
|
@@ -61,42 +93,43 @@ function v({ children: n, ...r }) {
|
|
|
61
93
|
r.iconRegistry,
|
|
62
94
|
r.tokens,
|
|
63
95
|
r.controlGroup,
|
|
64
|
-
r.form
|
|
65
|
-
|
|
96
|
+
r.form,
|
|
97
|
+
r.components
|
|
98
|
+
]), u = typeof a.locale == "string" ? t(a.locale) : void 0, [f, h] = c();
|
|
66
99
|
o(() => {
|
|
67
100
|
let t = !0;
|
|
68
101
|
return u && u !== "en-US" && u !== "zh-CN" && e(u).then((e) => {
|
|
69
|
-
t &&
|
|
102
|
+
t && h(e);
|
|
70
103
|
}, () => {}), () => {
|
|
71
104
|
t = !1;
|
|
72
105
|
};
|
|
73
106
|
}, [u]);
|
|
74
|
-
let
|
|
75
|
-
return /* @__PURE__ */ l(
|
|
107
|
+
let b = u ? f?.code === u ? f : u : a.locale, x = s(() => v(b), [b]);
|
|
108
|
+
return /* @__PURE__ */ l(g.Provider, {
|
|
76
109
|
value: a,
|
|
77
|
-
children: /* @__PURE__ */ l(
|
|
78
|
-
value:
|
|
110
|
+
children: /* @__PURE__ */ l(y.Provider, {
|
|
111
|
+
value: x,
|
|
79
112
|
children: /* @__PURE__ */ l("div", {
|
|
80
113
|
className: "rfe-scope",
|
|
81
|
-
lang:
|
|
82
|
-
dir:
|
|
114
|
+
lang: x.code,
|
|
115
|
+
dir: x.direction,
|
|
83
116
|
"data-theme": a.theme,
|
|
84
117
|
"data-density": a.density,
|
|
85
|
-
"data-motion": a.motion ? "on" : "off",
|
|
86
|
-
style:
|
|
118
|
+
"data-motion": d(a.motion) ? "on" : "off",
|
|
119
|
+
style: p(a),
|
|
87
120
|
children: n
|
|
88
121
|
})
|
|
89
122
|
})
|
|
90
123
|
});
|
|
91
124
|
}
|
|
92
|
-
function
|
|
125
|
+
function C(e) {
|
|
93
126
|
return Object.fromEntries(Object.entries(e).map(([e, t]) => [`--rfe-${e.replace(/[A-Z]/g, (e) => "-" + e.toLowerCase())}`, typeof t == "number" && /^(hoverStrength|hoverBackgroundOpacity|selectedBackgroundOpacity|focusRingOpacity)$/.test(e) ? `${Math.max(0, Math.min(1, t)) * 100}%` : typeof t == "number" && !e.toLowerCase().includes("weight") && !e.toLowerCase().includes("stroke") && !/zindex|opacity|scale|lineheight/i.test(e) ? `${t}px` : String(t)]));
|
|
94
127
|
}
|
|
95
128
|
// src/utils/useControllable.ts
|
|
96
|
-
function
|
|
129
|
+
function w(e, t, n) {
|
|
97
130
|
let [r, i] = c(t), a = e === void 0 ? r : e;
|
|
98
131
|
return [a, (t) => {
|
|
99
132
|
Object.is(a, t) || (e === void 0 && i(t), n?.(t));
|
|
100
133
|
}];
|
|
101
134
|
}
|
|
102
|
-
export {
|
|
135
|
+
export { p as a, b as c, d as i, x as l, S as n, C as o, f as r, _ as s, w as t, u };
|