@pibit.ai/cure-design-system 0.3.26 → 0.3.30
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.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +96 -91
- package/dist/patterns/table/TableWrapper.d.ts +1 -1
- package/dist/patterns/table/TableWrapper.d.ts.map +1 -1
- package/dist/patterns/table/TableWrapper.js +897 -542
- package/dist/patterns/table/cellRangeSelection.d.ts +64 -0
- package/dist/patterns/table/cellRangeSelection.d.ts.map +1 -0
- package/dist/patterns/table/cellRangeSelection.js +150 -0
- package/dist/patterns/table/cellRangeSelection.test.d.ts +2 -0
- package/dist/patterns/table/cellRangeSelection.test.d.ts.map +1 -0
- package/dist/patterns/table/index.d.ts +3 -2
- package/dist/patterns/table/index.d.ts.map +1 -1
- package/dist/patterns/table/rowReorderDrag.d.ts +70 -0
- package/dist/patterns/table/rowReorderDrag.d.ts.map +1 -0
- package/dist/patterns/table/rowReorderDrag.js +151 -0
- package/dist/patterns/table/rowReorderDrag.test.d.ts +2 -0
- package/dist/patterns/table/rowReorderDrag.test.d.ts.map +1 -0
- package/dist/patterns/table/table.d.ts.map +1 -1
- package/dist/patterns/table/table.js +36 -36
- package/dist/patterns/table/tableUndoRedo.d.ts.map +1 -1
- package/dist/patterns/table/tableUndoRedo.js +21 -18
- package/dist/patterns/table/toolbar/RowActionsMenu.d.ts +17 -1
- package/dist/patterns/table/toolbar/RowActionsMenu.d.ts.map +1 -1
- package/dist/patterns/table/toolbar/RowActionsMenu.js +69 -51
- package/dist/patterns/table/types.d.ts +29 -0
- package/dist/patterns/table/types.d.ts.map +1 -1
- package/dist/patterns/table/useTableUndoRedo.d.ts +9 -0
- package/dist/patterns/table/useTableUndoRedo.d.ts.map +1 -1
- package/dist/patterns/table/useTableUndoRedo.js +217 -127
- package/dist/primitives/checkbox/checkbox.d.ts.map +1 -1
- package/dist/primitives/checkbox/checkbox.js +16 -16
- package/dist/primitives/select/ExpandableSearchInput.d.ts.map +1 -1
- package/dist/primitives/select/ExpandableSearchInput.js +2 -1
- package/dist/primitives/select/SearchInput.d.ts +7 -7
- package/dist/primitives/select/SearchInput.d.ts.map +1 -1
- package/dist/primitives/select/SearchInput.js +66 -62
- package/dist/styles/components.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTableUndoRedo.d.ts","sourceRoot":"","sources":["../../../src/patterns/table/useTableUndoRedo.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,iBAAiB,EAOvB,MAAM,OAAO,CAAC;AACf,OAAO,EAIL,KAAK,wBAAwB,EAC9B,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"useTableUndoRedo.d.ts","sourceRoot":"","sources":["../../../src/patterns/table/useTableUndoRedo.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,iBAAiB,EAOvB,MAAM,OAAO,CAAC;AACf,OAAO,EAIL,KAAK,wBAAwB,EAC9B,MAAM,iBAAiB,CAAC;AAEzB,eAAO,MAAM,WAAW,KAAK,CAAC;AAE9B,MAAM,MAAM,uBAAuB,GAAG,wBAAwB,GAAG;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAC/C,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAA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,aAAa,GACd,EAAE,uBAAuB,GAAG,kBAAkB,CAyI9C;AAED,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,kCAAkC,EAClC,0BAA0B,EAC1B,0BAA0B,EAC1B,6BAA6B,EAC7B,uBAAuB,GACxB,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,168 +1,258 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
import { captureTableUndoSnapshot as
|
|
3
|
-
import { wrapColumnHeaderActionWithUndoRedo as
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
if (!(
|
|
7
|
-
const
|
|
8
|
-
return !!(
|
|
1
|
+
import { useRef as h, useState as D, useCallback as d, useMemo as P, useEffect as F, createElement as Z, createContext as $, useContext as G } from "react";
|
|
2
|
+
import { captureTableUndoSnapshot as I, applyTableUndoSnapshot as _ } from "./tableUndoRedo.js";
|
|
3
|
+
import { wrapColumnHeaderActionWithUndoRedo as ie, wrapEditChromeWithUndoRedo as de, wrapRowActionsWithUndoRedo as fe, wrapSummaryFooterWithUndoRedo as le, wrapToolbarWithUndoRedo as ae } from "./tableUndoRedo.js";
|
|
4
|
+
const J = 50, Q = $(null);
|
|
5
|
+
function b(n) {
|
|
6
|
+
if (!(n instanceof HTMLElement)) return !1;
|
|
7
|
+
const t = n.tagName;
|
|
8
|
+
return !!(t === "INPUT" || t === "TEXTAREA" || t === "SELECT" || n.isContentEditable);
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
|
|
10
|
+
function j(n, t) {
|
|
11
|
+
const o = n.lastIndexOf(t);
|
|
12
|
+
return o === -1 ? n : [...n.slice(0, o), ...n.slice(o + 1)];
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
function V(n, t) {
|
|
15
|
+
const o = n.indexOf(t);
|
|
16
|
+
return o === -1 ? n : [...n.slice(0, o), ...n.slice(o + 1)];
|
|
17
|
+
}
|
|
18
|
+
function ee(n, t) {
|
|
19
|
+
let o = 0;
|
|
20
|
+
for (const f of n)
|
|
21
|
+
f === t && (o += 1);
|
|
22
|
+
return o;
|
|
23
|
+
}
|
|
24
|
+
function q(n, t) {
|
|
25
|
+
let o = [...n, t];
|
|
26
|
+
for (; ee(o, t) > J; )
|
|
27
|
+
o = V(o, t);
|
|
28
|
+
return o;
|
|
29
|
+
}
|
|
30
|
+
function re() {
|
|
31
|
+
return G(Q);
|
|
32
|
+
}
|
|
33
|
+
function ce({
|
|
34
|
+
children: n,
|
|
35
|
+
shortcuts: t = !0,
|
|
36
|
+
isDisabled: o = !1
|
|
17
37
|
}) {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
}, []),
|
|
21
|
-
(
|
|
22
|
-
|
|
38
|
+
const f = h(/* @__PURE__ */ new Map()), c = h([]), s = h([]), y = h(/* @__PURE__ */ new Map()), [x, H] = D(0), u = d(() => {
|
|
39
|
+
H((r) => r + 1);
|
|
40
|
+
}, []), l = d(
|
|
41
|
+
(r) => {
|
|
42
|
+
c.current = c.current.filter((e) => e !== r), s.current = s.current.filter((e) => e !== r), u();
|
|
23
43
|
},
|
|
24
44
|
[u]
|
|
25
|
-
),
|
|
26
|
-
(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
45
|
+
), p = d(
|
|
46
|
+
(r) => {
|
|
47
|
+
f.current.delete(r);
|
|
48
|
+
const e = y.current.get(r);
|
|
49
|
+
e !== void 0 && (clearTimeout(e), y.current.delete(r)), l(r);
|
|
50
|
+
},
|
|
51
|
+
[l]
|
|
52
|
+
), U = d(
|
|
53
|
+
(r) => {
|
|
54
|
+
const e = y.current.get(r.tableId);
|
|
55
|
+
e !== void 0 && (clearTimeout(e), y.current.delete(r.tableId));
|
|
56
|
+
const a = f.current.get(r.tableId);
|
|
57
|
+
return f.current.set(r.tableId, r), (!a || a.canUndo !== r.canUndo || a.canRedo !== r.canRedo) && u(), () => {
|
|
58
|
+
f.current.delete(r.tableId);
|
|
59
|
+
const L = setTimeout(() => {
|
|
60
|
+
y.current.delete(r.tableId), f.current.has(r.tableId) || l(r.tableId);
|
|
61
|
+
}, 0);
|
|
62
|
+
y.current.set(r.tableId, L);
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
[u, l]
|
|
66
|
+
), A = d(
|
|
67
|
+
(r) => {
|
|
68
|
+
var e;
|
|
69
|
+
c.current = [...c.current, r], s.current = s.current.filter((a) => a !== r), (e = f.current.get(r)) == null || e.clearRedo(), u();
|
|
70
|
+
},
|
|
71
|
+
[u]
|
|
72
|
+
), C = d(
|
|
73
|
+
(r) => {
|
|
74
|
+
const e = j(c.current, r);
|
|
75
|
+
e !== c.current && (c.current = e), s.current = [...s.current, r], u();
|
|
31
76
|
},
|
|
32
77
|
[u]
|
|
33
|
-
),
|
|
78
|
+
), K = d(
|
|
79
|
+
(r) => {
|
|
80
|
+
const e = j(s.current, r);
|
|
81
|
+
e !== s.current && (s.current = e), c.current = q(c.current, r), u();
|
|
82
|
+
},
|
|
83
|
+
[u]
|
|
84
|
+
), i = d(
|
|
85
|
+
(r) => {
|
|
86
|
+
const e = V(c.current, r);
|
|
87
|
+
e !== c.current && (c.current = e, u());
|
|
88
|
+
},
|
|
89
|
+
[u]
|
|
90
|
+
), R = d(() => {
|
|
34
91
|
for (; c.current.length > 0; ) {
|
|
35
|
-
const
|
|
92
|
+
const r = c.current[c.current.length - 1];
|
|
36
93
|
c.current = c.current.slice(0, -1);
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
-
|
|
94
|
+
const e = f.current.get(r);
|
|
95
|
+
if (e && e.canUndo) {
|
|
96
|
+
e.undo(), s.current = [...s.current, r], u();
|
|
40
97
|
return;
|
|
41
98
|
}
|
|
42
99
|
}
|
|
43
100
|
u();
|
|
44
|
-
}, [u]),
|
|
101
|
+
}, [u]), g = d(() => {
|
|
45
102
|
for (; s.current.length > 0; ) {
|
|
46
|
-
const
|
|
103
|
+
const r = s.current[s.current.length - 1];
|
|
47
104
|
s.current = s.current.slice(0, -1);
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
50
|
-
|
|
105
|
+
const e = f.current.get(r);
|
|
106
|
+
if (e && e.canRedo) {
|
|
107
|
+
e.redo(), c.current = q(c.current, r), u();
|
|
51
108
|
return;
|
|
52
109
|
}
|
|
53
110
|
}
|
|
54
111
|
u();
|
|
55
|
-
}, [u]),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
112
|
+
}, [u]), T = P(
|
|
113
|
+
() => c.current.some((r) => {
|
|
114
|
+
var e;
|
|
115
|
+
return (e = f.current.get(r)) == null ? void 0 : e.canUndo;
|
|
116
|
+
}),
|
|
117
|
+
[x]
|
|
118
|
+
), w = P(
|
|
119
|
+
() => s.current.some((r) => {
|
|
120
|
+
var e;
|
|
121
|
+
return (e = f.current.get(r)) == null ? void 0 : e.canRedo;
|
|
122
|
+
}),
|
|
123
|
+
[x]
|
|
124
|
+
);
|
|
125
|
+
F(() => {
|
|
126
|
+
if (!t || o) return;
|
|
127
|
+
const r = (e) => {
|
|
128
|
+
if (b(e.target) || !(e.metaKey || e.ctrlKey) || e.altKey) return;
|
|
129
|
+
const S = e.key.toLowerCase(), L = S === "z" && !e.shiftKey, v = S === "z" && e.shiftKey || S === "y";
|
|
130
|
+
L && T ? (e.preventDefault(), e.stopPropagation(), R()) : v && w && (e.preventDefault(), e.stopPropagation(), g());
|
|
68
131
|
};
|
|
69
|
-
return window.addEventListener("keydown",
|
|
70
|
-
}, [
|
|
71
|
-
const
|
|
132
|
+
return window.addEventListener("keydown", r, { capture: !0 }), () => window.removeEventListener("keydown", r, { capture: !0 });
|
|
133
|
+
}, [t, o, T, w, R, g]);
|
|
134
|
+
const E = P(
|
|
72
135
|
() => ({
|
|
73
|
-
canUndo:
|
|
136
|
+
canUndo: T,
|
|
74
137
|
canRedo: w,
|
|
75
|
-
undo:
|
|
76
|
-
redo:
|
|
77
|
-
recordCommit:
|
|
78
|
-
|
|
79
|
-
|
|
138
|
+
undo: R,
|
|
139
|
+
redo: g,
|
|
140
|
+
recordCommit: A,
|
|
141
|
+
recordLocalUndo: C,
|
|
142
|
+
recordLocalRedo: K,
|
|
143
|
+
recordHistoryEviction: i,
|
|
144
|
+
registerTable: U,
|
|
145
|
+
unregisterTable: p
|
|
80
146
|
}),
|
|
81
|
-
[
|
|
147
|
+
[
|
|
148
|
+
T,
|
|
149
|
+
w,
|
|
150
|
+
R,
|
|
151
|
+
g,
|
|
152
|
+
A,
|
|
153
|
+
C,
|
|
154
|
+
K,
|
|
155
|
+
i,
|
|
156
|
+
U,
|
|
157
|
+
p,
|
|
158
|
+
x
|
|
159
|
+
]
|
|
82
160
|
);
|
|
83
|
-
return
|
|
161
|
+
return Z(Q.Provider, { value: E }, n);
|
|
84
162
|
}
|
|
85
|
-
function
|
|
86
|
-
enabled:
|
|
87
|
-
tableId:
|
|
88
|
-
sharedUndoGroup:
|
|
89
|
-
toolbar:
|
|
163
|
+
function oe({
|
|
164
|
+
enabled: n = !1,
|
|
165
|
+
tableId: t,
|
|
166
|
+
sharedUndoGroup: o,
|
|
167
|
+
toolbar: f,
|
|
90
168
|
columnAlignments: c,
|
|
91
169
|
summaryFooterProps: s,
|
|
92
|
-
appliedFilterConditions:
|
|
93
|
-
data:
|
|
94
|
-
getData:
|
|
95
|
-
onDataRestore:
|
|
170
|
+
appliedFilterConditions: y,
|
|
171
|
+
data: x,
|
|
172
|
+
getData: H,
|
|
173
|
+
onDataRestore: u
|
|
96
174
|
}) {
|
|
97
|
-
const
|
|
175
|
+
const l = h([]), p = h([]), U = h(!1), [A, C] = D(0), K = re(), i = o === void 0 ? K : o, R = !!(n && t && i), g = i == null ? void 0 : i.recordCommit, T = i == null ? void 0 : i.recordLocalUndo, w = i == null ? void 0 : i.recordLocalRedo, E = i == null ? void 0 : i.recordHistoryEviction, r = i == null ? void 0 : i.registerTable, e = P(
|
|
98
176
|
() => ({
|
|
99
|
-
toolbar:
|
|
177
|
+
toolbar: f,
|
|
100
178
|
columnAlignments: c,
|
|
101
179
|
summaryFooterProps: s,
|
|
102
|
-
appliedFilterConditions:
|
|
103
|
-
data:
|
|
104
|
-
getData:
|
|
105
|
-
onDataRestore:
|
|
180
|
+
appliedFilterConditions: y,
|
|
181
|
+
data: x,
|
|
182
|
+
getData: H,
|
|
183
|
+
onDataRestore: u
|
|
106
184
|
}),
|
|
107
|
-
[
|
|
108
|
-
),
|
|
109
|
-
!
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
185
|
+
[f, c, s, y, x, H, u]
|
|
186
|
+
), a = d(() => I(e), [e]), S = d(() => {
|
|
187
|
+
if (!n || U.current) return;
|
|
188
|
+
const m = l.current.length >= J;
|
|
189
|
+
l.current = [...l.current.slice(-49), a()], p.current = [], t && g && (g(t), m && E && E(t)), C((O) => O + 1);
|
|
190
|
+
}, [n, a, g, E, t]), L = d(() => {
|
|
191
|
+
if (!n || l.current.length === 0) return !1;
|
|
192
|
+
U.current = !0;
|
|
193
|
+
try {
|
|
194
|
+
const m = a(), O = l.current.pop();
|
|
195
|
+
return p.current = [m, ...p.current], _(O, e), !0;
|
|
196
|
+
} finally {
|
|
197
|
+
U.current = !1, C((m) => m + 1);
|
|
119
198
|
}
|
|
120
|
-
}, [
|
|
121
|
-
if (!
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
199
|
+
}, [n, a, e]), v = d(() => {
|
|
200
|
+
if (!n || p.current.length === 0) return !1;
|
|
201
|
+
U.current = !0;
|
|
202
|
+
try {
|
|
203
|
+
const m = a(), O = p.current.shift();
|
|
204
|
+
return l.current = [...l.current, m], _(O, e), !0;
|
|
205
|
+
} finally {
|
|
206
|
+
U.current = !1, C((m) => m + 1);
|
|
129
207
|
}
|
|
130
|
-
}, [
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
if (!(!n || !
|
|
141
|
-
return (
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
208
|
+
}, [n, a, e]), W = d(() => {
|
|
209
|
+
p.current.length !== 0 && (p.current = [], C((m) => m + 1));
|
|
210
|
+
}, []), M = n && l.current.length > 0, k = n && p.current.length > 0, B = h(L), z = h(v), N = h(W);
|
|
211
|
+
B.current = L, z.current = v, N.current = W;
|
|
212
|
+
const X = d(() => {
|
|
213
|
+
L() && R && t && T && T(t);
|
|
214
|
+
}, [L, R, t, T]), Y = d(() => {
|
|
215
|
+
v() && R && t && w && w(t);
|
|
216
|
+
}, [v, R, t, w]);
|
|
217
|
+
return F(() => {
|
|
218
|
+
if (!(!n || !t || !r))
|
|
219
|
+
return r({
|
|
220
|
+
tableId: t,
|
|
221
|
+
canUndo: M,
|
|
222
|
+
canRedo: k,
|
|
223
|
+
undo: () => {
|
|
224
|
+
B.current();
|
|
225
|
+
},
|
|
226
|
+
redo: () => {
|
|
227
|
+
z.current();
|
|
228
|
+
},
|
|
229
|
+
clearRedo: () => {
|
|
230
|
+
N.current();
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
}, [n, t, r, M, k]), P(
|
|
145
234
|
() => ({
|
|
146
|
-
canUndo:
|
|
147
|
-
canRedo:
|
|
148
|
-
undo:
|
|
149
|
-
redo:
|
|
150
|
-
commitBeforeMutation:
|
|
151
|
-
shortcut:
|
|
235
|
+
canUndo: M,
|
|
236
|
+
canRedo: k,
|
|
237
|
+
undo: X,
|
|
238
|
+
redo: Y,
|
|
239
|
+
commitBeforeMutation: S,
|
|
240
|
+
shortcut: R ? !1 : void 0
|
|
152
241
|
}),
|
|
153
242
|
// revision drives canUndo/canRedo updates after history mutations
|
|
154
|
-
[
|
|
243
|
+
[M, k, X, Y, S, R, A]
|
|
155
244
|
);
|
|
156
245
|
}
|
|
157
246
|
export {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
247
|
+
J as MAX_HISTORY,
|
|
248
|
+
ce as TableUndoRedoProvider,
|
|
249
|
+
_ as applyTableUndoSnapshot,
|
|
250
|
+
I as captureTableUndoSnapshot,
|
|
251
|
+
oe as useTableUndoRedo,
|
|
252
|
+
re as useTableUndoRedoScope,
|
|
253
|
+
ie as wrapColumnHeaderActionWithUndoRedo,
|
|
254
|
+
de as wrapEditChromeWithUndoRedo,
|
|
255
|
+
fe as wrapRowActionsWithUndoRedo,
|
|
256
|
+
le as wrapSummaryFooterWithUndoRedo,
|
|
257
|
+
ae as wrapToolbarWithUndoRedo
|
|
168
258
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/primitives/checkbox/checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAC;AAG1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,SAAS,CAAC;IACpD,qBAAqB;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC;IACpC,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,WAAW,EACX,OAAO,EACP,SAAS,EACT,EAAE,EACF,GAAG,KAAK,EACT,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/primitives/checkbox/checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAC;AAG1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,SAAS,CAAC;IACpD,qBAAqB;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC;IACpC,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,WAAW,EACX,OAAO,EACP,SAAS,EACT,EAAE,EACF,GAAG,KAAK,EACT,EAAE,aAAa,2CA4Cf;yBAnDe,QAAQ"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Icon as
|
|
1
|
+
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "@radix-ui/react-checkbox";
|
|
3
|
+
import { cn as n } from "../../utils/cn.js";
|
|
4
|
+
import { Icon as d } from "../icon/icon.js";
|
|
5
5
|
function b({
|
|
6
6
|
label: t,
|
|
7
7
|
description: r,
|
|
8
|
-
checked:
|
|
9
|
-
className:
|
|
10
|
-
id:
|
|
8
|
+
checked: a,
|
|
9
|
+
className: c,
|
|
10
|
+
id: m,
|
|
11
11
|
...l
|
|
12
12
|
}) {
|
|
13
|
-
const
|
|
14
|
-
return /* @__PURE__ */
|
|
13
|
+
const i = m || `checkbox-${Math.random().toString(36).slice(2, 9)}`;
|
|
14
|
+
return /* @__PURE__ */ s("div", { className: n("flex items-start gap-2", c), children: [
|
|
15
15
|
/* @__PURE__ */ e(
|
|
16
|
-
|
|
16
|
+
o.Root,
|
|
17
17
|
{
|
|
18
|
-
id:
|
|
19
|
-
checked:
|
|
20
|
-
className:
|
|
18
|
+
id: i,
|
|
19
|
+
checked: a,
|
|
20
|
+
className: n(
|
|
21
21
|
"h-4 w-4 shrink-0 rounded border border-gray-300 bg-white",
|
|
22
22
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-600 focus-visible:ring-offset-2",
|
|
23
23
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
@@ -27,14 +27,14 @@ function b({
|
|
|
27
27
|
"mt-0.5"
|
|
28
28
|
),
|
|
29
29
|
...l,
|
|
30
|
-
children: /* @__PURE__ */ e(
|
|
30
|
+
children: /* @__PURE__ */ e(o.Indicator, { className: "flex items-center justify-center text-white", children: a === "indeterminate" ? /* @__PURE__ */ e(d, { name: "Minus", size: 12 }) : /* @__PURE__ */ e(d, { name: "Check", size: 12 }) })
|
|
31
31
|
}
|
|
32
32
|
),
|
|
33
|
-
(t || r) && /* @__PURE__ */
|
|
33
|
+
(t || r) && /* @__PURE__ */ s("div", { className: "flex flex-col gap-0.5", children: [
|
|
34
34
|
t && /* @__PURE__ */ e(
|
|
35
35
|
"label",
|
|
36
36
|
{
|
|
37
|
-
htmlFor:
|
|
37
|
+
htmlFor: i,
|
|
38
38
|
className: "text-sm font-medium text-gray-700 cursor-pointer",
|
|
39
39
|
children: t
|
|
40
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandableSearchInput.d.ts","sourceRoot":"","sources":["../../../src/primitives/select/ExpandableSearchInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,iBAAiB,EACtB,KAAK,oB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,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iEAAiE;IACjE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wGAAwG;IACxG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8EAA8E;IAC9E,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAKD,eAAO,MAAM,qBAAqB,GAAI,2JAcnC,0BAA0B,4CAsJ5B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FocusEventHandler, KeyboardEventHandler } from 'react';
|
|
2
|
-
interface SearchInputProps {
|
|
2
|
+
export interface SearchInputProps {
|
|
3
3
|
label?: string;
|
|
4
4
|
hint?: string;
|
|
5
5
|
tooltip?: string;
|
|
@@ -13,6 +13,11 @@ interface SearchInputProps {
|
|
|
13
13
|
isDisabled?: boolean;
|
|
14
14
|
isRequired?: boolean;
|
|
15
15
|
isInvalid?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* When true, renders a visible border. Defaults to false so embedded consumers
|
|
18
|
+
* (dropdowns, filter bars) keep the borderless look and avoid double borders.
|
|
19
|
+
*/
|
|
20
|
+
bordered?: boolean;
|
|
16
21
|
/** When true, shows the platform-specific primary keyboard shortcut hint (⌘K on Apple platforms, Ctrl+K elsewhere). */
|
|
17
22
|
shortcut?: boolean;
|
|
18
23
|
/** When true, registers the platform-specific primary shortcut to focus the input. Defaults to `shortcut`. */
|
|
@@ -21,10 +26,5 @@ interface SearchInputProps {
|
|
|
21
26
|
className?: string;
|
|
22
27
|
"aria-label"?: string;
|
|
23
28
|
}
|
|
24
|
-
export default function SearchInput({ size, shortcut, registerShortcut, placeholder, shortcutClassName, value, onChange, onKeyDown, className, isDisabled, "aria-label": ariaLabel, ...props }:
|
|
25
|
-
size?: "sm" | "md" | "lg";
|
|
26
|
-
shortcut?: boolean;
|
|
27
|
-
registerShortcut?: boolean;
|
|
28
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
export {};
|
|
29
|
+
export default function SearchInput({ size, shortcut, registerShortcut, bordered, placeholder, shortcutClassName, value, onChange, onKeyDown, className, isDisabled, "aria-label": ariaLabel, ...props }: SearchInputProps): import("react/jsx-runtime").JSX.Element;
|
|
30
30
|
//# sourceMappingURL=SearchInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchInput.d.ts","sourceRoot":"","sources":["../../../src/primitives/select/SearchInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EAC1B,MAAM,OAAO,CAAC;AAYf,
|
|
1
|
+
{"version":3,"file":"SearchInput.d.ts","sourceRoot":"","sources":["../../../src/primitives/select/SearchInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EAC1B,MAAM,OAAO,CAAC;AAYf,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uHAAuH;IACvH,Q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