@reopt-ai/opt-ui 1.13.0 → 1.15.0
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/CHANGELOG.md +45 -0
- package/COMPONENT_CATALOG.md +644 -123
- package/README.md +35 -7
- package/dist/core/index.cjs +4 -4
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +2 -2
- package/dist/docs/02-components/01-core.md +261 -58
- package/dist/docs/02-components/02-visuals.md +1 -1
- package/dist/docs/02-components/03-shells.md +391 -65
- package/dist/docs/02-components/04-surfaces.md +1 -1
- package/dist/docs/02-components/index.md +4 -4
- package/dist/id-registry.cjs +32 -0
- package/dist/id-registry.js +32 -0
- package/dist/id-registry.json +68 -0
- package/dist/index.cjs +1196 -427
- package/dist/index.d.cts +208 -19
- package/dist/index.d.ts +208 -19
- package/dist/index.js +1050 -295
- package/dist/{key-pad-menu-DMmbQ1jF.js → key-pad-menu-BCOeYvsH.js} +59 -67
- package/dist/{key-pad-menu-BOVu97bj.d.cts → key-pad-menu-CaIsTHB2.d.cts} +22 -9
- package/dist/{key-pad-menu-0KWOnELe.cjs → key-pad-menu-Jaqxhx9P.cjs} +57 -77
- package/dist/{key-pad-menu-NlZ9zNF8.d.ts → key-pad-menu-odAEycIX.d.ts} +22 -9
- package/dist/meta.cjs +877 -26
- package/dist/meta.js +877 -26
- package/dist/{field-sidebar-CRdToHRO.js → replay-player-layout-BVUNsUS1.js} +904 -203
- package/dist/{field-sidebar-CxxSK4JO.cjs → replay-player-layout-Cmzptq89.cjs} +944 -201
- package/dist/{field-sidebar-D-rwuN_w.d.cts → replay-player-layout-DpqdfdQ6.d.ts} +246 -3
- package/dist/{field-sidebar-Dz7J4ett.d.ts → replay-player-layout-DuZW-gFF.d.cts} +246 -3
- package/dist/shells/index.cjs +58 -52
- package/dist/shells/index.d.cts +2 -2
- package/dist/shells/index.d.ts +2 -2
- package/dist/shells/index.js +2 -2
- package/dist/{text-truncate-Bd-0WkSP.js → text-truncate-B-8nJgnu.js} +200 -101
- package/dist/{text-truncate-eMzvU_7k.d.cts → text-truncate-DOxUijpB.d.cts} +3 -30
- package/dist/{text-truncate-eMzvU_7k.d.ts → text-truncate-DOxUijpB.d.ts} +3 -30
- package/dist/{text-truncate-BeYW6XZu.cjs → text-truncate-gQhpMy-Z.cjs} +214 -97
- package/dist/theme/server.d.cts +2 -2
- package/dist/theme/server.d.ts +2 -2
- package/package.json +2 -2
|
@@ -242,6 +242,47 @@ function useControlledState(defaultValue, controlledValue, onChange) {
|
|
|
242
242
|
}, [isControlled, onChange])];
|
|
243
243
|
}
|
|
244
244
|
//#endregion
|
|
245
|
+
//#region src/core/toggle.tsx
|
|
246
|
+
const _excluded$22 = [
|
|
247
|
+
"size",
|
|
248
|
+
"className",
|
|
249
|
+
"children"
|
|
250
|
+
];
|
|
251
|
+
const _excluded2$12 = [
|
|
252
|
+
"className",
|
|
253
|
+
"children",
|
|
254
|
+
"orientation"
|
|
255
|
+
];
|
|
256
|
+
const sizeStyles$7 = {
|
|
257
|
+
sm: "h-8 min-w-8 px-2 text-xs gap-1.5",
|
|
258
|
+
md: "h-10 min-w-10 px-3 text-sm gap-2"
|
|
259
|
+
};
|
|
260
|
+
const toggleBase = cn("inline-flex cursor-pointer items-center justify-center rounded-md border border-border bg-surface font-medium text-text-secondary", "hover:bg-bg-subtle hover:text-text-primary", "data-[pressed]:border-accent data-[pressed]:bg-accent-subtle data-[pressed]:text-accent", "disabled:pointer-events-none disabled:opacity-40", OPT_FOCUS_VISIBLE);
|
|
261
|
+
/** A two-state (pressed) button. Use standalone or inside `ToggleGroup`. */
|
|
262
|
+
function Toggle(_ref) {
|
|
263
|
+
let { size = "md", className, children } = _ref, props = _objectWithoutProperties(_ref, _excluded$22);
|
|
264
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.Toggle, _objectSpread2(_objectSpread2({ className: cn(toggleBase, sizeStyles$7[size], className) }, props), {}, {
|
|
265
|
+
"data-opt-id": "GFCMY",
|
|
266
|
+
"data-opt-slug": "toggle.Toggle",
|
|
267
|
+
children
|
|
268
|
+
}));
|
|
269
|
+
}
|
|
270
|
+
Toggle.displayName = "Toggle";
|
|
271
|
+
/** A set of related toggles with shared selection and keyboard navigation. */
|
|
272
|
+
function ToggleGroup(_ref2) {
|
|
273
|
+
let { className, children, orientation = "horizontal" } = _ref2, props = _objectWithoutProperties(_ref2, _excluded2$12);
|
|
274
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.ToggleGroup, _objectSpread2(_objectSpread2({
|
|
275
|
+
orientation,
|
|
276
|
+
"aria-orientation": orientation,
|
|
277
|
+
className: cn("inline-flex gap-1", orientation === "vertical" ? "flex-col" : "flex-row", className)
|
|
278
|
+
}, props), {}, {
|
|
279
|
+
"data-opt-id": "47J37",
|
|
280
|
+
"data-opt-slug": "toggle.ToggleGroup",
|
|
281
|
+
children
|
|
282
|
+
}));
|
|
283
|
+
}
|
|
284
|
+
ToggleGroup.displayName = "ToggleGroup";
|
|
285
|
+
//#endregion
|
|
245
286
|
//#region src/core/skeleton.tsx
|
|
246
287
|
const _excluded$21 = [
|
|
247
288
|
"variant",
|
|
@@ -1056,12 +1097,10 @@ function Tooltip(_ref5) {
|
|
|
1056
1097
|
}
|
|
1057
1098
|
//#endregion
|
|
1058
1099
|
//#region src/lib/use-input-id.ts
|
|
1059
|
-
/**
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
function useInputId(id, label, prefix) {
|
|
1064
|
-
return id !== null && id !== void 0 ? id : label ? `${prefix}-${label.replace(/\s+/g, "-").toLowerCase()}` : void 0;
|
|
1100
|
+
/** Generates an instance-specific, hydration-stable ID unless one is supplied. */
|
|
1101
|
+
function useInputId(id, _label, prefix) {
|
|
1102
|
+
const generatedId = (0, react.useId)();
|
|
1103
|
+
return id !== null && id !== void 0 ? id : `${prefix}-${generatedId}`;
|
|
1065
1104
|
}
|
|
1066
1105
|
//#endregion
|
|
1067
1106
|
//#region src/core/input.tsx
|
|
@@ -1370,6 +1409,7 @@ const Textarea = (0, react.forwardRef)((_ref, ref) => {
|
|
|
1370
1409
|
ref,
|
|
1371
1410
|
id: textareaId,
|
|
1372
1411
|
rows,
|
|
1412
|
+
required,
|
|
1373
1413
|
className: cn("border-border bg-surface text-text-primary placeholder:text-text-tertiary w-full rounded-lg border px-4 py-3 text-sm outline-transparent", OPT_FOCUS_VISIBLE, textareaSizeStyles[size], resizeStyles$1[resize], hasError && "border-danger focus-visible:outline-danger", !fullWidth && "w-auto", className),
|
|
1374
1414
|
"aria-invalid": hasError,
|
|
1375
1415
|
"aria-describedby": getDescribedBy(textareaId, error, hint)
|
|
@@ -2192,6 +2232,7 @@ function NumberInput({ value: controlledValue, defaultValue, onChange, nullable,
|
|
|
2192
2232
|
children: [
|
|
2193
2233
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2194
2234
|
type: "text",
|
|
2235
|
+
role: "spinbutton",
|
|
2195
2236
|
inputMode: "decimal",
|
|
2196
2237
|
id: inputId,
|
|
2197
2238
|
value: displayValue,
|
|
@@ -2205,6 +2246,10 @@ function NumberInput({ value: controlledValue, defaultValue, onChange, nullable,
|
|
|
2205
2246
|
"aria-label": (_ref2 = ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : label) !== null && _ref2 !== void 0 ? _ref2 : resolvedLabels.input,
|
|
2206
2247
|
"aria-invalid": hasError,
|
|
2207
2248
|
"aria-required": required,
|
|
2249
|
+
"aria-valuenow": value !== null && value !== void 0 ? value : void 0,
|
|
2250
|
+
"aria-valuemin": min,
|
|
2251
|
+
"aria-valuemax": max,
|
|
2252
|
+
"aria-valuetext": value === null ? "" : void 0,
|
|
2208
2253
|
"aria-describedby": getDescribedBy(inputId, effectiveError, hint),
|
|
2209
2254
|
min,
|
|
2210
2255
|
max,
|
|
@@ -2271,13 +2316,16 @@ function getSliderState(value, min, max, step) {
|
|
|
2271
2316
|
};
|
|
2272
2317
|
}
|
|
2273
2318
|
/** Renders the slider component. */
|
|
2274
|
-
function Slider({ value: controlledValue, defaultValue = 0, onChange, min = 0, max = 100, step = 1, label, showValue = false, formatValue, disabled = false, className, "aria-label": ariaLabel }) {
|
|
2319
|
+
function Slider({ value: controlledValue, defaultValue = 0, onChange, onValueCommit, min = 0, max = 100, step = 1, label, showValue = false, formatValue, disabled = false, className, "aria-label": ariaLabel }) {
|
|
2275
2320
|
var _ref;
|
|
2276
2321
|
const [localValue, setLocalValue] = (0, react.useState)(defaultValue);
|
|
2322
|
+
const pendingValue = (0, react.useRef)(null);
|
|
2323
|
+
const pointerStart = (0, react.useRef)(null);
|
|
2277
2324
|
const sliderState = getSliderState(controlledValue !== null && controlledValue !== void 0 ? controlledValue : localValue, min, max, step);
|
|
2278
2325
|
const handleChange = (0, react.useCallback)((e) => {
|
|
2279
2326
|
const next = getSliderState(parseFloat(e.target.value), min, max, step).value;
|
|
2280
2327
|
if (controlledValue === void 0) setLocalValue(next);
|
|
2328
|
+
pendingValue.current = next;
|
|
2281
2329
|
onChange === null || onChange === void 0 || onChange(next);
|
|
2282
2330
|
}, [
|
|
2283
2331
|
controlledValue,
|
|
@@ -2286,6 +2334,12 @@ function Slider({ value: controlledValue, defaultValue = 0, onChange, min = 0, m
|
|
|
2286
2334
|
step,
|
|
2287
2335
|
onChange
|
|
2288
2336
|
]);
|
|
2337
|
+
const commit = () => {
|
|
2338
|
+
const next = pendingValue.current;
|
|
2339
|
+
pendingValue.current = null;
|
|
2340
|
+
pointerStart.current = null;
|
|
2341
|
+
if (!disabled && next !== null) onValueCommit === null || onValueCommit === void 0 || onValueCommit(next);
|
|
2342
|
+
};
|
|
2289
2343
|
const displayValue = formatValue ? formatValue(sliderState.value) : String(sliderState.value);
|
|
2290
2344
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2291
2345
|
className: cn("flex flex-col gap-1.5", className),
|
|
@@ -2307,6 +2361,34 @@ function Slider({ value: controlledValue, defaultValue = 0, onChange, min = 0, m
|
|
|
2307
2361
|
step: sliderState.step,
|
|
2308
2362
|
value: sliderState.value,
|
|
2309
2363
|
onChange: handleChange,
|
|
2364
|
+
onPointerDown: (event) => {
|
|
2365
|
+
var _event$currentTarget$, _event$currentTarget;
|
|
2366
|
+
pointerStart.current = sliderState.value;
|
|
2367
|
+
(_event$currentTarget$ = (_event$currentTarget = event.currentTarget).setPointerCapture) === null || _event$currentTarget$ === void 0 || _event$currentTarget$.call(_event$currentTarget, event.pointerId);
|
|
2368
|
+
},
|
|
2369
|
+
onPointerUp: commit,
|
|
2370
|
+
onPointerCancel: () => {
|
|
2371
|
+
const previous = pointerStart.current;
|
|
2372
|
+
pendingValue.current = null;
|
|
2373
|
+
pointerStart.current = null;
|
|
2374
|
+
if (previous !== null && !disabled) {
|
|
2375
|
+
if (controlledValue === void 0) setLocalValue(previous);
|
|
2376
|
+
onChange === null || onChange === void 0 || onChange(previous);
|
|
2377
|
+
}
|
|
2378
|
+
},
|
|
2379
|
+
onKeyUp: (event) => {
|
|
2380
|
+
if ([
|
|
2381
|
+
"ArrowLeft",
|
|
2382
|
+
"ArrowRight",
|
|
2383
|
+
"ArrowUp",
|
|
2384
|
+
"ArrowDown",
|
|
2385
|
+
"Home",
|
|
2386
|
+
"End",
|
|
2387
|
+
"PageUp",
|
|
2388
|
+
"PageDown"
|
|
2389
|
+
].includes(event.key)) commit();
|
|
2390
|
+
},
|
|
2391
|
+
onBlur: commit,
|
|
2310
2392
|
disabled,
|
|
2311
2393
|
"aria-label": (_ref = ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : label) !== null && _ref !== void 0 ? _ref : "Slider",
|
|
2312
2394
|
"aria-valuemin": sliderState.min,
|
|
@@ -2812,6 +2894,12 @@ function IconPicker({ value, onChange, icons = DEFAULT_ICONS, label, required, e
|
|
|
2812
2894
|
}
|
|
2813
2895
|
IconPicker.displayName = "IconPicker";
|
|
2814
2896
|
//#endregion
|
|
2897
|
+
//#region src/lib/is-composing-key.ts
|
|
2898
|
+
/** Safari may report the composition-ending key with keyCode 229. */
|
|
2899
|
+
function isComposingKey(event) {
|
|
2900
|
+
return event.nativeEvent.isComposing || event.keyCode === 229;
|
|
2901
|
+
}
|
|
2902
|
+
//#endregion
|
|
2815
2903
|
//#region src/core/tag-input.tsx
|
|
2816
2904
|
const DEFAULT_DELIMITERS = [
|
|
2817
2905
|
",",
|
|
@@ -2823,7 +2911,7 @@ function splitByDelimiters(text, delimiters) {
|
|
|
2823
2911
|
return text.split(new RegExp(pattern)).map((s) => s.trim()).filter(Boolean);
|
|
2824
2912
|
}
|
|
2825
2913
|
const TagInput = (0, react.forwardRef)(({ value, onChange, placeholder = "Add tag...", label, required, error, hint, maxTags, disabled = false, className, id, "aria-label": ariaLabel, suggestions, delimiters = DEFAULT_DELIMITERS, allowDuplicates = false }, ref) => {
|
|
2826
|
-
var _useInputId, _ref, _ref2, _ref3
|
|
2914
|
+
var _useInputId, _ref, _ref2, _ref3;
|
|
2827
2915
|
const [tags, setTags] = useControlledState([], value, onChange);
|
|
2828
2916
|
const fallbackId = (0, react.useId)().replace(/:/g, "");
|
|
2829
2917
|
const tagInputId = (_useInputId = useInputId(id, label, "tag-input")) !== null && _useInputId !== void 0 ? _useInputId : `tag-input-${fallbackId}`;
|
|
@@ -2832,8 +2920,8 @@ const TagInput = (0, react.forwardRef)(({ value, onChange, placeholder = "Add ta
|
|
|
2832
2920
|
const [inputValue, setInputValue] = (0, react.useState)("");
|
|
2833
2921
|
const [highlightIndex, setHighlightIndex] = (0, react.useState)(-1);
|
|
2834
2922
|
const [showSuggestions, setShowSuggestions] = (0, react.useState)(false);
|
|
2835
|
-
const
|
|
2836
|
-
|
|
2923
|
+
const inputRef = (0, react.useRef)(null);
|
|
2924
|
+
(0, react.useImperativeHandle)(ref, () => inputRef.current);
|
|
2837
2925
|
const listboxRef = (0, react.useRef)(null);
|
|
2838
2926
|
const listboxId = (0, react.useId)();
|
|
2839
2927
|
const undoStack = (0, react.useRef)([]);
|
|
@@ -2856,11 +2944,12 @@ const TagInput = (0, react.forwardRef)(({ value, onChange, placeholder = "Add ta
|
|
|
2856
2944
|
setTags(next);
|
|
2857
2945
|
}, [tags, setTags]);
|
|
2858
2946
|
const filtered = suggestions && inputValue.trim() ? suggestions.filter((s) => s.toLowerCase().includes(inputValue.trim().toLowerCase()) && (allowDuplicates || !tags.includes(s))) : [];
|
|
2859
|
-
const isOpen = showSuggestions && filtered.length > 0;
|
|
2947
|
+
const isOpen = !disabled && showSuggestions && filtered.length > 0;
|
|
2860
2948
|
(0, react.useEffect)(() => {
|
|
2861
2949
|
setHighlightIndex(-1);
|
|
2862
2950
|
}, [inputValue]);
|
|
2863
2951
|
const addTag = (0, react.useCallback)((tag) => {
|
|
2952
|
+
if (disabled) return;
|
|
2864
2953
|
const trimmed = tag.trim();
|
|
2865
2954
|
if (!trimmed) return;
|
|
2866
2955
|
if (!allowDuplicates && tags.includes(trimmed)) return;
|
|
@@ -2873,13 +2962,20 @@ const TagInput = (0, react.forwardRef)(({ value, onChange, placeholder = "Add ta
|
|
|
2873
2962
|
tags,
|
|
2874
2963
|
setTags,
|
|
2875
2964
|
maxTags,
|
|
2876
|
-
allowDuplicates
|
|
2965
|
+
allowDuplicates,
|
|
2966
|
+
disabled
|
|
2877
2967
|
]);
|
|
2878
2968
|
const removeTag = (0, react.useCallback)((index) => {
|
|
2969
|
+
if (disabled) return;
|
|
2879
2970
|
pushUndo([...tags]);
|
|
2880
2971
|
setTags(tags.filter((_, i) => i !== index));
|
|
2881
|
-
}, [
|
|
2972
|
+
}, [
|
|
2973
|
+
tags,
|
|
2974
|
+
setTags,
|
|
2975
|
+
disabled
|
|
2976
|
+
]);
|
|
2882
2977
|
const handleTagKeyDown = (0, react.useCallback)((e, index) => {
|
|
2978
|
+
if (disabled || isComposingKey(e)) return;
|
|
2883
2979
|
if (e.key === "Backspace" || e.key === "Delete") {
|
|
2884
2980
|
e.preventDefault();
|
|
2885
2981
|
const nextTags = tags.filter((_, i) => i !== index);
|
|
@@ -2926,10 +3022,12 @@ const TagInput = (0, react.forwardRef)(({ value, onChange, placeholder = "Add ta
|
|
|
2926
3022
|
setTags,
|
|
2927
3023
|
undo,
|
|
2928
3024
|
redo,
|
|
2929
|
-
inputRef
|
|
3025
|
+
inputRef,
|
|
3026
|
+
disabled
|
|
2930
3027
|
]);
|
|
2931
3028
|
const handleInputKeyDown = (0, react.useCallback)((e) => {
|
|
2932
3029
|
var _inputRef$current5;
|
|
3030
|
+
if (disabled || isComposingKey(e)) return;
|
|
2933
3031
|
if ((e.ctrlKey || e.metaKey) && e.key === "z" && !e.shiftKey) {
|
|
2934
3032
|
e.preventDefault();
|
|
2935
3033
|
undo();
|
|
@@ -2981,9 +3079,11 @@ const TagInput = (0, react.forwardRef)(({ value, onChange, placeholder = "Add ta
|
|
|
2981
3079
|
filtered,
|
|
2982
3080
|
undo,
|
|
2983
3081
|
redo,
|
|
2984
|
-
inputRef
|
|
3082
|
+
inputRef,
|
|
3083
|
+
disabled
|
|
2985
3084
|
]);
|
|
2986
3085
|
const handlePaste = (0, react.useCallback)((e) => {
|
|
3086
|
+
if (disabled) return;
|
|
2987
3087
|
const parts = splitByDelimiters(e.clipboardData.getData("text/plain"), delimiters);
|
|
2988
3088
|
if (parts.length < 2) return;
|
|
2989
3089
|
e.preventDefault();
|
|
@@ -3004,7 +3104,8 @@ const TagInput = (0, react.forwardRef)(({ value, onChange, placeholder = "Add ta
|
|
|
3004
3104
|
setTags,
|
|
3005
3105
|
maxTags,
|
|
3006
3106
|
delimiters,
|
|
3007
|
-
allowDuplicates
|
|
3107
|
+
allowDuplicates,
|
|
3108
|
+
disabled
|
|
3008
3109
|
]);
|
|
3009
3110
|
(0, react.useEffect)(() => {
|
|
3010
3111
|
if (highlightIndex >= 0 && listboxRef.current) {
|
|
@@ -3019,7 +3120,8 @@ const TagInput = (0, react.forwardRef)(({ value, onChange, placeholder = "Add ta
|
|
|
3019
3120
|
"data-opt-id": "3TDWF",
|
|
3020
3121
|
"data-opt-slug": "tag-input.TagInput",
|
|
3021
3122
|
children: [
|
|
3022
|
-
label && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("
|
|
3123
|
+
label && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
3124
|
+
htmlFor: tagInputId,
|
|
3023
3125
|
className: "text-sm font-medium text-text-primary",
|
|
3024
3126
|
children: [label, required && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RequiredMark, {})]
|
|
3025
3127
|
}),
|
|
@@ -3030,7 +3132,7 @@ const TagInput = (0, react.forwardRef)(({ value, onChange, placeholder = "Add ta
|
|
|
3030
3132
|
return (_inputRef$current6 = inputRef.current) === null || _inputRef$current6 === void 0 ? void 0 : _inputRef$current6.focus();
|
|
3031
3133
|
},
|
|
3032
3134
|
role: "group",
|
|
3033
|
-
"aria-label": (
|
|
3135
|
+
"aria-label": (_ref = ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : label) !== null && _ref !== void 0 ? _ref : "Tag input",
|
|
3034
3136
|
"aria-required": required,
|
|
3035
3137
|
"aria-invalid": hasError,
|
|
3036
3138
|
"aria-describedby": describedBy,
|
|
@@ -3040,6 +3142,7 @@ const TagInput = (0, react.forwardRef)(({ value, onChange, placeholder = "Add ta
|
|
|
3040
3142
|
"aria-label": "Selected tags",
|
|
3041
3143
|
className: "contents",
|
|
3042
3144
|
children: tags.map((tag, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_reopt_ai_opt_ui_primitives.CompositeItem, {
|
|
3145
|
+
disabled,
|
|
3043
3146
|
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { ref: (el) => {
|
|
3044
3147
|
if (el) tagRefs.current.set(i, el);
|
|
3045
3148
|
else tagRefs.current.delete(i);
|
|
@@ -3072,6 +3175,7 @@ const TagInput = (0, react.forwardRef)(({ value, onChange, placeholder = "Add ta
|
|
|
3072
3175
|
})
|
|
3073
3176
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
3074
3177
|
ref: inputRef,
|
|
3178
|
+
id: tagInputId,
|
|
3075
3179
|
type: "text",
|
|
3076
3180
|
value: inputValue,
|
|
3077
3181
|
onChange: (e) => {
|
|
@@ -3087,7 +3191,7 @@ const TagInput = (0, react.forwardRef)(({ value, onChange, placeholder = "Add ta
|
|
|
3087
3191
|
placeholder: tags.length === 0 ? placeholder : atLimit ? "" : "",
|
|
3088
3192
|
disabled: disabled || atLimit,
|
|
3089
3193
|
className: cn("min-w-[60px] flex-1 border-none bg-transparent text-sm outline-transparent", OPT_TEXT_PRIMARY, OPT_FOCUS_VISIBLE, "placeholder:text-text-tertiary"),
|
|
3090
|
-
"aria-label": (
|
|
3194
|
+
"aria-label": (_ref2 = ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : label) !== null && _ref2 !== void 0 ? _ref2 : "Tag input",
|
|
3091
3195
|
role: suggestions ? "combobox" : void 0,
|
|
3092
3196
|
"aria-describedby": describedBy,
|
|
3093
3197
|
"aria-expanded": suggestions ? isOpen : void 0,
|
|
@@ -3100,7 +3204,7 @@ const TagInput = (0, react.forwardRef)(({ value, onChange, placeholder = "Add ta
|
|
|
3100
3204
|
ref: listboxRef,
|
|
3101
3205
|
id: listboxId,
|
|
3102
3206
|
role: "listbox",
|
|
3103
|
-
"aria-label": (
|
|
3207
|
+
"aria-label": (_ref3 = ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : label) !== null && _ref3 !== void 0 ? _ref3 : "Tag suggestions",
|
|
3104
3208
|
className: "border-border bg-surface absolute top-full z-50 mt-1 max-h-48 w-full overflow-auto rounded-lg border shadow-md",
|
|
3105
3209
|
children: filtered.map((suggestion, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
|
|
3106
3210
|
id: `${listboxId}-${i}`,
|
|
@@ -3726,30 +3830,22 @@ const resizeStyles = {
|
|
|
3726
3830
|
};
|
|
3727
3831
|
/** Renders the form textarea component. */
|
|
3728
3832
|
function FormTextarea(_ref3) {
|
|
3729
|
-
var _ref4;
|
|
3730
3833
|
let { className, resize = "vertical", rows = 4, name } = _ref3, props = _objectWithoutProperties(_ref3, _excluded3$2);
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
const error = form === null || form === void 0 ? void 0 : form.getError(name);
|
|
3734
|
-
const touched = form === null || form === void 0 ? void 0 : form.getFieldTouched(name);
|
|
3735
|
-
const hasError = Boolean(error && touched);
|
|
3736
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", _objectSpread2(_objectSpread2({
|
|
3834
|
+
useRequiredFormContext("FormTextarea");
|
|
3835
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.FormTextarea, _objectSpread2(_objectSpread2({
|
|
3737
3836
|
name,
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
className: cn("border-border bg-surface flex w-full rounded-lg border px-4 py-3", "text-text-primary placeholder:text-text-tertiary focus-visible:ring-ring focus-visible:ring-offset-ring-offset text-sm outline-none focus-visible:ring-2 focus-visible:ring-offset-1", OPT_FOCUS_VISIBLE, resizeStyles[resize], hasError && "border-danger", className),
|
|
3741
|
-
rows,
|
|
3742
|
-
"aria-invalid": hasError || void 0
|
|
3837
|
+
className: cn("border-border bg-surface flex w-full rounded-lg border px-4 py-3", "text-text-primary placeholder:text-text-tertiary focus-visible:ring-ring focus-visible:ring-offset-ring-offset text-sm outline-none focus-visible:ring-2 focus-visible:ring-offset-1", OPT_FOCUS_VISIBLE, resizeStyles[resize], "aria-[invalid=true]:border-danger", className),
|
|
3838
|
+
rows
|
|
3743
3839
|
}, props), {}, {
|
|
3744
3840
|
"data-opt-id": "Q8G2A",
|
|
3745
3841
|
"data-opt-slug": "form.FormTextarea"
|
|
3746
3842
|
}));
|
|
3747
3843
|
}
|
|
3748
3844
|
/** Renders the form select component. */
|
|
3749
|
-
function FormSelect({ name, children, className, placeholder, minWidth = 140, "aria-label": ariaLabel }) {
|
|
3750
|
-
var
|
|
3845
|
+
function FormSelect({ name, id, children, className, placeholder, minWidth = 140, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy }) {
|
|
3846
|
+
var _ref4;
|
|
3751
3847
|
const form = useRequiredFormContext("FormSelect");
|
|
3752
|
-
const value = (
|
|
3848
|
+
const value = (_ref4 = (0, _reopt_ai_opt_ui_primitives.useFieldValue)(form, name)) !== null && _ref4 !== void 0 ? _ref4 : "";
|
|
3753
3849
|
const error = form === null || form === void 0 ? void 0 : form.getError(name);
|
|
3754
3850
|
const touched = form === null || form === void 0 ? void 0 : form.getFieldTouched(name);
|
|
3755
3851
|
const hasError = Boolean(error && touched);
|
|
@@ -3763,7 +3859,10 @@ function FormSelect({ name, children, className, placeholder, minWidth = 140, "a
|
|
|
3763
3859
|
"data-opt-id": "A2XF7",
|
|
3764
3860
|
"data-opt-slug": "form.FormSelect",
|
|
3765
3861
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectTrigger, {
|
|
3862
|
+
id,
|
|
3766
3863
|
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : name,
|
|
3864
|
+
"aria-describedby": ariaDescribedBy,
|
|
3865
|
+
onBlur: () => form.setFieldTouched(name, true),
|
|
3767
3866
|
"aria-invalid": hasError || void 0,
|
|
3768
3867
|
className: cn("inline-flex cursor-pointer items-center justify-between data-[disabled]:cursor-not-allowed", hasError && "border-danger", className),
|
|
3769
3868
|
style: { minWidth: typeof minWidth === "number" ? `${minWidth}px` : minWidth },
|
|
@@ -3772,16 +3871,16 @@ function FormSelect({ name, children, className, placeholder, minWidth = 140, "a
|
|
|
3772
3871
|
});
|
|
3773
3872
|
}
|
|
3774
3873
|
/** Renders the form select popover component. */
|
|
3775
|
-
function FormSelectPopover(
|
|
3776
|
-
let { className } =
|
|
3874
|
+
function FormSelectPopover(_ref5) {
|
|
3875
|
+
let { className } = _ref5, props = _objectWithoutProperties(_ref5, _excluded4$1);
|
|
3777
3876
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectPopover, _objectSpread2(_objectSpread2({ className: cn(OPT_SURFACE_POPOVER, OPT_ANIMATE_ENTER_EXIT, "z-[120]", className) }, props), {}, {
|
|
3778
3877
|
"data-opt-id": "CQSPJ",
|
|
3779
3878
|
"data-opt-slug": "form.FormSelectPopover"
|
|
3780
3879
|
}));
|
|
3781
3880
|
}
|
|
3782
3881
|
/** Renders the form select item component. */
|
|
3783
|
-
function FormSelectItem(
|
|
3784
|
-
let { className } =
|
|
3882
|
+
function FormSelectItem(_ref6) {
|
|
3883
|
+
let { className } = _ref6, props = _objectWithoutProperties(_ref6, _excluded5);
|
|
3785
3884
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectItem, _objectSpread2(_objectSpread2({ className: cn("flex cursor-pointer items-center gap-2 data-[disabled]:cursor-not-allowed", OPT_ITEM_BASE, OPT_ACTIVE_ITEM, className) }, props), {}, {
|
|
3786
3885
|
"data-opt-id": "J3970",
|
|
3787
3886
|
"data-opt-slug": "form.FormSelectItem"
|
|
@@ -3802,8 +3901,8 @@ const switchSizeStyles = {
|
|
|
3802
3901
|
}
|
|
3803
3902
|
};
|
|
3804
3903
|
/** Renders the form switch component. */
|
|
3805
|
-
function FormSwitch(
|
|
3806
|
-
let { className, size = "md", name } =
|
|
3904
|
+
function FormSwitch(_ref7) {
|
|
3905
|
+
let { className, size = "md", name } = _ref7, props = _objectWithoutProperties(_ref7, _excluded6);
|
|
3807
3906
|
const styles = switchSizeStyles[size];
|
|
3808
3907
|
const form = useRequiredFormContext("FormSwitch");
|
|
3809
3908
|
const checked = Boolean((0, _reopt_ai_opt_ui_primitives.useFieldValue)(form, name));
|
|
@@ -3818,25 +3917,25 @@ function FormSwitch(_ref8) {
|
|
|
3818
3917
|
}));
|
|
3819
3918
|
}
|
|
3820
3919
|
/** Renders the form label component. */
|
|
3821
|
-
function FormLabel(
|
|
3822
|
-
let { className } =
|
|
3920
|
+
function FormLabel(_ref8) {
|
|
3921
|
+
let { className } = _ref8, props = _objectWithoutProperties(_ref8, _excluded7);
|
|
3823
3922
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.FormLabel, _objectSpread2(_objectSpread2({ className: cn(labelClass, className) }, props), {}, {
|
|
3824
3923
|
"data-opt-id": "JHRKM",
|
|
3825
3924
|
"data-opt-slug": "form.FormLabel"
|
|
3826
3925
|
}));
|
|
3827
3926
|
}
|
|
3828
3927
|
/** Renders the form error component. */
|
|
3829
|
-
function FormError(
|
|
3830
|
-
let { className } =
|
|
3928
|
+
function FormError(_ref9) {
|
|
3929
|
+
let { className } = _ref9, props = _objectWithoutProperties(_ref9, _excluded8);
|
|
3831
3930
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.FormError, _objectSpread2(_objectSpread2({ className: cn(errorClass, className) }, props), {}, {
|
|
3832
3931
|
"data-opt-id": "E9NM4",
|
|
3833
3932
|
"data-opt-slug": "form.FormError"
|
|
3834
3933
|
}));
|
|
3835
3934
|
}
|
|
3836
3935
|
/** Renders the form submit component. */
|
|
3837
|
-
function FormSubmit(
|
|
3936
|
+
function FormSubmit(_ref10) {
|
|
3838
3937
|
var _form$isSubmitting;
|
|
3839
|
-
let { className, disabled, children } =
|
|
3938
|
+
let { className, disabled, children } = _ref10, props = _objectWithoutProperties(_ref10, _excluded9);
|
|
3840
3939
|
const form = (0, _reopt_ai_opt_ui_primitives.useFormContext)();
|
|
3841
3940
|
const isSubmitting = (_form$isSubmitting = form === null || form === void 0 ? void 0 : form.isSubmitting()) !== null && _form$isSubmitting !== void 0 ? _form$isSubmitting : false;
|
|
3842
3941
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.FormSubmit, _objectSpread2(_objectSpread2({
|
|
@@ -3856,99 +3955,99 @@ function FormProvider(props) {
|
|
|
3856
3955
|
}));
|
|
3857
3956
|
}
|
|
3858
3957
|
/** Renders the form group component. */
|
|
3859
|
-
function FormGroup(
|
|
3860
|
-
let { className } =
|
|
3958
|
+
function FormGroup(_ref11) {
|
|
3959
|
+
let { className } = _ref11, props = _objectWithoutProperties(_ref11, _excluded10);
|
|
3861
3960
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.FormGroup, _objectSpread2(_objectSpread2({ className: cn("gap-group flex flex-col", className) }, props), {}, {
|
|
3862
3961
|
"data-opt-id": "89E8Q",
|
|
3863
3962
|
"data-opt-slug": "form.FormGroup"
|
|
3864
3963
|
}));
|
|
3865
3964
|
}
|
|
3866
3965
|
/** Renders the form group label component. */
|
|
3867
|
-
function FormGroupLabel(
|
|
3868
|
-
let { className } =
|
|
3966
|
+
function FormGroupLabel(_ref12) {
|
|
3967
|
+
let { className } = _ref12, props = _objectWithoutProperties(_ref12, _excluded11);
|
|
3869
3968
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.FormGroupLabel, _objectSpread2(_objectSpread2({ className: cn(labelClass, "font-semibold", className) }, props), {}, {
|
|
3870
3969
|
"data-opt-id": "W95BH",
|
|
3871
3970
|
"data-opt-slug": "form.FormGroupLabel"
|
|
3872
3971
|
}));
|
|
3873
3972
|
}
|
|
3874
3973
|
/** Renders the form description component. */
|
|
3875
|
-
function FormDescription(
|
|
3876
|
-
let { className } =
|
|
3974
|
+
function FormDescription(_ref13) {
|
|
3975
|
+
let { className } = _ref13, props = _objectWithoutProperties(_ref13, _excluded12);
|
|
3877
3976
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.FormDescription, _objectSpread2(_objectSpread2({ className: cn(descriptionClass, className) }, props), {}, {
|
|
3878
3977
|
"data-opt-id": "RFB40",
|
|
3879
3978
|
"data-opt-slug": "form.FormDescription"
|
|
3880
3979
|
}));
|
|
3881
3980
|
}
|
|
3882
3981
|
/** Renders the form field component. */
|
|
3883
|
-
function FormField(
|
|
3884
|
-
let { className } =
|
|
3982
|
+
function FormField(_ref14) {
|
|
3983
|
+
let { className } = _ref14, props = _objectWithoutProperties(_ref14, _excluded13);
|
|
3885
3984
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.FormField, _objectSpread2(_objectSpread2({ className: cn("gap-element flex flex-col", className) }, props), {}, {
|
|
3886
3985
|
"data-opt-id": "C68GP",
|
|
3887
3986
|
"data-opt-slug": "form.FormField"
|
|
3888
3987
|
}));
|
|
3889
3988
|
}
|
|
3890
3989
|
/** Renders the form control component. */
|
|
3891
|
-
function FormControl(
|
|
3892
|
-
let { className } =
|
|
3990
|
+
function FormControl(_ref15) {
|
|
3991
|
+
let { className } = _ref15, props = _objectWithoutProperties(_ref15, _excluded14);
|
|
3893
3992
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.FormControl, _objectSpread2(_objectSpread2({ className: cn(inputClass, className) }, props), {}, {
|
|
3894
3993
|
"data-opt-id": "XNF0F",
|
|
3895
3994
|
"data-opt-slug": "form.FormControl"
|
|
3896
3995
|
}));
|
|
3897
3996
|
}
|
|
3898
3997
|
/** Renders the form push component. */
|
|
3899
|
-
function FormPush(
|
|
3900
|
-
let { className } =
|
|
3998
|
+
function FormPush(_ref16) {
|
|
3999
|
+
let { className } = _ref16, props = _objectWithoutProperties(_ref16, _excluded15);
|
|
3901
4000
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.FormPush, _objectSpread2(_objectSpread2({ className: cn(OPT_BUTTON_SECONDARY, className) }, props), {}, {
|
|
3902
4001
|
"data-opt-id": "5SV8S",
|
|
3903
4002
|
"data-opt-slug": "form.FormPush"
|
|
3904
4003
|
}));
|
|
3905
4004
|
}
|
|
3906
4005
|
/** Renders the form remove component. */
|
|
3907
|
-
function FormRemove(
|
|
3908
|
-
let { className } =
|
|
4006
|
+
function FormRemove(_ref17) {
|
|
4007
|
+
let { className } = _ref17, props = _objectWithoutProperties(_ref17, _excluded16);
|
|
3909
4008
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.FormRemove, _objectSpread2(_objectSpread2({ className: cn("text-danger-fg hover:text-danger focus-visible:ring-ring focus-visible:ring-offset-ring-offset inline-flex items-center text-sm outline-none focus-visible:ring-2 focus-visible:ring-offset-1", OPT_FOCUS_VISIBLE, className) }, props), {}, {
|
|
3910
4009
|
"data-opt-id": "FEW6V",
|
|
3911
4010
|
"data-opt-slug": "form.FormRemove"
|
|
3912
4011
|
}));
|
|
3913
4012
|
}
|
|
3914
4013
|
/** Renders the form reset component. */
|
|
3915
|
-
function FormReset(
|
|
3916
|
-
let { className } =
|
|
4014
|
+
function FormReset(_ref18) {
|
|
4015
|
+
let { className } = _ref18, props = _objectWithoutProperties(_ref18, _excluded17);
|
|
3917
4016
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.FormReset, _objectSpread2(_objectSpread2({ className: cn(OPT_BUTTON_SECONDARY, className) }, props), {}, {
|
|
3918
4017
|
"data-opt-id": "M3FVB",
|
|
3919
4018
|
"data-opt-slug": "form.FormReset"
|
|
3920
4019
|
}));
|
|
3921
4020
|
}
|
|
3922
4021
|
/** Renders the form checkbox component. */
|
|
3923
|
-
function FormCheckbox(
|
|
3924
|
-
let { className } =
|
|
4022
|
+
function FormCheckbox(_ref19) {
|
|
4023
|
+
let { className } = _ref19, props = _objectWithoutProperties(_ref19, _excluded18);
|
|
3925
4024
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.FormCheckbox, _objectSpread2(_objectSpread2({ className: cn(checkboxClass, className) }, props), {}, {
|
|
3926
4025
|
"data-opt-id": "3BZS1",
|
|
3927
4026
|
"data-opt-slug": "form.FormCheckbox"
|
|
3928
4027
|
}));
|
|
3929
4028
|
}
|
|
3930
4029
|
/** Renders the form radio group component. */
|
|
3931
|
-
function FormRadioGroup(
|
|
3932
|
-
let { className } =
|
|
4030
|
+
function FormRadioGroup(_ref20) {
|
|
4031
|
+
let { className } = _ref20, props = _objectWithoutProperties(_ref20, _excluded19);
|
|
3933
4032
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.FormRadioGroup, _objectSpread2(_objectSpread2({ className: cn("gap-group flex flex-col", className) }, props), {}, {
|
|
3934
4033
|
"data-opt-id": "J8XRP",
|
|
3935
4034
|
"data-opt-slug": "form.FormRadioGroup"
|
|
3936
4035
|
}));
|
|
3937
4036
|
}
|
|
3938
4037
|
/** Renders the form radio component. */
|
|
3939
|
-
function FormRadio(
|
|
3940
|
-
let { className } =
|
|
4038
|
+
function FormRadio(_ref21) {
|
|
4039
|
+
let { className } = _ref21, props = _objectWithoutProperties(_ref21, _excluded20);
|
|
3941
4040
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_reopt_ai_opt_ui_primitives.FormRadio, _objectSpread2(_objectSpread2({ className: cn(radioClass, className) }, props), {}, {
|
|
3942
4041
|
"data-opt-id": "YTN4Q",
|
|
3943
4042
|
"data-opt-slug": "form.FormRadio"
|
|
3944
4043
|
}));
|
|
3945
4044
|
}
|
|
3946
4045
|
/** Renders the form number input component. */
|
|
3947
|
-
function FormNumberInput(
|
|
3948
|
-
var
|
|
3949
|
-
let { name } =
|
|
4046
|
+
function FormNumberInput(_ref22) {
|
|
4047
|
+
var _ref23;
|
|
4048
|
+
let { name } = _ref22, props = _objectWithoutProperties(_ref22, _excluded21);
|
|
3950
4049
|
const form = useRequiredFormContext("FormNumberInput");
|
|
3951
|
-
const value = (
|
|
4050
|
+
const value = (_ref23 = (0, _reopt_ai_opt_ui_primitives.useFieldValue)(form, name)) !== null && _ref23 !== void 0 ? _ref23 : 0;
|
|
3952
4051
|
const error = form === null || form === void 0 ? void 0 : form.getError(name);
|
|
3953
4052
|
const touched = form === null || form === void 0 ? void 0 : form.getFieldTouched(name);
|
|
3954
4053
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberInput, _objectSpread2(_objectSpread2({
|
|
@@ -3961,11 +4060,11 @@ function FormNumberInput(_ref23) {
|
|
|
3961
4060
|
}));
|
|
3962
4061
|
}
|
|
3963
4062
|
/** Renders the form slider component. */
|
|
3964
|
-
function FormSlider(
|
|
3965
|
-
var
|
|
3966
|
-
let { name } =
|
|
4063
|
+
function FormSlider(_ref24) {
|
|
4064
|
+
var _ref25;
|
|
4065
|
+
let { name } = _ref24, props = _objectWithoutProperties(_ref24, _excluded22);
|
|
3967
4066
|
const form = useRequiredFormContext("FormSlider");
|
|
3968
|
-
const value = (
|
|
4067
|
+
const value = (_ref25 = (0, _reopt_ai_opt_ui_primitives.useFieldValue)(form, name)) !== null && _ref25 !== void 0 ? _ref25 : 0;
|
|
3969
4068
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Slider, _objectSpread2(_objectSpread2({
|
|
3970
4069
|
value,
|
|
3971
4070
|
onChange: (v) => form.setValue(name, v)
|
|
@@ -3975,11 +4074,11 @@ function FormSlider(_ref25) {
|
|
|
3975
4074
|
}));
|
|
3976
4075
|
}
|
|
3977
4076
|
/** Renders the form star rating component. */
|
|
3978
|
-
function FormStarRating(
|
|
3979
|
-
var
|
|
3980
|
-
let { name } =
|
|
4077
|
+
function FormStarRating(_ref26) {
|
|
4078
|
+
var _ref27;
|
|
4079
|
+
let { name } = _ref26, props = _objectWithoutProperties(_ref26, _excluded23);
|
|
3981
4080
|
const form = useRequiredFormContext("FormStarRating");
|
|
3982
|
-
const value = (
|
|
4081
|
+
const value = (_ref27 = (0, _reopt_ai_opt_ui_primitives.useFieldValue)(form, name)) !== null && _ref27 !== void 0 ? _ref27 : 0;
|
|
3983
4082
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StarRating, _objectSpread2(_objectSpread2({
|
|
3984
4083
|
value,
|
|
3985
4084
|
onChange: (v) => form.setValue(name, v)
|
|
@@ -3989,11 +4088,11 @@ function FormStarRating(_ref27) {
|
|
|
3989
4088
|
}));
|
|
3990
4089
|
}
|
|
3991
4090
|
/** Renders the form color picker component. */
|
|
3992
|
-
function FormColorPicker(
|
|
3993
|
-
var
|
|
3994
|
-
let { name } =
|
|
4091
|
+
function FormColorPicker(_ref28) {
|
|
4092
|
+
var _ref29;
|
|
4093
|
+
let { name } = _ref28, props = _objectWithoutProperties(_ref28, _excluded24);
|
|
3995
4094
|
const form = useRequiredFormContext("FormColorPicker");
|
|
3996
|
-
const value = (
|
|
4095
|
+
const value = (_ref29 = (0, _reopt_ai_opt_ui_primitives.useFieldValue)(form, name)) !== null && _ref29 !== void 0 ? _ref29 : "#000000";
|
|
3997
4096
|
const error = form === null || form === void 0 ? void 0 : form.getError(name);
|
|
3998
4097
|
const touched = form === null || form === void 0 ? void 0 : form.getFieldTouched(name);
|
|
3999
4098
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ColorPicker, _objectSpread2(_objectSpread2({
|
|
@@ -4006,11 +4105,11 @@ function FormColorPicker(_ref29) {
|
|
|
4006
4105
|
}));
|
|
4007
4106
|
}
|
|
4008
4107
|
/** Renders the form icon picker component. */
|
|
4009
|
-
function FormIconPicker(
|
|
4010
|
-
var
|
|
4011
|
-
let { name } =
|
|
4108
|
+
function FormIconPicker(_ref30) {
|
|
4109
|
+
var _ref31;
|
|
4110
|
+
let { name } = _ref30, props = _objectWithoutProperties(_ref30, _excluded25);
|
|
4012
4111
|
const form = useRequiredFormContext("FormIconPicker");
|
|
4013
|
-
const value = (
|
|
4112
|
+
const value = (_ref31 = (0, _reopt_ai_opt_ui_primitives.useFieldValue)(form, name)) !== null && _ref31 !== void 0 ? _ref31 : "";
|
|
4014
4113
|
const error = form === null || form === void 0 ? void 0 : form.getError(name);
|
|
4015
4114
|
const touched = form === null || form === void 0 ? void 0 : form.getFieldTouched(name);
|
|
4016
4115
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconPicker, _objectSpread2(_objectSpread2({
|
|
@@ -4023,11 +4122,11 @@ function FormIconPicker(_ref31) {
|
|
|
4023
4122
|
}));
|
|
4024
4123
|
}
|
|
4025
4124
|
/** Renders the form tag input component. */
|
|
4026
|
-
function FormTagInput(
|
|
4027
|
-
var
|
|
4028
|
-
let { name } =
|
|
4125
|
+
function FormTagInput(_ref32) {
|
|
4126
|
+
var _ref33;
|
|
4127
|
+
let { name } = _ref32, props = _objectWithoutProperties(_ref32, _excluded26);
|
|
4029
4128
|
const form = useRequiredFormContext("FormTagInput");
|
|
4030
|
-
const value = (
|
|
4129
|
+
const value = (_ref33 = (0, _reopt_ai_opt_ui_primitives.useFieldValue)(form, name)) !== null && _ref33 !== void 0 ? _ref33 : [];
|
|
4031
4130
|
const error = form === null || form === void 0 ? void 0 : form.getError(name);
|
|
4032
4131
|
const touched = form === null || form === void 0 ? void 0 : form.getFieldTouched(name);
|
|
4033
4132
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TagInput, _objectSpread2(_objectSpread2({
|
|
@@ -4040,11 +4139,11 @@ function FormTagInput(_ref33) {
|
|
|
4040
4139
|
}));
|
|
4041
4140
|
}
|
|
4042
4141
|
/** Renders the form date range picker component. */
|
|
4043
|
-
function FormDateRangePicker(
|
|
4044
|
-
var
|
|
4045
|
-
let { name } =
|
|
4142
|
+
function FormDateRangePicker(_ref34) {
|
|
4143
|
+
var _ref35;
|
|
4144
|
+
let { name } = _ref34, props = _objectWithoutProperties(_ref34, _excluded27);
|
|
4046
4145
|
const form = useRequiredFormContext("FormDateRangePicker");
|
|
4047
|
-
const value = (
|
|
4146
|
+
const value = (_ref35 = (0, _reopt_ai_opt_ui_primitives.useFieldValue)(form, name)) !== null && _ref35 !== void 0 ? _ref35 : {
|
|
4048
4147
|
start: null,
|
|
4049
4148
|
end: null
|
|
4050
4149
|
};
|
|
@@ -5865,6 +5964,18 @@ Object.defineProperty(exports, "Textarea", {
|
|
|
5865
5964
|
return Textarea;
|
|
5866
5965
|
}
|
|
5867
5966
|
});
|
|
5967
|
+
Object.defineProperty(exports, "Toggle", {
|
|
5968
|
+
enumerable: true,
|
|
5969
|
+
get: function() {
|
|
5970
|
+
return Toggle;
|
|
5971
|
+
}
|
|
5972
|
+
});
|
|
5973
|
+
Object.defineProperty(exports, "ToggleGroup", {
|
|
5974
|
+
enumerable: true,
|
|
5975
|
+
get: function() {
|
|
5976
|
+
return ToggleGroup;
|
|
5977
|
+
}
|
|
5978
|
+
});
|
|
5868
5979
|
Object.defineProperty(exports, "ToolbarButton", {
|
|
5869
5980
|
enumerable: true,
|
|
5870
5981
|
get: function() {
|
|
@@ -5967,6 +6078,12 @@ Object.defineProperty(exports, "getIconRegistryEntry", {
|
|
|
5967
6078
|
return getIconRegistryEntry;
|
|
5968
6079
|
}
|
|
5969
6080
|
});
|
|
6081
|
+
Object.defineProperty(exports, "isComposingKey", {
|
|
6082
|
+
enumerable: true,
|
|
6083
|
+
get: function() {
|
|
6084
|
+
return isComposingKey;
|
|
6085
|
+
}
|
|
6086
|
+
});
|
|
5970
6087
|
Object.defineProperty(exports, "koBreadcrumbLabels", {
|
|
5971
6088
|
enumerable: true,
|
|
5972
6089
|
get: function() {
|