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.
Files changed (37) hide show
  1. package/README.md +4 -0
  2. package/dist/{Cascader-iWlk7VJR.js → Cascader-COGUcdDS.js} +4 -4
  3. package/dist/{Select-CoEW4UIq.js → Select-BxwT7MHH.js} +81 -77
  4. package/dist/{TreeSelect-BWksr9iW.js → TreeSelect-W5sgU5nW.js} +4 -4
  5. package/dist/{compound-BW6G7E_-.js → compound-nXxRSVJu.js} +27 -27
  6. package/dist/compound.js +1 -1
  7. package/dist/core.js +1 -1
  8. package/dist/date-time.js +1 -1
  9. package/dist/{form-B-BSf2n1.js → form-D6O5PqrZ.js} +62 -49
  10. package/dist/form.js +3 -3
  11. package/dist/{icons-BwE05e0C.js → icons-B1dOXz-r.js} +1 -1
  12. package/dist/{image-upload-D9oPG0Eh.js → image-upload-BFVs81x3.js} +46 -42
  13. package/dist/image-upload.js +1 -1
  14. package/dist/index.js +15 -15
  15. package/dist/input.js +1 -1
  16. package/dist/inputs-w_es2t_C.js +862 -0
  17. package/dist/{lazy-tree-C9l9lzQw.js → lazy-tree-DNvNf_Yv.js} +20 -17
  18. package/dist/{pickers-Bci1y8cc.js → pickers-5zLmSrsp.js} +3 -3
  19. package/dist/select.js +2 -2
  20. package/dist/selection-CA_66JX9.js +223 -0
  21. package/dist/{slider-AM0Egz9P.js → slider-Bhd1Z4LP.js} +35 -35
  22. package/dist/slider.js +1 -1
  23. package/dist/{store-CFSQW-Fv.js → store-C9eBd8Y7.js} +205 -194
  24. package/dist/style.css +1 -1
  25. package/dist/tree-select.js +1 -1
  26. package/dist/types/components/extended-inputs.d.ts +4 -1
  27. package/dist/types/components/image-upload/index.d.ts +1 -1
  28. package/dist/types/components/inputs.d.ts +28 -8
  29. package/dist/types/config/index.d.ts +32 -1
  30. package/dist/types/entries/input.d.ts +2 -2
  31. package/dist/types/form/index.d.ts +3 -0
  32. package/dist/types/form/store.d.ts +1 -0
  33. package/dist/types/primitives/Control.d.ts +7 -2
  34. package/dist/{useControllable-QDX_UWRh.js → useControllable-Dt38Jg9E.js} +54 -21
  35. package/package.json +1 -1
  36. package/dist/inputs-DpZdLaoP.js +0 -718
  37. 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(" "), d = {
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
- }, f = i(d), p = () => a(f);
18
- function m(e) {
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 h = i(m(d.locale)), g = () => a(h), _ = () => g().text;
27
- function v({ children: n, ...r }) {
28
- let i = p(), a = s(() => ({
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
- ]), u = typeof a.locale == "string" ? t(a.locale) : void 0, [d, g] = c();
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 && g(e);
102
+ t && h(e);
70
103
  }, () => {}), () => {
71
104
  t = !1;
72
105
  };
73
106
  }, [u]);
74
- let _ = u ? d?.code === u ? d : u : a.locale, v = s(() => m(_), [_]);
75
- return /* @__PURE__ */ l(f.Provider, {
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(h.Provider, {
78
- value: v,
110
+ children: /* @__PURE__ */ l(y.Provider, {
111
+ value: x,
79
112
  children: /* @__PURE__ */ l("div", {
80
113
  className: "rfe-scope",
81
- lang: v.code,
82
- dir: v.direction,
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: y(a.tokens),
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 y(e) {
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 b(e, t, n) {
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 { g as a, p as i, v as n, _ as o, y as r, u as s, b as t };
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jaguar-form",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "type": "module",
5
5
  "description": "Modern React 19 form controls, schema-driven forms, validation and value adapters.",
6
6
  "license": "MIT",