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
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import { a as e, i as t, r as n, s as r } from "./useControllable-QDX_UWRh.js";
|
|
2
|
-
import { t as i } from "./icons-BwE05e0C.js";
|
|
3
|
-
import { createContext as a, useCallback as o, useContext as s, useId as c, useLayoutEffect as l, useState as u, useSyncExternalStore as d } from "react";
|
|
4
|
-
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
5
|
-
import { FloatingFocusManager as m, FloatingNode as h, FloatingOverlay as g, FloatingPortal as _, FloatingTree as v, autoUpdate as y, flip as b, offset as x, shift as S, size as C, useDismiss as w, useFloating as T, useFloatingNodeId as ee, useFloatingTree as E, useInteractions as D, useRole as te, useTransitionStyles as O } from "@floating-ui/react";
|
|
6
|
-
// src/primitives/Control.tsx
|
|
7
|
-
function k({ children: e, actions: n, prefix: a, suffix: o, prefixIcon: s, suffixIcon: c, size: l, variant: u, status: d, disabled: m, readOnly: h, className: g, style: _, floatingLabel: v, floatingFilled: y, floatingOpen: b, id: x, "aria-invalid": S }) {
|
|
8
|
-
let C = t();
|
|
9
|
-
return /* @__PURE__ */ p("div", {
|
|
10
|
-
className: r("rfe-control", !!v && "rfe-floating-shell", g),
|
|
11
|
-
style: _,
|
|
12
|
-
"data-size": l ?? C.size,
|
|
13
|
-
"data-variant": u ?? C.variant,
|
|
14
|
-
"data-status": S ? "error" : d ?? "default",
|
|
15
|
-
"data-disabled": m || void 0,
|
|
16
|
-
"data-readonly": h || void 0,
|
|
17
|
-
"data-floating-filled": y || void 0,
|
|
18
|
-
"data-floating-open": b || void 0,
|
|
19
|
-
children: [
|
|
20
|
-
(s || a) && /* @__PURE__ */ p("span", {
|
|
21
|
-
className: "rfe-affix",
|
|
22
|
-
children: [/* @__PURE__ */ f(i, { source: s }), a]
|
|
23
|
-
}),
|
|
24
|
-
e,
|
|
25
|
-
(c || o) && /* @__PURE__ */ p("span", {
|
|
26
|
-
className: "rfe-affix",
|
|
27
|
-
children: [/* @__PURE__ */ f(i, { source: c }), o]
|
|
28
|
-
}),
|
|
29
|
-
n,
|
|
30
|
-
v && /* @__PURE__ */ f("label", {
|
|
31
|
-
className: "rfe-shell-label",
|
|
32
|
-
htmlFor: x,
|
|
33
|
-
children: v
|
|
34
|
-
})
|
|
35
|
-
]
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
function A({ name: e, source: t, label: n, onClick: r, disabled: a, hidden: o }) {
|
|
39
|
-
return /* @__PURE__ */ f("button", {
|
|
40
|
-
className: "rfe-action",
|
|
41
|
-
type: "button",
|
|
42
|
-
"aria-label": n,
|
|
43
|
-
title: n,
|
|
44
|
-
disabled: a || o,
|
|
45
|
-
style: o ? { visibility: "hidden" } : void 0,
|
|
46
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
47
|
-
onClick: (e) => {
|
|
48
|
-
e.stopPropagation(), r();
|
|
49
|
-
},
|
|
50
|
-
children: /* @__PURE__ */ f(i, {
|
|
51
|
-
name: e,
|
|
52
|
-
source: t
|
|
53
|
-
})
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
// src/components/compound/context.ts
|
|
57
|
-
var j = a(null), M = () => s(j), N = "(max-width: 560px)", P = (e) => {
|
|
58
|
-
let t = window.matchMedia(N);
|
|
59
|
-
return t.addEventListener("change", e), () => t.removeEventListener("change", e);
|
|
60
|
-
}, F = () => typeof window < "u" && window.matchMedia(N).matches;
|
|
61
|
-
function I(e) {
|
|
62
|
-
return E() ? /* @__PURE__ */ f(L, { ...e }) : /* @__PURE__ */ f(v, { children: /* @__PURE__ */ f(L, { ...e }) });
|
|
63
|
-
}
|
|
64
|
-
function L({ open: r, onOpenChange: i, children: a, trigger: s, placement: v = "bottom-start", popupWidth: E = "trigger", popupMaxHeight: k = 320, portalContainer: A, role: j = "dialog", label: N, popupMode: I, layout: L = "content", initialFocus: R = 0 }) {
|
|
65
|
-
let z = M(), [B, V] = u(null), H = t(), U = e(), W = c(), G = ee(), K = d(P, F, () => !1), q = I ?? H.popupMode, J = q === "sheet" || q === "auto" && K, [Y, X] = u(null), { refs: Z, floatingStyles: ne, context: Q, placement: re } = T({
|
|
66
|
-
nodeId: G,
|
|
67
|
-
open: r,
|
|
68
|
-
onOpenChange: i,
|
|
69
|
-
placement: v,
|
|
70
|
-
strategy: J ? "fixed" : "absolute",
|
|
71
|
-
whileElementsMounted: J ? void 0 : y,
|
|
72
|
-
middleware: J ? [] : [
|
|
73
|
-
x(6),
|
|
74
|
-
b(),
|
|
75
|
-
S({ padding: 8 }),
|
|
76
|
-
C({
|
|
77
|
-
padding: 8,
|
|
78
|
-
apply({ availableHeight: e, availableWidth: t, rects: n, elements: r }) {
|
|
79
|
-
Object.assign(r.floating.style, {
|
|
80
|
-
maxHeight: `${Math.max(0, Math.min(e, k))}px`,
|
|
81
|
-
maxWidth: `${Math.max(0, t)}px`,
|
|
82
|
-
width: `${Math.max(0, Math.min(t, E === "trigger" ? n.reference.width : E))}px`
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
})
|
|
86
|
-
]
|
|
87
|
-
}), ie = o((e) => {
|
|
88
|
-
Z.setFloating(e), V(e);
|
|
89
|
-
}, [Z.setFloating]);
|
|
90
|
-
l(() => {
|
|
91
|
-
if (r && B) return z?.registerPopup(B);
|
|
92
|
-
}, [
|
|
93
|
-
r,
|
|
94
|
-
B,
|
|
95
|
-
z
|
|
96
|
-
]);
|
|
97
|
-
let ae = o((e) => {
|
|
98
|
-
Z.setReference(e), X(e?.closest("dialog[open]") ?? null);
|
|
99
|
-
}, [Z.setReference]), oe = w(Q, { bubbles: {
|
|
100
|
-
escapeKey: !1,
|
|
101
|
-
outsidePress: !0
|
|
102
|
-
} }), se = te(Q, { role: j }), { getReferenceProps: ce, getFloatingProps: le } = D([oe, se]), { isMounted: ue, styles: de } = O(Q, {
|
|
103
|
-
duration: H.motion ? {
|
|
104
|
-
open: 160,
|
|
105
|
-
close: 100
|
|
106
|
-
} : 0,
|
|
107
|
-
initial: ({ side: e }) => ({
|
|
108
|
-
opacity: 0,
|
|
109
|
-
transform: J ? "translateY(16px)" : `translateY(${e === "top" ? 4 : -4}px) scale(.985)`
|
|
110
|
-
})
|
|
111
|
-
}), fe = {
|
|
112
|
-
lang: U.code,
|
|
113
|
-
dir: U.direction,
|
|
114
|
-
"data-theme": H.theme,
|
|
115
|
-
"data-density": H.density,
|
|
116
|
-
"data-motion": H.motion ? "on" : "off"
|
|
117
|
-
}, $ = /* @__PURE__ */ f(m, {
|
|
118
|
-
context: Q,
|
|
119
|
-
modal: J,
|
|
120
|
-
initialFocus: R,
|
|
121
|
-
disabled: !r,
|
|
122
|
-
returnFocus: !0,
|
|
123
|
-
children: /* @__PURE__ */ f("div", {
|
|
124
|
-
...fe,
|
|
125
|
-
className: "rfe-scope rfe-popup-position",
|
|
126
|
-
"data-sheet": J || void 0,
|
|
127
|
-
ref: ie,
|
|
128
|
-
style: {
|
|
129
|
-
...n(H.tokens),
|
|
130
|
-
...J ? {
|
|
131
|
-
position: "fixed",
|
|
132
|
-
insetInline: 0,
|
|
133
|
-
bottom: 0,
|
|
134
|
-
width: "100%",
|
|
135
|
-
maxWidth: "100%",
|
|
136
|
-
maxHeight: "85dvh"
|
|
137
|
-
} : ne
|
|
138
|
-
},
|
|
139
|
-
...le({
|
|
140
|
-
id: W,
|
|
141
|
-
"aria-label": N,
|
|
142
|
-
"aria-modal": J || void 0
|
|
143
|
-
}),
|
|
144
|
-
children: /* @__PURE__ */ p("div", {
|
|
145
|
-
className: "rfe-panel",
|
|
146
|
-
"data-layout": L,
|
|
147
|
-
"data-side": re.split("-")[0],
|
|
148
|
-
style: {
|
|
149
|
-
...de,
|
|
150
|
-
pointerEvents: r ? "auto" : "none"
|
|
151
|
-
},
|
|
152
|
-
inert: !r,
|
|
153
|
-
children: [J && /* @__PURE__ */ f("span", {
|
|
154
|
-
className: "rfe-sheet-handle",
|
|
155
|
-
"aria-hidden": "true"
|
|
156
|
-
}), a]
|
|
157
|
-
})
|
|
158
|
-
})
|
|
159
|
-
});
|
|
160
|
-
return /* @__PURE__ */ p(h, {
|
|
161
|
-
id: G,
|
|
162
|
-
children: [s(ce({
|
|
163
|
-
"aria-expanded": r,
|
|
164
|
-
"aria-controls": r ? W : void 0
|
|
165
|
-
}), ae, W), ue && /* @__PURE__ */ f(_, {
|
|
166
|
-
root: A ?? Y ?? void 0,
|
|
167
|
-
children: J ? /* @__PURE__ */ f(g, {
|
|
168
|
-
lockScroll: r,
|
|
169
|
-
className: "rfe-sheet-overlay",
|
|
170
|
-
style: n(H.tokens),
|
|
171
|
-
children: $
|
|
172
|
-
}) : $
|
|
173
|
-
})]
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
// src/utils/selection.ts
|
|
177
|
-
function R(e, t, n, r) {
|
|
178
|
-
if (e <= 0) return -1;
|
|
179
|
-
let i = n === "ArrowUp" || n === "End", a = i ? -1 : 1, o = n === "Home" ? 0 : n === "End" ? e - 1 : t < 0 ? i ? e - 1 : 0 : t + a;
|
|
180
|
-
for (; o >= 0 && o < e;) {
|
|
181
|
-
if (r(o)) return o;
|
|
182
|
-
o += a;
|
|
183
|
-
}
|
|
184
|
-
return t >= 0 && t < e && r(t) ? t : -1;
|
|
185
|
-
}
|
|
186
|
-
function z(e, t, n, r, i = 1, a = 4) {
|
|
187
|
-
if (e <= 0 || i <= 0 || !n) return 0;
|
|
188
|
-
let o = (o) => {
|
|
189
|
-
let s = 1, c = 0, l = t.slice(0, o).map((t) => Math.min(t, e));
|
|
190
|
-
o < n && l.push(Math.min(r, e));
|
|
191
|
-
for (let t of l) if (c && c + a + t > e && (s++, c = 0), c += t + (c ? a : 0), s > i) return !1;
|
|
192
|
-
return !0;
|
|
193
|
-
}, s = Math.min(t.length, n);
|
|
194
|
-
for (; s > 0 && !o(s);) s--;
|
|
195
|
-
return s;
|
|
196
|
-
}
|
|
197
|
-
export { M as a, j as i, R as n, A as o, I as r, k as s, z as t };
|