impact-nova 3.0.0-alpha.2 → 3.0.0-alpha.4
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/components/data/expandable-list-item/index.d.ts +2 -0
- package/dist/components/data/expandable-list-item/index.js +20 -16
- package/dist/components/data/expandable-list-item/product-card-hero.d.ts +15 -0
- package/dist/components/data/expandable-list-item/product-card-iris-insight-trigger.d.ts +8 -0
- package/dist/components/data/expandable-list-item/product-card-iris-insight-trigger.js +41 -0
- package/dist/components/data/expandable-list-item/product-card-metrics-toggle.d.ts +13 -0
- package/dist/components/data/expandable-list-item/product-card-metrics-toggle.js +27 -0
- package/dist/components/data/expandable-list-item/sku-picker-chrome.d.ts +35 -0
- package/dist/components/data/expandable-list-item/sku-picker-chrome.js +144 -0
- package/dist/components/data/expandable-list-item/virtualized-responsive-grid.sku-picker.d.ts +3 -2
- package/dist/components/forms/choice-card/choice-card.variants.js +3 -3
- package/dist/components/primitives/iris/iris.d.ts +1 -0
- package/dist/components/primitives/iris/iris.js +76 -74
- package/dist/components/primitives/iris/iris.types.d.ts +2 -0
- package/dist/form-react/Fields/VirtualizedListField.d.ts +3 -0
- package/dist/form-react/Fields/VirtualizedListField.js +174 -0
- package/dist/form-react/fields.d.ts +1 -0
- package/dist/form-react/fields.js +28 -26
- package/dist/form-react/registry/defaultFieldRegistrations.d.ts +1 -1
- package/dist/form-react/registry/defaultFieldRegistrations.js +13 -12
- package/dist/form-react/types/fields.types.d.ts +21 -1
- package/dist/form-react/types/fieldsOutput.types.d.ts +4 -1
- package/dist/form-react/utils/fieldDefaults.utils.js +1 -1
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +356 -352
- package/dist/lib/alphabetical-sort.d.ts +3 -0
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +3 -1
|
@@ -1,109 +1,110 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
1
|
+
import { jsx as t, jsxs as I } from "react/jsx-runtime";
|
|
2
2
|
import * as x from "react";
|
|
3
|
-
import { Alan as
|
|
4
|
-
import { Button as
|
|
3
|
+
import { Alan as b } from "impact-nova-icons";
|
|
4
|
+
import { Button as w } from "../button/button.js";
|
|
5
5
|
import { Popover as B, PopoverTrigger as z, PopoverContent as k } from "../../feedback/popover/popover.js";
|
|
6
6
|
import { OverflowTooltip as A } from "../../feedback/tooltip/overflow-tooltip.js";
|
|
7
|
-
import { createComponent as
|
|
7
|
+
import { createComponent as g } from "../../../lib/primitives/create-component.js";
|
|
8
8
|
import { cn as l } from "../../../lib/utils.js";
|
|
9
|
-
import { IrisAlanGradientIcon as
|
|
10
|
-
import { irisButtonToButtonSize as
|
|
9
|
+
import { IrisAlanGradientIcon as v } from "./iris-alan-gradient-icon.js";
|
|
10
|
+
import { irisButtonToButtonSize as T, irisButtonVariants as V, irisChromeWrapperVariants as O, irisIconChromeWrapperVariants as P, irisIconFilledButtonVariants as y, irisIconButtonToButtonSize as S, irisIconButtonVariants as j, irisMenuVariants as M } from "./iris.variants.js";
|
|
11
11
|
import { IrisControlProvider as _, IrisControlRegion as $ } from "./iris-control-region.js";
|
|
12
12
|
import { IrisAgentCursor as ii } from "./iris-agent-cursor.js";
|
|
13
|
-
import { useIrisControl as
|
|
13
|
+
import { useIrisControl as oi } from "./iris-control-context.js";
|
|
14
14
|
const G = {
|
|
15
15
|
sm: 14,
|
|
16
16
|
md: 16,
|
|
17
17
|
lg: 16
|
|
18
|
-
}, U =
|
|
18
|
+
}, U = g(
|
|
19
19
|
"IrisButton",
|
|
20
20
|
({
|
|
21
|
-
className:
|
|
21
|
+
className: o,
|
|
22
22
|
size: i = "md",
|
|
23
|
-
shape:
|
|
23
|
+
shape: n = "default",
|
|
24
24
|
children: e,
|
|
25
25
|
type: s = "button",
|
|
26
26
|
...r
|
|
27
|
-
}, a) => /* @__PURE__ */ t("span", { className:
|
|
28
|
-
|
|
27
|
+
}, a) => /* @__PURE__ */ t("span", { className: O({ shape: n }), children: /* @__PURE__ */ I(
|
|
28
|
+
w,
|
|
29
29
|
{
|
|
30
30
|
ref: a,
|
|
31
31
|
type: s,
|
|
32
32
|
variant: "ghost",
|
|
33
|
-
size:
|
|
33
|
+
size: T[i],
|
|
34
34
|
"data-component": "iris-button",
|
|
35
35
|
"data-size": i,
|
|
36
|
-
"data-shape":
|
|
37
|
-
className: l(
|
|
36
|
+
"data-shape": n,
|
|
37
|
+
className: l(V({ size: i }), o),
|
|
38
38
|
...r,
|
|
39
39
|
children: [
|
|
40
|
-
/* @__PURE__ */ t(
|
|
40
|
+
/* @__PURE__ */ t(v, { size: G[i] }),
|
|
41
41
|
e ?? "Ask Iris"
|
|
42
42
|
]
|
|
43
43
|
}
|
|
44
44
|
) })
|
|
45
|
-
), R =
|
|
45
|
+
), R = g(
|
|
46
46
|
"IrisIconButton",
|
|
47
47
|
({
|
|
48
|
-
className:
|
|
48
|
+
className: o,
|
|
49
49
|
appearance: i = "outline",
|
|
50
|
-
size:
|
|
50
|
+
size: n = "md",
|
|
51
51
|
shape: e = "default",
|
|
52
52
|
type: s = "button",
|
|
53
53
|
"aria-label": r = "Ask Iris",
|
|
54
54
|
...a
|
|
55
|
-
},
|
|
56
|
-
const
|
|
57
|
-
return i === "filled" ? /* @__PURE__ */ t("span", { className:
|
|
55
|
+
}, d) => {
|
|
56
|
+
const m = P({ appearance: i, shape: e }), c = i === "filled" ? /* @__PURE__ */ t(b, { size: 16, className: "text-brand-foreground" }) : /* @__PURE__ */ t(v, { size: 16 });
|
|
57
|
+
return i === "filled" ? /* @__PURE__ */ t("span", { className: m, children: /* @__PURE__ */ t(
|
|
58
58
|
"button",
|
|
59
59
|
{
|
|
60
|
-
ref:
|
|
60
|
+
ref: d,
|
|
61
61
|
type: s,
|
|
62
62
|
"data-component": "iris-icon-button",
|
|
63
63
|
"data-appearance": i,
|
|
64
|
-
"data-size":
|
|
64
|
+
"data-size": n,
|
|
65
65
|
"data-shape": e,
|
|
66
66
|
"aria-label": r,
|
|
67
|
-
className: l(
|
|
67
|
+
className: l(y({ size: n }), o),
|
|
68
68
|
...a,
|
|
69
|
-
children:
|
|
69
|
+
children: c
|
|
70
70
|
}
|
|
71
|
-
) }) : /* @__PURE__ */ t("span", { className:
|
|
72
|
-
|
|
71
|
+
) }) : /* @__PURE__ */ t("span", { className: m, children: /* @__PURE__ */ t(
|
|
72
|
+
w,
|
|
73
73
|
{
|
|
74
|
-
ref:
|
|
74
|
+
ref: d,
|
|
75
75
|
type: s,
|
|
76
76
|
variant: "ghost",
|
|
77
|
-
size:
|
|
77
|
+
size: S[n],
|
|
78
78
|
"data-component": "iris-icon-button",
|
|
79
79
|
"data-appearance": i,
|
|
80
|
-
"data-size":
|
|
80
|
+
"data-size": n,
|
|
81
81
|
"data-shape": e,
|
|
82
82
|
"aria-label": r,
|
|
83
|
-
className: l(
|
|
83
|
+
className: l(j({ size: n }), o),
|
|
84
84
|
...a,
|
|
85
|
-
children:
|
|
85
|
+
children: c
|
|
86
86
|
}
|
|
87
87
|
) });
|
|
88
88
|
}
|
|
89
|
-
),
|
|
89
|
+
), C = g(
|
|
90
90
|
"IrisMenu",
|
|
91
91
|
({
|
|
92
|
-
className:
|
|
92
|
+
className: o,
|
|
93
93
|
appearance: i = "loading",
|
|
94
|
-
children:
|
|
94
|
+
children: n,
|
|
95
95
|
onAskInChat: e,
|
|
96
96
|
askInChatLabel: s = "Ask in chat",
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
overflowTooltipContent: r,
|
|
98
|
+
...a
|
|
99
|
+
}, d) => {
|
|
100
|
+
const m = i === "loading" || i === "status", c = i === "card", f = r ?? (typeof n == "string" ? n : void 0), u = /* @__PURE__ */ I(
|
|
100
101
|
"div",
|
|
101
102
|
{
|
|
102
|
-
ref:
|
|
103
|
+
ref: d,
|
|
103
104
|
"data-component": "iris-menu",
|
|
104
105
|
"data-appearance": i,
|
|
105
|
-
className: l(M({ appearance: i }),
|
|
106
|
-
...
|
|
106
|
+
className: l(M({ appearance: i }), o),
|
|
107
|
+
...a,
|
|
107
108
|
children: [
|
|
108
109
|
m && /* @__PURE__ */ t(
|
|
109
110
|
"span",
|
|
@@ -112,7 +113,7 @@ const G = {
|
|
|
112
113
|
"inline-flex shrink-0 items-center justify-center",
|
|
113
114
|
i === "status" ? "size-4" : "size-6"
|
|
114
115
|
),
|
|
115
|
-
children: /* @__PURE__ */ t(
|
|
116
|
+
children: /* @__PURE__ */ t(v, { size: i === "status" ? 16 : 20 })
|
|
116
117
|
}
|
|
117
118
|
),
|
|
118
119
|
/* @__PURE__ */ t(
|
|
@@ -133,12 +134,13 @@ const G = {
|
|
|
133
134
|
variant: "secondary",
|
|
134
135
|
side: "top",
|
|
135
136
|
sideOffset: 10,
|
|
136
|
-
|
|
137
|
+
content: f,
|
|
138
|
+
children: n
|
|
137
139
|
}
|
|
138
|
-
) :
|
|
140
|
+
) : n
|
|
139
141
|
}
|
|
140
142
|
),
|
|
141
|
-
c && e && /* @__PURE__ */ t(
|
|
143
|
+
c && e && /* @__PURE__ */ t(w, { variant: "outline", size: "sm", className: "max-h-7 capitalize", onClick: e, children: s })
|
|
142
144
|
]
|
|
143
145
|
}
|
|
144
146
|
);
|
|
@@ -149,66 +151,66 @@ const G = {
|
|
|
149
151
|
"iris-edge-wash-shell iris-edge-wash-shell--menu rounded-xl motion-reduce:animate-none",
|
|
150
152
|
i === "status" && "iris-edge-wash-shell--fluid iris-edge-wash-shell--menu-plain"
|
|
151
153
|
),
|
|
152
|
-
children:
|
|
154
|
+
children: u
|
|
153
155
|
}
|
|
154
|
-
) :
|
|
156
|
+
) : u;
|
|
155
157
|
}
|
|
156
|
-
), X =
|
|
158
|
+
), X = g(
|
|
157
159
|
"IrisInsight",
|
|
158
160
|
({
|
|
159
|
-
status:
|
|
161
|
+
status: o = "idle",
|
|
160
162
|
iconSize: i = "md",
|
|
161
|
-
iconAppearance:
|
|
163
|
+
iconAppearance: n = "outline",
|
|
162
164
|
loadingLabel: e = "Gathering insights...",
|
|
163
165
|
onTriggerClick: s,
|
|
164
166
|
onAskInChat: r,
|
|
165
167
|
askInChatLabel: a,
|
|
166
|
-
className:
|
|
167
|
-
children:
|
|
168
|
-
},
|
|
169
|
-
const [
|
|
168
|
+
className: d,
|
|
169
|
+
children: m
|
|
170
|
+
}, c) => {
|
|
171
|
+
const [f, u] = x.useState(!1), h = o === "loading" || o === "ready", N = o === "loading";
|
|
170
172
|
return x.useEffect(() => {
|
|
171
|
-
|
|
172
|
-
}, [
|
|
173
|
+
o === "loading" && u(!0);
|
|
174
|
+
}, [o]), /* @__PURE__ */ t(
|
|
173
175
|
"div",
|
|
174
176
|
{
|
|
175
|
-
ref:
|
|
177
|
+
ref: c,
|
|
176
178
|
"data-component": "iris",
|
|
177
|
-
"data-status":
|
|
178
|
-
className: l("relative inline-flex items-start",
|
|
179
|
-
children: /* @__PURE__ */
|
|
179
|
+
"data-status": o,
|
|
180
|
+
className: l("relative inline-flex items-start", d),
|
|
181
|
+
children: /* @__PURE__ */ I(
|
|
180
182
|
B,
|
|
181
183
|
{
|
|
182
|
-
open:
|
|
183
|
-
onOpenChange: (
|
|
184
|
-
|
|
184
|
+
open: h ? f : !1,
|
|
185
|
+
onOpenChange: (p) => {
|
|
186
|
+
h && u(p);
|
|
185
187
|
},
|
|
186
188
|
children: [
|
|
187
189
|
/* @__PURE__ */ t(z, { asChild: !0, children: /* @__PURE__ */ t(
|
|
188
190
|
R,
|
|
189
191
|
{
|
|
190
192
|
size: i,
|
|
191
|
-
appearance:
|
|
192
|
-
"aria-expanded":
|
|
193
|
-
onClick: (
|
|
194
|
-
|
|
193
|
+
appearance: N ? "filled" : n,
|
|
194
|
+
"aria-expanded": f && h,
|
|
195
|
+
onClick: (p) => {
|
|
196
|
+
o === "idle" && (s?.(), p.preventDefault());
|
|
195
197
|
}
|
|
196
198
|
}
|
|
197
199
|
) }),
|
|
198
|
-
|
|
200
|
+
h && /* @__PURE__ */ t(
|
|
199
201
|
k,
|
|
200
202
|
{
|
|
201
203
|
align: "end",
|
|
202
204
|
side: "bottom",
|
|
203
205
|
sideOffset: 7,
|
|
204
206
|
className: "w-auto border-0 bg-transparent p-0 shadow-none motion-reduce:animate-none",
|
|
205
|
-
children:
|
|
206
|
-
|
|
207
|
+
children: o === "loading" ? /* @__PURE__ */ t(C, { appearance: "loading", children: e }) : /* @__PURE__ */ t(
|
|
208
|
+
C,
|
|
207
209
|
{
|
|
208
210
|
appearance: "card",
|
|
209
211
|
onAskInChat: r,
|
|
210
212
|
askInChatLabel: a,
|
|
211
|
-
children:
|
|
213
|
+
children: m
|
|
212
214
|
}
|
|
213
215
|
)
|
|
214
216
|
}
|
|
@@ -227,6 +229,6 @@ export {
|
|
|
227
229
|
$ as IrisControlRegion,
|
|
228
230
|
R as IrisIconButton,
|
|
229
231
|
X as IrisInsight,
|
|
230
|
-
|
|
231
|
-
|
|
232
|
+
C as IrisMenu,
|
|
233
|
+
oi as useIrisControl
|
|
232
234
|
};
|
|
@@ -19,6 +19,8 @@ export type IrisMenuProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
19
19
|
appearance?: IrisMenuAppearance;
|
|
20
20
|
onAskInChat?: () => void;
|
|
21
21
|
askInChatLabel?: string;
|
|
22
|
+
/** Tooltip body when `children` is not a plain string (e.g. formatted insight copy). */
|
|
23
|
+
overflowTooltipContent?: React.ReactNode;
|
|
22
24
|
};
|
|
23
25
|
export type IrisInsightStatus = "idle" | "loading" | "ready";
|
|
24
26
|
export type IrisInsightProps = {
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { jsx as i, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import { useState as b } from "react";
|
|
3
|
+
import { Controller as k } from "react-hook-form";
|
|
4
|
+
import { ChoiceCardGroup as I, ChoiceCard as j, ChoiceCardIndicator as q, ChoiceCardContent as z, ChoiceCardTitle as D } from "../../components/forms/choice-card/choice-card.js";
|
|
5
|
+
import { SkuPickerChrome as B } from "../../components/data/expandable-list-item/sku-picker-chrome.js";
|
|
6
|
+
import { cn as S } from "../../lib/utils.js";
|
|
7
|
+
import { getFieldTestId as M } from "../utils/fieldTestIds.js";
|
|
8
|
+
function P(e) {
|
|
9
|
+
if (!Array.isArray(e))
|
|
10
|
+
return [];
|
|
11
|
+
const r = [];
|
|
12
|
+
for (const t of e)
|
|
13
|
+
typeof t == "string" && r.push(t);
|
|
14
|
+
return r;
|
|
15
|
+
}
|
|
16
|
+
function y(e, r, t) {
|
|
17
|
+
if (t === "single") {
|
|
18
|
+
const l = Array.from(r).find((o) => !e.includes(o));
|
|
19
|
+
return l ? [l] : Array.from(r).slice(0, 1);
|
|
20
|
+
}
|
|
21
|
+
const a = [];
|
|
22
|
+
for (const l of e)
|
|
23
|
+
r.has(l) && a.push(l);
|
|
24
|
+
for (const l of r)
|
|
25
|
+
e.includes(l) || a.push(l);
|
|
26
|
+
return a;
|
|
27
|
+
}
|
|
28
|
+
function d(e) {
|
|
29
|
+
return typeof e.label == "string" ? e.label : e.value;
|
|
30
|
+
}
|
|
31
|
+
function E(e, r, t) {
|
|
32
|
+
const a = r.trim().toLowerCase(), l = e.filter(
|
|
33
|
+
(o) => d(o).toLowerCase().includes(a)
|
|
34
|
+
);
|
|
35
|
+
return t ? l.sort(
|
|
36
|
+
(o, f) => d(o).localeCompare(d(f))
|
|
37
|
+
) : l;
|
|
38
|
+
}
|
|
39
|
+
function G(e, r) {
|
|
40
|
+
let t = 0;
|
|
41
|
+
for (const a of e)
|
|
42
|
+
if (a.isDisabled !== !0 && (t += 1, !r.includes(a.value)))
|
|
43
|
+
return !1;
|
|
44
|
+
return t > 0;
|
|
45
|
+
}
|
|
46
|
+
function R(e, r) {
|
|
47
|
+
const t = [];
|
|
48
|
+
for (const a of r) {
|
|
49
|
+
const l = e.find((o) => o.value === a);
|
|
50
|
+
if (l && (t.push(d(l)), t.length === 5))
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
return t;
|
|
54
|
+
}
|
|
55
|
+
function _(e) {
|
|
56
|
+
const r = e.view === "card";
|
|
57
|
+
return /* @__PURE__ */ i(
|
|
58
|
+
I,
|
|
59
|
+
{
|
|
60
|
+
type: "multiple",
|
|
61
|
+
value: e.selected ? [e.option.value] : [],
|
|
62
|
+
onValueChange: (t) => {
|
|
63
|
+
t.includes(e.option.value) !== e.selected && e.onToggle();
|
|
64
|
+
},
|
|
65
|
+
disabled: e.disabled,
|
|
66
|
+
className: "min-w-0 w-full",
|
|
67
|
+
children: /* @__PURE__ */ x(
|
|
68
|
+
j,
|
|
69
|
+
{
|
|
70
|
+
value: e.option.value,
|
|
71
|
+
size: "sm",
|
|
72
|
+
disabled: e.disabled,
|
|
73
|
+
"aria-label": d(e.option),
|
|
74
|
+
className: S(
|
|
75
|
+
"w-full min-w-0 items-center",
|
|
76
|
+
!r && "justify-start gap-3 rounded-none border-0 bg-transparent p-0 shadow-none hover:border-0 data-[selected]:border-0 data-[selected]:bg-transparent data-[selected]:shadow-none"
|
|
77
|
+
),
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ i(
|
|
80
|
+
q,
|
|
81
|
+
{
|
|
82
|
+
className: r ? "order-last self-center" : "order-first self-center"
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
/* @__PURE__ */ i(z, { className: "min-w-0", children: /* @__PURE__ */ i(D, { className: "whitespace-normal normal-case", children: d(e.option) }) })
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
const X = ({
|
|
93
|
+
field: e,
|
|
94
|
+
validationRules: r,
|
|
95
|
+
isDisabled: t,
|
|
96
|
+
formHelpers: a
|
|
97
|
+
}) => {
|
|
98
|
+
const [l, o] = b(""), [f, N] = b(!1), [m, A] = b("card");
|
|
99
|
+
if (e.fieldType !== "virtualized_list") return null;
|
|
100
|
+
const C = e.options ?? [], g = e.selectionMode ?? "multi", L = a.form.control, h = E(C, l, f);
|
|
101
|
+
return /* @__PURE__ */ i(
|
|
102
|
+
k,
|
|
103
|
+
{
|
|
104
|
+
name: e.id,
|
|
105
|
+
control: L,
|
|
106
|
+
disabled: t,
|
|
107
|
+
rules: r,
|
|
108
|
+
render: ({ field: u, fieldState: p }) => {
|
|
109
|
+
const c = P(u.value), v = !!p.error, w = v ? p.error?.message : e.helpText, T = (n) => {
|
|
110
|
+
if (t || n.isDisabled === !0)
|
|
111
|
+
return;
|
|
112
|
+
const s = new Set(c);
|
|
113
|
+
s.has(n.value) ? s.delete(n.value) : s.add(n.value), u.onChange(y(c, s, g));
|
|
114
|
+
}, V = () => {
|
|
115
|
+
if (g === "single") {
|
|
116
|
+
const s = h.find((O) => O.isDisabled !== !0);
|
|
117
|
+
u.onChange(s ? [s.value] : []);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const n = new Set(c);
|
|
121
|
+
for (const s of h)
|
|
122
|
+
s.isDisabled !== !0 && n.add(s.value);
|
|
123
|
+
u.onChange(y(c, n, "multi"));
|
|
124
|
+
};
|
|
125
|
+
return /* @__PURE__ */ x("div", { "data-testid": M(e.id), children: [
|
|
126
|
+
/* @__PURE__ */ i(
|
|
127
|
+
B,
|
|
128
|
+
{
|
|
129
|
+
collapsible: e.collapsible,
|
|
130
|
+
defaultCollapsed: e.defaultCollapsed,
|
|
131
|
+
title: e.label,
|
|
132
|
+
required: e.isRequired,
|
|
133
|
+
emptyLabel: "None selected",
|
|
134
|
+
searchLabel: e.label ? `Search ${e.label}` : "Search",
|
|
135
|
+
showBack: !1,
|
|
136
|
+
view: m,
|
|
137
|
+
search: l,
|
|
138
|
+
sortAlphabetically: f,
|
|
139
|
+
selectedCount: c.length,
|
|
140
|
+
allSelected: G(h, c),
|
|
141
|
+
previewCodes: R(C, c),
|
|
142
|
+
onSearchChange: o,
|
|
143
|
+
onViewChange: A,
|
|
144
|
+
onToggleSort: () => N((n) => !n),
|
|
145
|
+
onSelectAll: V,
|
|
146
|
+
onClear: () => u.onChange([]),
|
|
147
|
+
children: /* @__PURE__ */ i(
|
|
148
|
+
"div",
|
|
149
|
+
{
|
|
150
|
+
className: m === "card" ? "grid w-full grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-3" : "flex w-full flex-col gap-2",
|
|
151
|
+
children: h.map((n) => /* @__PURE__ */ i(
|
|
152
|
+
_,
|
|
153
|
+
{
|
|
154
|
+
option: n,
|
|
155
|
+
selected: c.includes(n.value),
|
|
156
|
+
disabled: t || n.isDisabled === !0,
|
|
157
|
+
view: m,
|
|
158
|
+
onToggle: () => T(n)
|
|
159
|
+
},
|
|
160
|
+
n.value
|
|
161
|
+
))
|
|
162
|
+
}
|
|
163
|
+
)
|
|
164
|
+
}
|
|
165
|
+
),
|
|
166
|
+
w ? /* @__PURE__ */ i("p", { className: S("mt-1 text-xs", v ? "text-destructive" : "text-content-tertiary"), children: w }) : null
|
|
167
|
+
] });
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
};
|
|
172
|
+
export {
|
|
173
|
+
X as VirtualizedListField
|
|
174
|
+
};
|
|
@@ -14,6 +14,7 @@ export { SelectField } from './Fields/SelectField';
|
|
|
14
14
|
export { CheckboxField } from './Fields/CheckboxField';
|
|
15
15
|
export { SwitchField } from './Fields/SwitchField';
|
|
16
16
|
export { ChipsField } from './Fields/ChipsField';
|
|
17
|
+
export { VirtualizedListField } from './Fields/VirtualizedListField';
|
|
17
18
|
export { DateInputField } from './Fields/DateInputField';
|
|
18
19
|
export { FillFormByPasteField } from './Fields/FillFormByPasteField';
|
|
19
20
|
export { FillFormByFileUploadField } from './Fields/FillFormByFileUploadField';
|
|
@@ -1,50 +1,52 @@
|
|
|
1
|
-
import { TextField as
|
|
1
|
+
import { TextField as o } from "./Fields/TextField.js";
|
|
2
2
|
import { TextAreaField as t } from "./Fields/TextAreaField.js";
|
|
3
3
|
import { ButtonsGroupField as d } from "./Fields/ButtonsGroupField.js";
|
|
4
4
|
import { RadioField as F } from "./Fields/RadioField.js";
|
|
5
5
|
import { DateRangeField as m } from "./Fields/DateRangeField.js";
|
|
6
6
|
import { WeekRangeField as a } from "./Fields/WeekRangePicker.js";
|
|
7
7
|
import { MonthRangeField as n } from "./Fields/MonthRangeField.js";
|
|
8
|
-
import { FileUploadField as
|
|
8
|
+
import { FileUploadField as u } from "./Fields/FileUploadField.js";
|
|
9
9
|
import { SelectField as R } from "./Fields/SelectField.js";
|
|
10
10
|
import { CheckboxField as g } from "./Fields/CheckboxField.js";
|
|
11
|
-
import { SwitchField as
|
|
12
|
-
import { ChipsField as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
11
|
+
import { SwitchField as s } from "./Fields/SwitchField.js";
|
|
12
|
+
import { ChipsField as T } from "./Fields/ChipsField.js";
|
|
13
|
+
import { VirtualizedListField as C } from "./Fields/VirtualizedListField.js";
|
|
14
|
+
import { DateInputField as W } from "./Fields/DateInputField.js";
|
|
15
|
+
import { FillFormByPasteField as y } from "./Fields/FillFormByPasteField.js";
|
|
16
|
+
import { FillFormByFileUploadField as U } from "./Fields/FillFormByFileUploadField.js";
|
|
17
|
+
import { NumericComboboxField as w } from "./Fields/NumericComboboxField.js";
|
|
17
18
|
import { MultiMonthPickerField as A } from "./Fields/MultiMonthPickerField.js";
|
|
18
19
|
import { MultiWeekPickerField as I } from "./Fields/MultiWeekPickerField.js";
|
|
19
|
-
import { TextFieldWithBackendValidation as
|
|
20
|
+
import { TextFieldWithBackendValidation as N } from "./Fields/TextFieldWithBackendValidation.js";
|
|
20
21
|
import { SliderRangeField as q } from "./Fields/SliderRangeField.js";
|
|
21
|
-
import { RichTextField as
|
|
22
|
-
import { YearPickerField as
|
|
23
|
-
import { MultiYearPickerField as
|
|
24
|
-
import { YearRangePickerField as
|
|
22
|
+
import { RichTextField as E } from "./Fields/RichTextField.js";
|
|
23
|
+
import { YearPickerField as J } from "./Fields/YearPickerField.js";
|
|
24
|
+
import { MultiYearPickerField as O } from "./Fields/MultiYearPickerField.js";
|
|
25
|
+
import { YearRangePickerField as X } from "./Fields/YearRangePickerField.js";
|
|
25
26
|
export {
|
|
26
27
|
d as ButtonsGroupField,
|
|
27
28
|
g as CheckboxField,
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
T as ChipsField,
|
|
30
|
+
W as DateInputField,
|
|
30
31
|
m as DateRangeField,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
u as FileUploadField,
|
|
33
|
+
U as FillFormByFileUploadField,
|
|
34
|
+
y as FillFormByPasteField,
|
|
34
35
|
n as MonthRangeField,
|
|
35
36
|
A as MultiMonthPickerField,
|
|
36
37
|
I as MultiWeekPickerField,
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
O as MultiYearPickerField,
|
|
39
|
+
w as NumericComboboxField,
|
|
39
40
|
F as RadioField,
|
|
40
|
-
|
|
41
|
+
E as RichTextField,
|
|
41
42
|
R as SelectField,
|
|
42
43
|
q as SliderRangeField,
|
|
43
|
-
|
|
44
|
+
s as SwitchField,
|
|
44
45
|
t as TextAreaField,
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
o as TextField,
|
|
47
|
+
N as TextFieldWithBackendValidation,
|
|
48
|
+
C as VirtualizedListField,
|
|
47
49
|
a as WeekRangeField,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
J as YearPickerField,
|
|
51
|
+
X as YearRangePickerField
|
|
50
52
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Register all
|
|
2
|
+
* Register all built-in field types. Safe to call multiple times — runs once.
|
|
3
3
|
*
|
|
4
4
|
* Consumers must call this at app startup (or use `registerFieldType` selectively)
|
|
5
5
|
* before rendering any `FieldRenderer` / `ReactHooksForm`.
|
|
@@ -2,11 +2,11 @@ import { registerFieldType as e } from "./fieldRegistry.js";
|
|
|
2
2
|
import { SelectField as r } from "../Fields/SelectField.js";
|
|
3
3
|
import { ButtonsGroupField as o } from "../Fields/ButtonsGroupField.js";
|
|
4
4
|
import { RadioField as t } from "../Fields/RadioField.js";
|
|
5
|
-
import { TextField as
|
|
6
|
-
import { TextAreaField as
|
|
5
|
+
import { TextField as l } from "../Fields/TextField.js";
|
|
6
|
+
import { TextAreaField as m } from "../Fields/TextAreaField.js";
|
|
7
7
|
import { DateRangeField as d } from "../Fields/DateRangeField.js";
|
|
8
|
-
import { DateInputField as
|
|
9
|
-
import { WeekRangeField as
|
|
8
|
+
import { DateInputField as a } from "../Fields/DateInputField.js";
|
|
9
|
+
import { WeekRangeField as p } from "../Fields/WeekRangePicker.js";
|
|
10
10
|
import { MonthRangeField as f } from "../Fields/MonthRangeField.js";
|
|
11
11
|
import { MultiWeekPickerField as F } from "../Fields/MultiWeekPickerField.js";
|
|
12
12
|
import { MultiMonthPickerField as _ } from "../Fields/MultiMonthPickerField.js";
|
|
@@ -14,21 +14,22 @@ import { FileUploadField as n } from "../Fields/FileUploadField.js";
|
|
|
14
14
|
import { FillFormByPasteField as c } from "../Fields/FillFormByPasteField.js";
|
|
15
15
|
import { FillFormByFileUploadField as u } from "../Fields/FillFormByFileUploadField.js";
|
|
16
16
|
import { ChipsField as k } from "../Fields/ChipsField.js";
|
|
17
|
+
import { VirtualizedListField as s } from "../Fields/VirtualizedListField.js";
|
|
17
18
|
import { TextFieldWithBackendValidation as b } from "../Fields/TextFieldWithBackendValidation.js";
|
|
18
19
|
import { SwitchField as g } from "../Fields/SwitchField.js";
|
|
19
20
|
import { CheckboxField as h } from "../Fields/CheckboxField.js";
|
|
20
|
-
import { LabelField as
|
|
21
|
-
import { DividerField as
|
|
22
|
-
import { DividerWithLabelField as
|
|
21
|
+
import { LabelField as x } from "../Fields/LabelField.js";
|
|
22
|
+
import { DividerField as y } from "../Fields/DividerField.js";
|
|
23
|
+
import { DividerWithLabelField as v } from "../Fields/DividerWithLabelField.js";
|
|
23
24
|
import { NumericComboboxField as w } from "../Fields/NumericComboboxField.js";
|
|
24
25
|
import { SliderRangeField as P } from "../Fields/SliderRangeField.js";
|
|
25
26
|
import { YearPickerField as R } from "../Fields/YearPickerField.js";
|
|
26
|
-
import { MultiYearPickerField as
|
|
27
|
-
import { YearRangePickerField as
|
|
27
|
+
import { MultiYearPickerField as D } from "../Fields/MultiYearPickerField.js";
|
|
28
|
+
import { YearRangePickerField as M } from "../Fields/YearRangePickerField.js";
|
|
28
29
|
let i = !1;
|
|
29
|
-
function
|
|
30
|
-
i || (i = !0, e("divider",
|
|
30
|
+
function oe() {
|
|
31
|
+
i || (i = !0, e("divider", y), e("divider_with_label", v), e("label", x), e("select", r), e("button_group", o), e("radio", t), e("text", l), e("numeric_combobox", w), e("text_area", m), e("date", a), e("date_range", d), e("week_range", p), e("multi_week_picker", F), e("month_range", f), e("multi_month_picker", _), e("file_upload", n), e("fill_form_by_paste", c), e("fill_form_by_file_upload", u), e("chips", k), e("virtualized_list", s), e("text_with_backend_validation", b), e("switch", g), e("checkbox", h), e("slider_range", P), e("year_picker", R), e("multi_year_picker", D), e("year_range", M));
|
|
31
32
|
}
|
|
32
33
|
export {
|
|
33
|
-
|
|
34
|
+
oe as registerDefaultFieldTypes
|
|
34
35
|
};
|
|
@@ -488,6 +488,26 @@ export type ChipsField = BaseField & {
|
|
|
488
488
|
/** When true in single mode, re-clicking the active chip clears the selection. */
|
|
489
489
|
allowDeselect?: boolean;
|
|
490
490
|
};
|
|
491
|
+
/**
|
|
492
|
+
* Controlled multi/single select rendered with the virtualized list.
|
|
493
|
+
* Form state is a JSON array of selected option values (`string[]`).
|
|
494
|
+
*/
|
|
495
|
+
export type VirtualizedListField = BaseField & {
|
|
496
|
+
fieldType: "virtualized_list";
|
|
497
|
+
options: Array<Option>;
|
|
498
|
+
/** `multi` stores every selected value. `single` stores at most one. Default: multi. */
|
|
499
|
+
selectionMode?: "single" | "multi";
|
|
500
|
+
/** Selected option values when the form first mounts. */
|
|
501
|
+
defaultSelectedValues?: string[];
|
|
502
|
+
/** Row height in pixels. Default: 44. */
|
|
503
|
+
estimateSize?: number;
|
|
504
|
+
/** Scroll viewport height in pixels. Default: 240. */
|
|
505
|
+
viewportHeight?: number;
|
|
506
|
+
/** Fold search and choices behind the label, with the selection summary on the header. */
|
|
507
|
+
collapsible?: boolean;
|
|
508
|
+
/** Start folded. Ignored unless `collapsible` is set. */
|
|
509
|
+
defaultCollapsed?: boolean;
|
|
510
|
+
};
|
|
491
511
|
export type DividerField = BaseField & {
|
|
492
512
|
fieldType: "divider";
|
|
493
513
|
className?: string;
|
|
@@ -549,6 +569,6 @@ export type RichTextField = BaseField & {
|
|
|
549
569
|
/** Minimum editor height in px. Default: 150 */
|
|
550
570
|
minHeight?: number;
|
|
551
571
|
};
|
|
552
|
-
export type IField = FileUploadField | ButtonsGroupField | SelectField | DateInputField | DateRangeField | WeekRangeField | MonthRangeField | MultiMonthPickerField | TextAreaField | RadioField | TextField | NumericComboboxField | CopyPasteField | FillFormByFileUploadField | TextFieldWithBackendValidation | ChipsField | DividerField | DividerWithLabelField | LabelField | SwitchField | CheckboxField | YearPickerField | MultiYearPickerField | YearRangePickerField | MultiWeekRangeField | SliderRangeField | RichTextField | ObjectFieldConfig | ArrayFieldConfig;
|
|
572
|
+
export type IField = FileUploadField | ButtonsGroupField | SelectField | DateInputField | DateRangeField | WeekRangeField | MonthRangeField | MultiMonthPickerField | TextAreaField | RadioField | TextField | NumericComboboxField | CopyPasteField | FillFormByFileUploadField | TextFieldWithBackendValidation | ChipsField | VirtualizedListField | DividerField | DividerWithLabelField | LabelField | SwitchField | CheckboxField | YearPickerField | MultiYearPickerField | YearRangePickerField | MultiWeekRangeField | SliderRangeField | RichTextField | ObjectFieldConfig | ArrayFieldConfig;
|
|
553
573
|
/** Discriminant string union for every built-in field type */
|
|
554
574
|
export type FieldType = IField["fieldType"];
|