myoperator-ui 0.0.217 → 0.0.218-beta.1
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.js +715 -1610
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -118,7 +118,6 @@ function transformSemanticClassesInContent(content) {
|
|
|
118
118
|
const cnRegex = /\bcn\s*\(/g;
|
|
119
119
|
let cnMatch;
|
|
120
120
|
while ((cnMatch = cnRegex.exec(content)) !== null) {
|
|
121
|
-
if (cnMatch.index < lastIndex) continue;
|
|
122
121
|
result += content.slice(lastIndex, cnMatch.index);
|
|
123
122
|
let depth = 1;
|
|
124
123
|
let i = cnMatch.index + cnMatch[0].length;
|
|
@@ -267,10 +266,8 @@ function looksLikeTailwindClasses(str) {
|
|
|
267
266
|
return false;
|
|
268
267
|
});
|
|
269
268
|
}
|
|
270
|
-
var BORDER_WIDTH_RE = /^border(-[trblxy])?(-[0248]|-\[.+\])?$/;
|
|
271
|
-
var BORDER_STYLE_RE = /^border-(solid|dashed|dotted|double|hidden|none)$/;
|
|
272
269
|
function prefixClassString(classString, prefix) {
|
|
273
|
-
|
|
270
|
+
return classString.split(" ").map((cls) => {
|
|
274
271
|
if (!cls) return cls;
|
|
275
272
|
if ((cls.startsWith("aria-") || cls.startsWith("data-")) && !cls.includes("[") && !cls.includes(":")) return cls;
|
|
276
273
|
if (cls.startsWith("[&") || cls.startsWith("[&_")) {
|
|
@@ -320,14 +317,7 @@ function prefixClassString(classString, prefix) {
|
|
|
320
317
|
return `-${prefix}${cls.slice(1)}`;
|
|
321
318
|
}
|
|
322
319
|
return `${prefix}${cls}`;
|
|
323
|
-
});
|
|
324
|
-
const origClasses = classString.split(" ");
|
|
325
|
-
const hasBorderWidth = origClasses.some((c) => BORDER_WIDTH_RE.test(c));
|
|
326
|
-
const hasBorderStyle = origClasses.some((c) => BORDER_STYLE_RE.test(c));
|
|
327
|
-
if (hasBorderWidth && !hasBorderStyle) {
|
|
328
|
-
prefixed.push(`${prefix}border-solid`);
|
|
329
|
-
}
|
|
330
|
-
return prefixed.join(" ");
|
|
320
|
+
}).join(" ");
|
|
331
321
|
}
|
|
332
322
|
function prefixTailwindClasses(content, prefix) {
|
|
333
323
|
content = transformSemanticClassesInContent(content);
|
|
@@ -345,7 +335,6 @@ function prefixTailwindClasses(content, prefix) {
|
|
|
345
335
|
const cnRegex = /\bcn\s*\(/g;
|
|
346
336
|
let cnMatch;
|
|
347
337
|
while ((cnMatch = cnRegex.exec(content)) !== null) {
|
|
348
|
-
if (cnMatch.index < lastIndex) continue;
|
|
349
338
|
result += content.slice(lastIndex, cnMatch.index);
|
|
350
339
|
let depth = 1;
|
|
351
340
|
let i = cnMatch.index + cnMatch[0].length;
|
|
@@ -384,120 +373,7 @@ function prefixTailwindClasses(content, prefix) {
|
|
|
384
373
|
return `className="${prefixed}"`;
|
|
385
374
|
}
|
|
386
375
|
);
|
|
387
|
-
const nonClassKeys = [
|
|
388
|
-
// HTML attributes
|
|
389
|
-
"name",
|
|
390
|
-
"displayName",
|
|
391
|
-
"type",
|
|
392
|
-
"role",
|
|
393
|
-
"id",
|
|
394
|
-
"htmlFor",
|
|
395
|
-
"for",
|
|
396
|
-
"placeholder",
|
|
397
|
-
"alt",
|
|
398
|
-
"src",
|
|
399
|
-
"href",
|
|
400
|
-
"target",
|
|
401
|
-
"rel",
|
|
402
|
-
"method",
|
|
403
|
-
"action",
|
|
404
|
-
"enctype",
|
|
405
|
-
"accept",
|
|
406
|
-
"pattern",
|
|
407
|
-
"autocomplete",
|
|
408
|
-
"value",
|
|
409
|
-
"defaultValue",
|
|
410
|
-
"label",
|
|
411
|
-
"text",
|
|
412
|
-
"message",
|
|
413
|
-
"helperText",
|
|
414
|
-
"ariaLabel",
|
|
415
|
-
"ariaDescribedBy",
|
|
416
|
-
"description",
|
|
417
|
-
"title",
|
|
418
|
-
"content",
|
|
419
|
-
"header",
|
|
420
|
-
"footer",
|
|
421
|
-
"caption",
|
|
422
|
-
"summary",
|
|
423
|
-
"tooltip",
|
|
424
|
-
"errorMessage",
|
|
425
|
-
"successMessage",
|
|
426
|
-
"warningMessage",
|
|
427
|
-
"infoMessage",
|
|
428
|
-
"hint",
|
|
429
|
-
// CSS style properties (camelCase — safe because they can't be CVA variant keys)
|
|
430
|
-
"width",
|
|
431
|
-
"height",
|
|
432
|
-
"minWidth",
|
|
433
|
-
"maxWidth",
|
|
434
|
-
"minHeight",
|
|
435
|
-
"maxHeight",
|
|
436
|
-
"padding",
|
|
437
|
-
"paddingTop",
|
|
438
|
-
"paddingRight",
|
|
439
|
-
"paddingBottom",
|
|
440
|
-
"paddingLeft",
|
|
441
|
-
"margin",
|
|
442
|
-
"marginTop",
|
|
443
|
-
"marginRight",
|
|
444
|
-
"marginBottom",
|
|
445
|
-
"marginLeft",
|
|
446
|
-
"fontSize",
|
|
447
|
-
"fontWeight",
|
|
448
|
-
"fontFamily",
|
|
449
|
-
"fontStyle",
|
|
450
|
-
"lineHeight",
|
|
451
|
-
"letterSpacing",
|
|
452
|
-
"backgroundColor",
|
|
453
|
-
"borderColor",
|
|
454
|
-
"borderWidth",
|
|
455
|
-
"borderStyle",
|
|
456
|
-
"borderRadius",
|
|
457
|
-
"zIndex",
|
|
458
|
-
"overflow",
|
|
459
|
-
"overflowX",
|
|
460
|
-
"overflowY",
|
|
461
|
-
"userSelect",
|
|
462
|
-
"transitionDuration",
|
|
463
|
-
"transitionProperty",
|
|
464
|
-
"boxShadow",
|
|
465
|
-
"textShadow",
|
|
466
|
-
"outlineOffset",
|
|
467
|
-
"rowGap",
|
|
468
|
-
"columnGap",
|
|
469
|
-
"gridTemplateColumns",
|
|
470
|
-
"gridTemplateRows",
|
|
471
|
-
"flexBasis",
|
|
472
|
-
"flexGrow",
|
|
473
|
-
"flexShrink",
|
|
474
|
-
"flexDirection",
|
|
475
|
-
"flexWrap",
|
|
476
|
-
"alignItems",
|
|
477
|
-
"alignSelf",
|
|
478
|
-
"justifyContent",
|
|
479
|
-
"justifyItems",
|
|
480
|
-
"textAlign",
|
|
481
|
-
"textDecoration",
|
|
482
|
-
"textTransform",
|
|
483
|
-
"whiteSpace",
|
|
484
|
-
"wordBreak",
|
|
485
|
-
"wordSpacing",
|
|
486
|
-
"aspectRatio",
|
|
487
|
-
"scrollbarWidth",
|
|
488
|
-
"scrollBehavior",
|
|
489
|
-
"backgroundImage",
|
|
490
|
-
"backgroundSize",
|
|
491
|
-
"backgroundPosition",
|
|
492
|
-
"backgroundRepeat",
|
|
493
|
-
"borderTop",
|
|
494
|
-
"borderRight",
|
|
495
|
-
"borderBottom",
|
|
496
|
-
"borderLeft",
|
|
497
|
-
"strokeWidth",
|
|
498
|
-
"strokeDasharray",
|
|
499
|
-
"strokeDashoffset"
|
|
500
|
-
];
|
|
376
|
+
const nonClassKeys = ["name", "displayName", "type", "role", "id", "htmlFor", "for", "placeholder", "alt", "src", "href", "target", "rel", "method", "action", "enctype", "accept", "pattern", "autocomplete", "value", "defaultValue", "label", "text", "message", "helperText", "ariaLabel", "ariaDescribedBy", "description", "title", "content", "header", "footer", "caption", "summary", "tooltip", "errorMessage", "successMessage", "warningMessage", "infoMessage", "hint"];
|
|
501
377
|
function hasObviousTailwindPatterns(value) {
|
|
502
378
|
return /(?:^|\s)(hover|focus|active|disabled|group|peer|data-|aria-|sm:|md:|lg:|xl:|2xl:|dark:)/.test(value) || // Group/peer with selectors
|
|
503
379
|
/group-\[|peer-\[/.test(value) || // Arbitrary selectors
|
|
@@ -557,264 +433,8 @@ function prefixTailwindClasses(content, prefix) {
|
|
|
557
433
|
return `${funcName}('${prefixed}'`;
|
|
558
434
|
}
|
|
559
435
|
);
|
|
560
|
-
{
|
|
561
|
-
let jsxResult = "";
|
|
562
|
-
let jsxLastIndex = 0;
|
|
563
|
-
const jsxRegex = /className\s*=\s*\{/g;
|
|
564
|
-
let jsxMatch;
|
|
565
|
-
while ((jsxMatch = jsxRegex.exec(content)) !== null) {
|
|
566
|
-
if (jsxMatch.index < jsxLastIndex) continue;
|
|
567
|
-
jsxResult += content.slice(jsxLastIndex, jsxMatch.index);
|
|
568
|
-
const bracePos = jsxMatch.index + jsxMatch[0].length - 1;
|
|
569
|
-
let depth = 1;
|
|
570
|
-
let pos = bracePos + 1;
|
|
571
|
-
while (pos < content.length && depth > 0) {
|
|
572
|
-
const ch = content[pos];
|
|
573
|
-
if (ch === "{") {
|
|
574
|
-
depth++;
|
|
575
|
-
pos++;
|
|
576
|
-
continue;
|
|
577
|
-
}
|
|
578
|
-
if (ch === "}") {
|
|
579
|
-
depth--;
|
|
580
|
-
if (depth === 0) {
|
|
581
|
-
pos++;
|
|
582
|
-
break;
|
|
583
|
-
}
|
|
584
|
-
pos++;
|
|
585
|
-
continue;
|
|
586
|
-
}
|
|
587
|
-
if (ch === '"') {
|
|
588
|
-
pos++;
|
|
589
|
-
while (pos < content.length && content[pos] !== '"') {
|
|
590
|
-
if (content[pos] === "\\") pos++;
|
|
591
|
-
pos++;
|
|
592
|
-
}
|
|
593
|
-
pos++;
|
|
594
|
-
continue;
|
|
595
|
-
}
|
|
596
|
-
if (ch === "'") {
|
|
597
|
-
pos++;
|
|
598
|
-
while (pos < content.length && content[pos] !== "'") {
|
|
599
|
-
if (content[pos] === "\\") pos++;
|
|
600
|
-
pos++;
|
|
601
|
-
}
|
|
602
|
-
pos++;
|
|
603
|
-
continue;
|
|
604
|
-
}
|
|
605
|
-
if (ch === "`") {
|
|
606
|
-
pos++;
|
|
607
|
-
let tDepth = 0;
|
|
608
|
-
while (pos < content.length) {
|
|
609
|
-
if (content[pos] === "\\") {
|
|
610
|
-
pos += 2;
|
|
611
|
-
continue;
|
|
612
|
-
}
|
|
613
|
-
if (content[pos] === "`" && tDepth === 0) {
|
|
614
|
-
pos++;
|
|
615
|
-
break;
|
|
616
|
-
}
|
|
617
|
-
if (content[pos] === "$" && content[pos + 1] === "{") {
|
|
618
|
-
tDepth++;
|
|
619
|
-
pos += 2;
|
|
620
|
-
continue;
|
|
621
|
-
}
|
|
622
|
-
if (content[pos] === "}" && tDepth > 0) {
|
|
623
|
-
tDepth--;
|
|
624
|
-
pos++;
|
|
625
|
-
continue;
|
|
626
|
-
}
|
|
627
|
-
pos++;
|
|
628
|
-
}
|
|
629
|
-
continue;
|
|
630
|
-
}
|
|
631
|
-
pos++;
|
|
632
|
-
}
|
|
633
|
-
const expr = content.slice(bracePos + 1, pos - 1);
|
|
634
|
-
const exprTrimmed = expr.trimStart();
|
|
635
|
-
if (/^(cn|cva)\s*\(/.test(exprTrimmed)) {
|
|
636
|
-
jsxResult += content.slice(jsxMatch.index, pos);
|
|
637
|
-
jsxLastIndex = pos;
|
|
638
|
-
continue;
|
|
639
|
-
}
|
|
640
|
-
const prefixedExpr = prefixClassNameExpression(expr, prefix);
|
|
641
|
-
jsxResult += jsxMatch[0] + prefixedExpr + "}";
|
|
642
|
-
jsxLastIndex = pos;
|
|
643
|
-
}
|
|
644
|
-
jsxResult += content.slice(jsxLastIndex);
|
|
645
|
-
content = jsxResult;
|
|
646
|
-
}
|
|
647
436
|
return content;
|
|
648
437
|
}
|
|
649
|
-
function isAlreadyPrefixed(classString, prefix) {
|
|
650
|
-
if (!classString.trim()) return false;
|
|
651
|
-
return classString.trim().split(/\s+/).every((c) => {
|
|
652
|
-
const lastColon = c.lastIndexOf(":");
|
|
653
|
-
const utility = lastColon >= 0 ? c.slice(lastColon + 1) : c;
|
|
654
|
-
return utility.startsWith(prefix) || utility.startsWith(`-${prefix}`) || utility.startsWith(`!${prefix}`) || utility.startsWith(`!-${prefix}`);
|
|
655
|
-
});
|
|
656
|
-
}
|
|
657
|
-
function prefixStaticTemplatePart(text, prefix) {
|
|
658
|
-
const trimmed = text.trim();
|
|
659
|
-
if (!trimmed || !looksLikeTailwindClasses(trimmed)) return text;
|
|
660
|
-
const leading = text.match(/^(\s*)/)?.[1] || "";
|
|
661
|
-
const trailing = text.match(/(\s*)$/)?.[1] || "";
|
|
662
|
-
return leading + prefixClassString(trimmed, prefix) + trailing;
|
|
663
|
-
}
|
|
664
|
-
function prefixStringLiteralsInExpr(code, prefix) {
|
|
665
|
-
let result = code.replace(/"([^"]*)"/g, (m, classes) => {
|
|
666
|
-
if (!classes.trim() || !looksLikeTailwindClasses(classes) || isAlreadyPrefixed(classes, prefix)) return m;
|
|
667
|
-
return `"${prefixClassString(classes, prefix)}"`;
|
|
668
|
-
});
|
|
669
|
-
result = result.replace(/'([^']*)'/g, (m, classes) => {
|
|
670
|
-
if (!classes.trim() || !looksLikeTailwindClasses(classes) || isAlreadyPrefixed(classes, prefix)) return m;
|
|
671
|
-
return `'${prefixClassString(classes, prefix)}'`;
|
|
672
|
-
});
|
|
673
|
-
return result;
|
|
674
|
-
}
|
|
675
|
-
function prefixClassNameExpression(expr, prefix) {
|
|
676
|
-
let result = "";
|
|
677
|
-
let i = 0;
|
|
678
|
-
while (i < expr.length) {
|
|
679
|
-
if (expr[i] === "`") {
|
|
680
|
-
result += "`";
|
|
681
|
-
i++;
|
|
682
|
-
let staticText = "";
|
|
683
|
-
while (i < expr.length && expr[i] !== "`") {
|
|
684
|
-
if (expr[i] === "\\") {
|
|
685
|
-
staticText += expr[i] + (expr[i + 1] || "");
|
|
686
|
-
i += 2;
|
|
687
|
-
continue;
|
|
688
|
-
}
|
|
689
|
-
if (expr[i] === "$" && i + 1 < expr.length && expr[i + 1] === "{") {
|
|
690
|
-
if (staticText) {
|
|
691
|
-
result += prefixStaticTemplatePart(staticText, prefix);
|
|
692
|
-
staticText = "";
|
|
693
|
-
}
|
|
694
|
-
result += "${";
|
|
695
|
-
i += 2;
|
|
696
|
-
let exprDepth = 1;
|
|
697
|
-
let exprContent = "";
|
|
698
|
-
while (i < expr.length && exprDepth > 0) {
|
|
699
|
-
if (expr[i] === '"') {
|
|
700
|
-
exprContent += expr[i];
|
|
701
|
-
i++;
|
|
702
|
-
while (i < expr.length && expr[i] !== '"') {
|
|
703
|
-
if (expr[i] === "\\") {
|
|
704
|
-
exprContent += expr[i];
|
|
705
|
-
i++;
|
|
706
|
-
}
|
|
707
|
-
exprContent += expr[i];
|
|
708
|
-
i++;
|
|
709
|
-
}
|
|
710
|
-
if (i < expr.length) {
|
|
711
|
-
exprContent += expr[i];
|
|
712
|
-
i++;
|
|
713
|
-
}
|
|
714
|
-
continue;
|
|
715
|
-
}
|
|
716
|
-
if (expr[i] === "'") {
|
|
717
|
-
exprContent += expr[i];
|
|
718
|
-
i++;
|
|
719
|
-
while (i < expr.length && expr[i] !== "'") {
|
|
720
|
-
if (expr[i] === "\\") {
|
|
721
|
-
exprContent += expr[i];
|
|
722
|
-
i++;
|
|
723
|
-
}
|
|
724
|
-
exprContent += expr[i];
|
|
725
|
-
i++;
|
|
726
|
-
}
|
|
727
|
-
if (i < expr.length) {
|
|
728
|
-
exprContent += expr[i];
|
|
729
|
-
i++;
|
|
730
|
-
}
|
|
731
|
-
continue;
|
|
732
|
-
}
|
|
733
|
-
if (expr[i] === "`") {
|
|
734
|
-
exprContent += expr[i];
|
|
735
|
-
i++;
|
|
736
|
-
let nestedDepth = 0;
|
|
737
|
-
while (i < expr.length) {
|
|
738
|
-
if (expr[i] === "\\") {
|
|
739
|
-
exprContent += expr[i];
|
|
740
|
-
i++;
|
|
741
|
-
if (i < expr.length) {
|
|
742
|
-
exprContent += expr[i];
|
|
743
|
-
i++;
|
|
744
|
-
}
|
|
745
|
-
;
|
|
746
|
-
continue;
|
|
747
|
-
}
|
|
748
|
-
if (expr[i] === "`" && nestedDepth === 0) {
|
|
749
|
-
exprContent += expr[i];
|
|
750
|
-
i++;
|
|
751
|
-
break;
|
|
752
|
-
}
|
|
753
|
-
if (expr[i] === "$" && i + 1 < expr.length && expr[i + 1] === "{") {
|
|
754
|
-
nestedDepth++;
|
|
755
|
-
exprContent += "${";
|
|
756
|
-
i += 2;
|
|
757
|
-
continue;
|
|
758
|
-
}
|
|
759
|
-
if (expr[i] === "}" && nestedDepth > 0) {
|
|
760
|
-
nestedDepth--;
|
|
761
|
-
}
|
|
762
|
-
exprContent += expr[i];
|
|
763
|
-
i++;
|
|
764
|
-
}
|
|
765
|
-
continue;
|
|
766
|
-
}
|
|
767
|
-
if (expr[i] === "{") exprDepth++;
|
|
768
|
-
else if (expr[i] === "}") {
|
|
769
|
-
exprDepth--;
|
|
770
|
-
if (exprDepth === 0) {
|
|
771
|
-
i++;
|
|
772
|
-
break;
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
exprContent += expr[i];
|
|
776
|
-
i++;
|
|
777
|
-
}
|
|
778
|
-
result += prefixStringLiteralsInExpr(exprContent, prefix) + "}";
|
|
779
|
-
continue;
|
|
780
|
-
}
|
|
781
|
-
staticText += expr[i];
|
|
782
|
-
i++;
|
|
783
|
-
}
|
|
784
|
-
if (staticText) {
|
|
785
|
-
result += prefixStaticTemplatePart(staticText, prefix);
|
|
786
|
-
}
|
|
787
|
-
if (i < expr.length && expr[i] === "`") {
|
|
788
|
-
result += "`";
|
|
789
|
-
i++;
|
|
790
|
-
}
|
|
791
|
-
} else if (expr[i] === '"' || expr[i] === "'") {
|
|
792
|
-
const quote = expr[i];
|
|
793
|
-
const strStart = i;
|
|
794
|
-
i++;
|
|
795
|
-
let str = "";
|
|
796
|
-
while (i < expr.length && expr[i] !== quote) {
|
|
797
|
-
if (expr[i] === "\\") {
|
|
798
|
-
str += expr[i] + (expr[i + 1] || "");
|
|
799
|
-
i += 2;
|
|
800
|
-
continue;
|
|
801
|
-
}
|
|
802
|
-
str += expr[i];
|
|
803
|
-
i++;
|
|
804
|
-
}
|
|
805
|
-
if (i < expr.length) i++;
|
|
806
|
-
if (str.trim() && looksLikeTailwindClasses(str) && !isAlreadyPrefixed(str, prefix)) {
|
|
807
|
-
result += quote + prefixClassString(str, prefix) + quote;
|
|
808
|
-
} else {
|
|
809
|
-
result += expr.slice(strStart, i);
|
|
810
|
-
}
|
|
811
|
-
} else {
|
|
812
|
-
result += expr[i];
|
|
813
|
-
i++;
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
return result;
|
|
817
|
-
}
|
|
818
438
|
async function getRegistry(prefix = "") {
|
|
819
439
|
return {
|
|
820
440
|
"avatar": {
|
|
@@ -914,7 +534,7 @@ export interface AvatarProps
|
|
|
914
534
|
* <Avatar initials="AS" size="xs" />
|
|
915
535
|
* \`\`\`
|
|
916
536
|
*/
|
|
917
|
-
const Avatar = React.forwardRef(
|
|
537
|
+
const Avatar = React.forwardRef<HTMLDivElement, AvatarProps>(
|
|
918
538
|
(
|
|
919
539
|
{
|
|
920
540
|
className,
|
|
@@ -927,8 +547,8 @@ const Avatar = React.forwardRef(
|
|
|
927
547
|
status,
|
|
928
548
|
children,
|
|
929
549
|
...props
|
|
930
|
-
}
|
|
931
|
-
ref
|
|
550
|
+
},
|
|
551
|
+
ref
|
|
932
552
|
) => {
|
|
933
553
|
const resolvedSize = size ?? "md";
|
|
934
554
|
const displayInitials = initials ?? (name ? getInitials(name) : undefined);
|
|
@@ -1005,8 +625,8 @@ export interface DateDividerProps
|
|
|
1005
625
|
children: React.ReactNode;
|
|
1006
626
|
}
|
|
1007
627
|
|
|
1008
|
-
const DateDivider = React.forwardRef(
|
|
1009
|
-
({ className, children, ...props }
|
|
628
|
+
const DateDivider = React.forwardRef<HTMLDivElement, DateDividerProps>(
|
|
629
|
+
({ className, children, ...props }, ref) => (
|
|
1010
630
|
<div
|
|
1011
631
|
ref={ref}
|
|
1012
632
|
className={cn("flex items-center gap-4 my-4", className)}
|
|
@@ -1062,8 +682,8 @@ export interface ImageMediaProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
1062
682
|
maxHeight?: number | string;
|
|
1063
683
|
}
|
|
1064
684
|
|
|
1065
|
-
const ImageMedia = React.forwardRef(
|
|
1066
|
-
({ className, src, alt = "Image", maxHeight = 280, ...props }
|
|
685
|
+
const ImageMedia = React.forwardRef<HTMLDivElement, ImageMediaProps>(
|
|
686
|
+
({ className, src, alt = "Image", maxHeight = 280, ...props }, ref) => {
|
|
1067
687
|
const maxHeightStyle =
|
|
1068
688
|
typeof maxHeight === "number" ? \`\${maxHeight}px\` : maxHeight;
|
|
1069
689
|
|
|
@@ -1127,7 +747,7 @@ export interface PhoneInputProps
|
|
|
1127
747
|
wrapperClassName?: string;
|
|
1128
748
|
}
|
|
1129
749
|
|
|
1130
|
-
const PhoneInput = React.forwardRef(
|
|
750
|
+
const PhoneInput = React.forwardRef<HTMLInputElement, PhoneInputProps>(
|
|
1131
751
|
(
|
|
1132
752
|
{
|
|
1133
753
|
className,
|
|
@@ -1138,8 +758,8 @@ const PhoneInput = React.forwardRef(
|
|
|
1138
758
|
wrapperClassName,
|
|
1139
759
|
disabled,
|
|
1140
760
|
...props
|
|
1141
|
-
}
|
|
1142
|
-
ref
|
|
761
|
+
},
|
|
762
|
+
ref
|
|
1143
763
|
) => {
|
|
1144
764
|
return (
|
|
1145
765
|
<div
|
|
@@ -1223,8 +843,8 @@ export interface ReplyQuoteProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
1223
843
|
message: string;
|
|
1224
844
|
}
|
|
1225
845
|
|
|
1226
|
-
const ReplyQuote = React.forwardRef(
|
|
1227
|
-
({ className, sender, message, onClick, onKeyDown, role, tabIndex, "aria-label": ariaLabel, ...props }
|
|
846
|
+
const ReplyQuote = React.forwardRef<HTMLDivElement, ReplyQuoteProps>(
|
|
847
|
+
({ className, sender, message, onClick, onKeyDown, role, tabIndex, "aria-label": ariaLabel, ...props }, ref) => {
|
|
1228
848
|
const isInteractive = !!onClick;
|
|
1229
849
|
|
|
1230
850
|
const handleKeyDown = React.useCallback(
|
|
@@ -1304,8 +924,8 @@ export interface SystemMessageProps
|
|
|
1304
924
|
children: string;
|
|
1305
925
|
}
|
|
1306
926
|
|
|
1307
|
-
const SystemMessage = React.forwardRef(
|
|
1308
|
-
({ className, children, ...props }
|
|
927
|
+
const SystemMessage = React.forwardRef<HTMLDivElement, SystemMessageProps>(
|
|
928
|
+
({ className, children, ...props }, ref) => (
|
|
1309
929
|
<div
|
|
1310
930
|
ref={ref}
|
|
1311
931
|
className={cn("flex justify-center my-1", className)}
|
|
@@ -1366,8 +986,8 @@ export interface UnreadSeparatorProps
|
|
|
1366
986
|
label?: string;
|
|
1367
987
|
}
|
|
1368
988
|
|
|
1369
|
-
const UnreadSeparator = React.forwardRef(
|
|
1370
|
-
({ className, count, label, ...props }
|
|
989
|
+
const UnreadSeparator = React.forwardRef<HTMLDivElement, UnreadSeparatorProps>(
|
|
990
|
+
({ className, count, label, ...props }, ref) => (
|
|
1371
991
|
<div
|
|
1372
992
|
ref={ref}
|
|
1373
993
|
className={cn("flex items-center gap-4 my-2", className)}
|
|
@@ -1423,12 +1043,12 @@ const buttonVariants = cva(
|
|
|
1423
1043
|
success:
|
|
1424
1044
|
"bg-semantic-success-primary text-semantic-text-inverted hover:bg-semantic-success-hover",
|
|
1425
1045
|
outline:
|
|
1426
|
-
"border border-
|
|
1046
|
+
"border border-semantic-border-layout bg-semantic-bg-primary text-semantic-text-secondary hover:bg-semantic-primary-surface",
|
|
1427
1047
|
secondary:
|
|
1428
1048
|
"bg-semantic-primary-surface text-semantic-text-secondary hover:bg-semantic-bg-hover",
|
|
1429
1049
|
ghost:
|
|
1430
1050
|
"text-semantic-text-muted hover:bg-semantic-bg-ui hover:text-semantic-text-primary",
|
|
1431
|
-
link: "text-semantic-text-
|
|
1051
|
+
link: "text-semantic-text-secondary underline-offset-4 hover:underline",
|
|
1432
1052
|
dashed:
|
|
1433
1053
|
"border border-dashed border-semantic-bg-hover bg-transparent text-semantic-text-muted hover:border-semantic-border-primary hover:text-semantic-text-secondary hover:bg-[var(--color-neutral-50)]",
|
|
1434
1054
|
},
|
|
@@ -1474,7 +1094,7 @@ export interface ButtonProps
|
|
|
1474
1094
|
loadingText?: string;
|
|
1475
1095
|
}
|
|
1476
1096
|
|
|
1477
|
-
const Button = React.forwardRef(
|
|
1097
|
+
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
1478
1098
|
(
|
|
1479
1099
|
{
|
|
1480
1100
|
className,
|
|
@@ -1488,8 +1108,8 @@ const Button = React.forwardRef(
|
|
|
1488
1108
|
children,
|
|
1489
1109
|
disabled,
|
|
1490
1110
|
...props
|
|
1491
|
-
}
|
|
1492
|
-
ref
|
|
1111
|
+
},
|
|
1112
|
+
ref
|
|
1493
1113
|
) => {
|
|
1494
1114
|
const Comp = asChild ? Slot : "button";
|
|
1495
1115
|
|
|
@@ -1605,7 +1225,7 @@ export interface BadgeProps
|
|
|
1605
1225
|
asChild?: boolean;
|
|
1606
1226
|
}
|
|
1607
1227
|
|
|
1608
|
-
const Badge = React.forwardRef(
|
|
1228
|
+
const Badge = React.forwardRef<HTMLDivElement, BadgeProps>(
|
|
1609
1229
|
(
|
|
1610
1230
|
{
|
|
1611
1231
|
className,
|
|
@@ -1616,8 +1236,8 @@ const Badge = React.forwardRef(
|
|
|
1616
1236
|
asChild = false,
|
|
1617
1237
|
children,
|
|
1618
1238
|
...props
|
|
1619
|
-
}
|
|
1620
|
-
ref
|
|
1239
|
+
},
|
|
1240
|
+
ref
|
|
1621
1241
|
) => {
|
|
1622
1242
|
const Comp = asChild ? Slot : "div";
|
|
1623
1243
|
|
|
@@ -1706,7 +1326,7 @@ export interface ContactListItemProps
|
|
|
1706
1326
|
* />
|
|
1707
1327
|
* \`\`\`
|
|
1708
1328
|
*/
|
|
1709
|
-
const ContactListItem = React.forwardRef(
|
|
1329
|
+
const ContactListItem = React.forwardRef<HTMLDivElement, ContactListItemProps>(
|
|
1710
1330
|
(
|
|
1711
1331
|
{
|
|
1712
1332
|
name,
|
|
@@ -1717,8 +1337,8 @@ const ContactListItem = React.forwardRef(
|
|
|
1717
1337
|
onClick,
|
|
1718
1338
|
className,
|
|
1719
1339
|
...props
|
|
1720
|
-
}
|
|
1721
|
-
ref
|
|
1340
|
+
},
|
|
1341
|
+
ref
|
|
1722
1342
|
) => {
|
|
1723
1343
|
return (
|
|
1724
1344
|
<div
|
|
@@ -1917,7 +1537,7 @@ export interface TypographyProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
1917
1537
|
* <Typography truncate>Very long text that will be truncated...</Typography>
|
|
1918
1538
|
* \`\`\`
|
|
1919
1539
|
*/
|
|
1920
|
-
const Typography = React.forwardRef(
|
|
1540
|
+
const Typography = React.forwardRef<HTMLElement, TypographyProps>(
|
|
1921
1541
|
(
|
|
1922
1542
|
{
|
|
1923
1543
|
children,
|
|
@@ -1930,8 +1550,8 @@ const Typography = React.forwardRef(
|
|
|
1930
1550
|
tag,
|
|
1931
1551
|
htmlFor,
|
|
1932
1552
|
...props
|
|
1933
|
-
}
|
|
1934
|
-
ref
|
|
1553
|
+
},
|
|
1554
|
+
ref
|
|
1935
1555
|
) => {
|
|
1936
1556
|
const key: Key = \`\${kind}-\${variant}\`;
|
|
1937
1557
|
const Tag = (tag || mapTagName[key]) as React.ElementType;
|
|
@@ -1999,9 +1619,9 @@ const inputVariants = cva(
|
|
|
1999
1619
|
variants: {
|
|
2000
1620
|
state: {
|
|
2001
1621
|
default:
|
|
2002
|
-
"border border-semantic-border-input focus:outline-none focus:border-semantic-border-input-focus focus:shadow-[0_0_0_1px_rgba(43,188,202,0.15)]",
|
|
1622
|
+
"border border-semantic-border-input hover:border-semantic-border-input-focus focus:outline-none focus:border-semantic-border-input-focus focus:shadow-[0_0_0_1px_rgba(43,188,202,0.15)]",
|
|
2003
1623
|
error:
|
|
2004
|
-
"border border-semantic-error-primary/40 focus:outline-none focus:border-semantic-error-primary focus:shadow-[0_0_0_1px_rgba(240,68,56,0.1)]",
|
|
1624
|
+
"border border-semantic-error-primary/40 hover:border-semantic-error-primary focus:outline-none focus:border-semantic-error-primary focus:shadow-[0_0_0_1px_rgba(240,68,56,0.1)]",
|
|
2005
1625
|
},
|
|
2006
1626
|
},
|
|
2007
1627
|
defaultVariants: {
|
|
@@ -2028,8 +1648,8 @@ export interface InputProps
|
|
|
2028
1648
|
showCheckIcon?: boolean;
|
|
2029
1649
|
}
|
|
2030
1650
|
|
|
2031
|
-
const Input = React.forwardRef(
|
|
2032
|
-
({ className, state, type, showCheckIcon, onFocus, onBlur, onWheel, ...props }
|
|
1651
|
+
const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
1652
|
+
({ className, state, type, showCheckIcon, onFocus, onBlur, onWheel, ...props }, ref) => {
|
|
2033
1653
|
const [isFocused, setIsFocused] = React.useState(false);
|
|
2034
1654
|
|
|
2035
1655
|
const inputEl = (
|
|
@@ -2127,7 +1747,10 @@ const Select = SelectPrimitive.Root;
|
|
|
2127
1747
|
|
|
2128
1748
|
const SelectGroup = SelectPrimitive.Group;
|
|
2129
1749
|
|
|
2130
|
-
const SelectValue = React.forwardRef
|
|
1750
|
+
const SelectValue = React.forwardRef<
|
|
1751
|
+
React.ElementRef<typeof SelectPrimitive.Value>,
|
|
1752
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Value>
|
|
1753
|
+
>(({ className, ...props }, ref) => (
|
|
2131
1754
|
<SelectPrimitive.Value
|
|
2132
1755
|
ref={ref}
|
|
2133
1756
|
className={cn("[&[data-placeholder]]:text-semantic-text-muted", className)}
|
|
@@ -2141,7 +1764,10 @@ export interface SelectTriggerProps
|
|
|
2141
1764
|
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>,
|
|
2142
1765
|
VariantProps<typeof selectTriggerVariants> {}
|
|
2143
1766
|
|
|
2144
|
-
const SelectTrigger = React.forwardRef
|
|
1767
|
+
const SelectTrigger = React.forwardRef<
|
|
1768
|
+
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
|
1769
|
+
SelectTriggerProps
|
|
1770
|
+
>(({ className, state, children, ...props }, ref) => (
|
|
2145
1771
|
<SelectPrimitive.Trigger
|
|
2146
1772
|
ref={ref}
|
|
2147
1773
|
className={cn(selectTriggerVariants({ state, className }))}
|
|
@@ -2155,7 +1781,10 @@ const SelectTrigger = React.forwardRef(({ className, state, children, ...props }
|
|
|
2155
1781
|
));
|
|
2156
1782
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
2157
1783
|
|
|
2158
|
-
const SelectScrollUpButton = React.forwardRef
|
|
1784
|
+
const SelectScrollUpButton = React.forwardRef<
|
|
1785
|
+
React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
|
|
1786
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
|
|
1787
|
+
>(({ className, ...props }, ref) => (
|
|
2159
1788
|
<SelectPrimitive.ScrollUpButton
|
|
2160
1789
|
ref={ref}
|
|
2161
1790
|
className={cn(
|
|
@@ -2169,7 +1798,10 @@ const SelectScrollUpButton = React.forwardRef(({ className, ...props }: React.Co
|
|
|
2169
1798
|
));
|
|
2170
1799
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
2171
1800
|
|
|
2172
|
-
const SelectScrollDownButton = React.forwardRef
|
|
1801
|
+
const SelectScrollDownButton = React.forwardRef<
|
|
1802
|
+
React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
|
|
1803
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
|
|
1804
|
+
>(({ className, ...props }, ref) => (
|
|
2173
1805
|
<SelectPrimitive.ScrollDownButton
|
|
2174
1806
|
ref={ref}
|
|
2175
1807
|
className={cn(
|
|
@@ -2223,7 +1855,10 @@ function useUnlockBodyScroll() {
|
|
|
2223
1855
|
}, []);
|
|
2224
1856
|
}
|
|
2225
1857
|
|
|
2226
|
-
const SelectContent = React.forwardRef
|
|
1858
|
+
const SelectContent = React.forwardRef<
|
|
1859
|
+
React.ElementRef<typeof SelectPrimitive.Content>,
|
|
1860
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
|
|
1861
|
+
>(({ className, children, position = "popper", ...props }, ref) => {
|
|
2227
1862
|
useUnlockBodyScroll();
|
|
2228
1863
|
|
|
2229
1864
|
return (
|
|
@@ -2261,7 +1896,10 @@ const SelectContent = React.forwardRef(({ className, children, position = "poppe
|
|
|
2261
1896
|
});
|
|
2262
1897
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
2263
1898
|
|
|
2264
|
-
const SelectLabel = React.forwardRef
|
|
1899
|
+
const SelectLabel = React.forwardRef<
|
|
1900
|
+
React.ElementRef<typeof SelectPrimitive.Label>,
|
|
1901
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
|
|
1902
|
+
>(({ className, ...props }, ref) => (
|
|
2265
1903
|
<SelectPrimitive.Label
|
|
2266
1904
|
ref={ref}
|
|
2267
1905
|
className={cn(
|
|
@@ -2273,7 +1911,10 @@ const SelectLabel = React.forwardRef(({ className, ...props }: React.ComponentPr
|
|
|
2273
1911
|
));
|
|
2274
1912
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
2275
1913
|
|
|
2276
|
-
const SelectItem = React.forwardRef
|
|
1914
|
+
const SelectItem = React.forwardRef<
|
|
1915
|
+
React.ElementRef<typeof SelectPrimitive.Item>,
|
|
1916
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
|
|
1917
|
+
>(({ className, children, ...props }, ref) => (
|
|
2277
1918
|
<SelectPrimitive.Item
|
|
2278
1919
|
ref={ref}
|
|
2279
1920
|
className={cn(
|
|
@@ -2294,7 +1935,10 @@ const SelectItem = React.forwardRef(({ className, children, ...props }: React.Co
|
|
|
2294
1935
|
));
|
|
2295
1936
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
2296
1937
|
|
|
2297
|
-
const SelectSeparator = React.forwardRef
|
|
1938
|
+
const SelectSeparator = React.forwardRef<
|
|
1939
|
+
React.ElementRef<typeof SelectPrimitive.Separator>,
|
|
1940
|
+
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
|
|
1941
|
+
>(({ className, ...props }, ref) => (
|
|
2298
1942
|
<SelectPrimitive.Separator
|
|
2299
1943
|
ref={ref}
|
|
2300
1944
|
className={cn("-mx-1 my-1 h-px bg-semantic-border-layout", className)}
|
|
@@ -2425,7 +2069,10 @@ export interface CheckboxProps
|
|
|
2425
2069
|
separateLabel?: boolean;
|
|
2426
2070
|
}
|
|
2427
2071
|
|
|
2428
|
-
const Checkbox = React.forwardRef
|
|
2072
|
+
const Checkbox = React.forwardRef<
|
|
2073
|
+
React.ElementRef<typeof CheckboxPrimitive.Root>,
|
|
2074
|
+
CheckboxProps
|
|
2075
|
+
>(
|
|
2429
2076
|
(
|
|
2430
2077
|
{
|
|
2431
2078
|
className,
|
|
@@ -2438,8 +2085,8 @@ const Checkbox = React.forwardRef(
|
|
|
2438
2085
|
id,
|
|
2439
2086
|
disabled,
|
|
2440
2087
|
...props
|
|
2441
|
-
}
|
|
2442
|
-
ref
|
|
2088
|
+
},
|
|
2089
|
+
ref
|
|
2443
2090
|
) => {
|
|
2444
2091
|
const checkbox = (
|
|
2445
2092
|
<CheckboxPrimitive.Root
|
|
@@ -2643,10 +2290,13 @@ export interface SwitchProps
|
|
|
2643
2290
|
labelPosition?: "left" | "right";
|
|
2644
2291
|
}
|
|
2645
2292
|
|
|
2646
|
-
const Switch = React.forwardRef
|
|
2293
|
+
const Switch = React.forwardRef<
|
|
2294
|
+
React.ElementRef<typeof SwitchPrimitives.Root>,
|
|
2295
|
+
SwitchProps
|
|
2296
|
+
>(
|
|
2647
2297
|
(
|
|
2648
|
-
{ className, size, label, labelPosition = "right", disabled, ...props }
|
|
2649
|
-
ref
|
|
2298
|
+
{ className, size, label, labelPosition = "right", disabled, ...props },
|
|
2299
|
+
ref
|
|
2650
2300
|
) => {
|
|
2651
2301
|
const switchElement = (
|
|
2652
2302
|
<SwitchPrimitives.Root
|
|
@@ -2717,7 +2367,16 @@ export { Switch, switchVariants };
|
|
|
2717
2367
|
files: [
|
|
2718
2368
|
{
|
|
2719
2369
|
name: "text-field.tsx",
|
|
2720
|
-
content: prefixTailwindClasses(`import
|
|
2370
|
+
content: prefixTailwindClasses(`import {
|
|
2371
|
+
forwardRef,
|
|
2372
|
+
useRef,
|
|
2373
|
+
useCallback,
|
|
2374
|
+
useState,
|
|
2375
|
+
useId,
|
|
2376
|
+
type ChangeEvent,
|
|
2377
|
+
type ReactNode,
|
|
2378
|
+
type ComponentProps,
|
|
2379
|
+
} from "react";
|
|
2721
2380
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
2722
2381
|
import { Loader2, X } from "lucide-react";
|
|
2723
2382
|
|
|
@@ -2732,9 +2391,9 @@ const textFieldContainerVariants = cva(
|
|
|
2732
2391
|
variants: {
|
|
2733
2392
|
state: {
|
|
2734
2393
|
default:
|
|
2735
|
-
"border border-semantic-border-input focus-within:border-semantic-border-input-focus focus-within:shadow-[0_0_0_1px_rgba(43,188,202,0.15)]",
|
|
2394
|
+
"border border-semantic-border-input focus-within:border-semantic-border-input-focus/50 focus-within:shadow-[0_0_0_1px_rgba(43,188,202,0.15)]",
|
|
2736
2395
|
error:
|
|
2737
|
-
"border border-semantic-error-primary/40 focus-within:border-semantic-error-primary focus-within:shadow-[0_0_0_1px_rgba(240,68,56,0.1)]",
|
|
2396
|
+
"border border-semantic-error-primary/40 focus-within:border-semantic-error-primary/60 focus-within:shadow-[0_0_0_1px_rgba(240,68,56,0.1)]",
|
|
2738
2397
|
},
|
|
2739
2398
|
disabled: {
|
|
2740
2399
|
true: "cursor-not-allowed opacity-50 bg-[var(--color-neutral-50)]",
|
|
@@ -2757,9 +2416,9 @@ const textFieldInputVariants = cva(
|
|
|
2757
2416
|
variants: {
|
|
2758
2417
|
state: {
|
|
2759
2418
|
default:
|
|
2760
|
-
"border border-semantic-border-input focus:outline-none focus:border-semantic-border-input-focus focus:shadow-[0_0_0_1px_rgba(43,188,202,0.15)]",
|
|
2419
|
+
"border border-semantic-border-input focus:outline-none focus:border-semantic-border-input-focus/50 focus:shadow-[0_0_0_1px_rgba(43,188,202,0.15)]",
|
|
2761
2420
|
error:
|
|
2762
|
-
"border border-semantic-error-primary/40 focus:outline-none focus:border-semantic-error-primary focus:shadow-[0_0_0_1px_rgba(240,68,56,0.1)]",
|
|
2421
|
+
"border border-semantic-error-primary/40 focus:outline-none focus:border-semantic-error-primary/60 focus:shadow-[0_0_0_1px_rgba(240,68,56,0.1)]",
|
|
2763
2422
|
},
|
|
2764
2423
|
size: {
|
|
2765
2424
|
default: "h-[42px] px-4 py-2 text-base file:text-base",
|
|
@@ -2785,7 +2444,7 @@ const textFieldInputVariants = cva(
|
|
|
2785
2444
|
*/
|
|
2786
2445
|
export interface TextFieldProps
|
|
2787
2446
|
extends
|
|
2788
|
-
Omit<
|
|
2447
|
+
Omit<ComponentProps<"input">, "size">,
|
|
2789
2448
|
VariantProps<typeof textFieldInputVariants> {
|
|
2790
2449
|
/** Size of the text field \u2014 \`default\` (42px) or \`sm\` (36px, compact) */
|
|
2791
2450
|
size?: "default" | "sm";
|
|
@@ -2798,9 +2457,9 @@ export interface TextFieldProps
|
|
|
2798
2457
|
/** Error message - shows error state with red styling */
|
|
2799
2458
|
error?: string;
|
|
2800
2459
|
/** Icon displayed on the left inside the input */
|
|
2801
|
-
leftIcon?:
|
|
2460
|
+
leftIcon?: ReactNode;
|
|
2802
2461
|
/** Icon displayed on the right inside the input */
|
|
2803
|
-
rightIcon?:
|
|
2462
|
+
rightIcon?: ReactNode;
|
|
2804
2463
|
/** Text prefix inside input (e.g., "https://") */
|
|
2805
2464
|
prefix?: string;
|
|
2806
2465
|
/** Text suffix inside input (e.g., ".com") */
|
|
@@ -2821,7 +2480,7 @@ export interface TextFieldProps
|
|
|
2821
2480
|
inputContainerClassName?: string;
|
|
2822
2481
|
}
|
|
2823
2482
|
|
|
2824
|
-
const TextField =
|
|
2483
|
+
const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
|
|
2825
2484
|
(
|
|
2826
2485
|
{
|
|
2827
2486
|
className,
|
|
@@ -2851,22 +2510,22 @@ const TextField = React.forwardRef(
|
|
|
2851
2510
|
id,
|
|
2852
2511
|
type,
|
|
2853
2512
|
...props
|
|
2854
|
-
}
|
|
2855
|
-
ref
|
|
2513
|
+
},
|
|
2514
|
+
ref
|
|
2856
2515
|
) => {
|
|
2857
2516
|
// Internal ref for programmatic control (e.g., clearable)
|
|
2858
|
-
const internalRef =
|
|
2859
|
-
const mergedRef =
|
|
2517
|
+
const internalRef = useRef<HTMLInputElement>(null);
|
|
2518
|
+
const mergedRef = useCallback(
|
|
2860
2519
|
(node: HTMLInputElement | null) => {
|
|
2861
2520
|
internalRef.current = node;
|
|
2862
2521
|
if (typeof ref === "function") ref(node);
|
|
2863
|
-
else if (ref
|
|
2522
|
+
else if (ref) ref.current = node;
|
|
2864
2523
|
},
|
|
2865
2524
|
[ref]
|
|
2866
2525
|
);
|
|
2867
2526
|
|
|
2868
2527
|
// Internal state for character count in uncontrolled mode
|
|
2869
|
-
const [internalValue, setInternalValue] =
|
|
2528
|
+
const [internalValue, setInternalValue] = useState(
|
|
2870
2529
|
defaultValue ?? ""
|
|
2871
2530
|
);
|
|
2872
2531
|
|
|
@@ -2878,7 +2537,7 @@ const TextField = React.forwardRef(
|
|
|
2878
2537
|
const derivedState = error ? "error" : (state ?? "default");
|
|
2879
2538
|
|
|
2880
2539
|
// Handle change for both controlled and uncontrolled
|
|
2881
|
-
const handleChange = (e:
|
|
2540
|
+
const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
|
|
2882
2541
|
if (!isControlled) {
|
|
2883
2542
|
setInternalValue(e.target.value);
|
|
2884
2543
|
}
|
|
@@ -2905,7 +2564,7 @@ const TextField = React.forwardRef(
|
|
|
2905
2564
|
const charCount = String(currentValue).length;
|
|
2906
2565
|
|
|
2907
2566
|
// Generate unique IDs for accessibility
|
|
2908
|
-
const generatedId =
|
|
2567
|
+
const generatedId = useId();
|
|
2909
2568
|
const inputId = id || generatedId;
|
|
2910
2569
|
const helperId = \`\${inputId}-helper\`;
|
|
2911
2570
|
const errorId = \`\${inputId}-error\`;
|
|
@@ -3024,12 +2683,12 @@ const TextField = React.forwardRef(
|
|
|
3024
2683
|
{error ? (
|
|
3025
2684
|
<span
|
|
3026
2685
|
id={errorId}
|
|
3027
|
-
className="text-
|
|
2686
|
+
className="text-xs text-semantic-error-primary"
|
|
3028
2687
|
>
|
|
3029
2688
|
{error}
|
|
3030
2689
|
</span>
|
|
3031
2690
|
) : helperText ? (
|
|
3032
|
-
<span id={helperId} className="text-
|
|
2691
|
+
<span id={helperId} className="text-xs text-semantic-text-muted">
|
|
3033
2692
|
{helperText}
|
|
3034
2693
|
</span>
|
|
3035
2694
|
) : (
|
|
@@ -3038,7 +2697,7 @@ const TextField = React.forwardRef(
|
|
|
3038
2697
|
{showCount && maxLength && (
|
|
3039
2698
|
<span
|
|
3040
2699
|
className={cn(
|
|
3041
|
-
"text-
|
|
2700
|
+
"text-xs",
|
|
3042
2701
|
charCount > maxLength
|
|
3043
2702
|
? "text-semantic-error-primary"
|
|
3044
2703
|
: "text-semantic-text-muted"
|
|
@@ -3056,225 +2715,6 @@ const TextField = React.forwardRef(
|
|
|
3056
2715
|
TextField.displayName = "TextField";
|
|
3057
2716
|
|
|
3058
2717
|
export { TextField, textFieldContainerVariants, textFieldInputVariants };
|
|
3059
|
-
`, prefix)
|
|
3060
|
-
}
|
|
3061
|
-
]
|
|
3062
|
-
},
|
|
3063
|
-
"textarea": {
|
|
3064
|
-
name: "textarea",
|
|
3065
|
-
description: "A multi-line text input with label, error state, helper text, character counter, and resize control",
|
|
3066
|
-
category: "form",
|
|
3067
|
-
dependencies: [
|
|
3068
|
-
"class-variance-authority",
|
|
3069
|
-
"clsx",
|
|
3070
|
-
"tailwind-merge"
|
|
3071
|
-
],
|
|
3072
|
-
files: [
|
|
3073
|
-
{
|
|
3074
|
-
name: "textarea.tsx",
|
|
3075
|
-
content: prefixTailwindClasses(`import * as React from "react";
|
|
3076
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
3077
|
-
|
|
3078
|
-
import { cn } from "../../lib/utils";
|
|
3079
|
-
|
|
3080
|
-
/**
|
|
3081
|
-
* Textarea variants for different visual states
|
|
3082
|
-
*/
|
|
3083
|
-
const textareaVariants = cva(
|
|
3084
|
-
"w-full rounded bg-semantic-bg-primary text-semantic-text-primary outline-none transition-all placeholder:text-semantic-text-placeholder disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-[var(--color-neutral-50)]",
|
|
3085
|
-
{
|
|
3086
|
-
variants: {
|
|
3087
|
-
state: {
|
|
3088
|
-
default:
|
|
3089
|
-
"border border-semantic-border-input focus:outline-none focus:border-semantic-border-input-focus focus:shadow-[0_0_0_1px_rgba(43,188,202,0.15)]",
|
|
3090
|
-
error:
|
|
3091
|
-
"border border-semantic-error-primary/40 focus:outline-none focus:border-semantic-error-primary focus:shadow-[0_0_0_1px_rgba(240,68,56,0.1)]",
|
|
3092
|
-
},
|
|
3093
|
-
size: {
|
|
3094
|
-
default: "px-4 py-2.5 text-base",
|
|
3095
|
-
sm: "px-3 py-2 text-sm",
|
|
3096
|
-
},
|
|
3097
|
-
},
|
|
3098
|
-
defaultVariants: {
|
|
3099
|
-
state: "default",
|
|
3100
|
-
size: "default",
|
|
3101
|
-
},
|
|
3102
|
-
}
|
|
3103
|
-
);
|
|
3104
|
-
|
|
3105
|
-
/**
|
|
3106
|
-
* A multi-line text input with label, error state, helper text, character counter, and resize control.
|
|
3107
|
-
*
|
|
3108
|
-
* @example
|
|
3109
|
-
* \`\`\`tsx
|
|
3110
|
-
* <Textarea label="Description" placeholder="Enter description" />
|
|
3111
|
-
* <Textarea label="Notes" error="Too short" showCount maxLength={500} />
|
|
3112
|
-
* <Textarea label="JSON" rows={8} resize="vertical" />
|
|
3113
|
-
* \`\`\`
|
|
3114
|
-
*/
|
|
3115
|
-
export interface TextareaProps
|
|
3116
|
-
extends Omit<React.ComponentProps<"textarea">, "size">,
|
|
3117
|
-
VariantProps<typeof textareaVariants> {
|
|
3118
|
-
/** Size of the textarea \u2014 \`default\` or \`sm\` (compact) */
|
|
3119
|
-
size?: "default" | "sm";
|
|
3120
|
-
/** Label text displayed above the textarea */
|
|
3121
|
-
label?: string;
|
|
3122
|
-
/** Shows red asterisk next to label when true */
|
|
3123
|
-
required?: boolean;
|
|
3124
|
-
/** Helper text displayed below the textarea */
|
|
3125
|
-
helperText?: string;
|
|
3126
|
-
/** Error message \u2014 shows error state with red styling */
|
|
3127
|
-
error?: string;
|
|
3128
|
-
/** Shows character count when maxLength is set */
|
|
3129
|
-
showCount?: boolean;
|
|
3130
|
-
/** Controls CSS resize behavior. Defaults to "none" */
|
|
3131
|
-
resize?: "none" | "vertical" | "horizontal" | "both";
|
|
3132
|
-
/** Additional class for the wrapper container */
|
|
3133
|
-
wrapperClassName?: string;
|
|
3134
|
-
/** Additional class for the label */
|
|
3135
|
-
labelClassName?: string;
|
|
3136
|
-
}
|
|
3137
|
-
|
|
3138
|
-
const Textarea = React.forwardRef(
|
|
3139
|
-
(
|
|
3140
|
-
{
|
|
3141
|
-
className,
|
|
3142
|
-
wrapperClassName,
|
|
3143
|
-
labelClassName,
|
|
3144
|
-
state,
|
|
3145
|
-
size,
|
|
3146
|
-
label,
|
|
3147
|
-
required,
|
|
3148
|
-
helperText,
|
|
3149
|
-
error,
|
|
3150
|
-
showCount,
|
|
3151
|
-
resize = "none",
|
|
3152
|
-
maxLength,
|
|
3153
|
-
rows = 4,
|
|
3154
|
-
value,
|
|
3155
|
-
defaultValue,
|
|
3156
|
-
onChange,
|
|
3157
|
-
disabled,
|
|
3158
|
-
id,
|
|
3159
|
-
...props
|
|
3160
|
-
}: TextareaProps,
|
|
3161
|
-
ref: React.ForwardedRef<HTMLTextAreaElement>
|
|
3162
|
-
) => {
|
|
3163
|
-
// Internal state for character count in uncontrolled mode
|
|
3164
|
-
const [internalValue, setInternalValue] = React.useState(
|
|
3165
|
-
defaultValue ?? ""
|
|
3166
|
-
);
|
|
3167
|
-
|
|
3168
|
-
// Determine if controlled
|
|
3169
|
-
const isControlled = value !== undefined;
|
|
3170
|
-
const currentValue = isControlled ? value : internalValue;
|
|
3171
|
-
|
|
3172
|
-
// Derive state from props
|
|
3173
|
-
const derivedState = error ? "error" : (state ?? "default");
|
|
3174
|
-
|
|
3175
|
-
// Handle change for both controlled and uncontrolled
|
|
3176
|
-
const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
|
|
3177
|
-
if (!isControlled) {
|
|
3178
|
-
setInternalValue(e.target.value);
|
|
3179
|
-
}
|
|
3180
|
-
onChange?.(e);
|
|
3181
|
-
};
|
|
3182
|
-
|
|
3183
|
-
// Character count
|
|
3184
|
-
const charCount = String(currentValue).length;
|
|
3185
|
-
|
|
3186
|
-
// Generate unique IDs for accessibility
|
|
3187
|
-
const generatedId = React.useId();
|
|
3188
|
-
const textareaId = id || generatedId;
|
|
3189
|
-
const helperId = \`\${textareaId}-helper\`;
|
|
3190
|
-
const errorId = \`\${textareaId}-error\`;
|
|
3191
|
-
|
|
3192
|
-
// Determine aria-describedby
|
|
3193
|
-
const ariaDescribedBy = error ? errorId : helperText ? helperId : undefined;
|
|
3194
|
-
|
|
3195
|
-
// Resize class map
|
|
3196
|
-
const resizeClasses: Record<string, string> = {
|
|
3197
|
-
none: "resize-none",
|
|
3198
|
-
vertical: "resize-y",
|
|
3199
|
-
horizontal: "resize-x",
|
|
3200
|
-
both: "resize",
|
|
3201
|
-
};
|
|
3202
|
-
|
|
3203
|
-
return (
|
|
3204
|
-
<div className={cn("flex flex-col gap-1", wrapperClassName)}>
|
|
3205
|
-
{/* Label */}
|
|
3206
|
-
{label && (
|
|
3207
|
-
<label
|
|
3208
|
-
htmlFor={textareaId}
|
|
3209
|
-
className={cn(
|
|
3210
|
-
"text-sm font-medium text-semantic-text-muted",
|
|
3211
|
-
labelClassName
|
|
3212
|
-
)}
|
|
3213
|
-
>
|
|
3214
|
-
{label}
|
|
3215
|
-
{required && (
|
|
3216
|
-
<span className="text-semantic-error-primary ml-0.5">*</span>
|
|
3217
|
-
)}
|
|
3218
|
-
</label>
|
|
3219
|
-
)}
|
|
3220
|
-
|
|
3221
|
-
{/* Textarea */}
|
|
3222
|
-
<textarea
|
|
3223
|
-
ref={ref}
|
|
3224
|
-
id={textareaId}
|
|
3225
|
-
rows={rows}
|
|
3226
|
-
className={cn(
|
|
3227
|
-
textareaVariants({ state: derivedState, size, className }),
|
|
3228
|
-
resizeClasses[resize]
|
|
3229
|
-
)}
|
|
3230
|
-
disabled={disabled}
|
|
3231
|
-
maxLength={maxLength}
|
|
3232
|
-
value={isControlled ? value : undefined}
|
|
3233
|
-
defaultValue={!isControlled ? defaultValue : undefined}
|
|
3234
|
-
onChange={handleChange}
|
|
3235
|
-
aria-invalid={!!error}
|
|
3236
|
-
aria-describedby={ariaDescribedBy}
|
|
3237
|
-
{...props}
|
|
3238
|
-
/>
|
|
3239
|
-
|
|
3240
|
-
{/* Helper text / Error message / Character count */}
|
|
3241
|
-
{(error || helperText || (showCount && maxLength)) && (
|
|
3242
|
-
<div className="flex justify-between items-start gap-2">
|
|
3243
|
-
{error ? (
|
|
3244
|
-
<span
|
|
3245
|
-
id={errorId}
|
|
3246
|
-
className="text-sm text-semantic-error-primary"
|
|
3247
|
-
>
|
|
3248
|
-
{error}
|
|
3249
|
-
</span>
|
|
3250
|
-
) : helperText ? (
|
|
3251
|
-
<span id={helperId} className="text-sm text-semantic-text-muted">
|
|
3252
|
-
{helperText}
|
|
3253
|
-
</span>
|
|
3254
|
-
) : (
|
|
3255
|
-
<span />
|
|
3256
|
-
)}
|
|
3257
|
-
{showCount && maxLength && (
|
|
3258
|
-
<span
|
|
3259
|
-
className={cn(
|
|
3260
|
-
"text-sm",
|
|
3261
|
-
charCount > maxLength
|
|
3262
|
-
? "text-semantic-error-primary"
|
|
3263
|
-
: "text-semantic-text-muted"
|
|
3264
|
-
)}
|
|
3265
|
-
>
|
|
3266
|
-
{charCount}/{maxLength}
|
|
3267
|
-
</span>
|
|
3268
|
-
)}
|
|
3269
|
-
</div>
|
|
3270
|
-
)}
|
|
3271
|
-
</div>
|
|
3272
|
-
);
|
|
3273
|
-
}
|
|
3274
|
-
);
|
|
3275
|
-
Textarea.displayName = "Textarea";
|
|
3276
|
-
|
|
3277
|
-
export { Textarea, textareaVariants };
|
|
3278
2718
|
`, prefix)
|
|
3279
2719
|
}
|
|
3280
2720
|
]
|
|
@@ -3345,7 +2785,7 @@ export interface ReadableFieldProps
|
|
|
3345
2785
|
* />
|
|
3346
2786
|
* \`\`\`
|
|
3347
2787
|
*/
|
|
3348
|
-
export const ReadableField = React.forwardRef(
|
|
2788
|
+
export const ReadableField = React.forwardRef<HTMLDivElement, ReadableFieldProps>(
|
|
3349
2789
|
(
|
|
3350
2790
|
{
|
|
3351
2791
|
label,
|
|
@@ -3357,8 +2797,8 @@ export const ReadableField = React.forwardRef(
|
|
|
3357
2797
|
className,
|
|
3358
2798
|
inputClassName,
|
|
3359
2799
|
...props
|
|
3360
|
-
}
|
|
3361
|
-
ref
|
|
2800
|
+
},
|
|
2801
|
+
ref
|
|
3362
2802
|
) => {
|
|
3363
2803
|
const [copied, setCopied] = React.useState(false);
|
|
3364
2804
|
const [isVisible, setIsVisible] = React.useState(!secret);
|
|
@@ -3612,7 +3052,7 @@ export interface SelectFieldProps {
|
|
|
3612
3052
|
* />
|
|
3613
3053
|
* \`\`\`
|
|
3614
3054
|
*/
|
|
3615
|
-
const SelectField = React.forwardRef(
|
|
3055
|
+
const SelectField = React.forwardRef<HTMLButtonElement, SelectFieldProps>(
|
|
3616
3056
|
(
|
|
3617
3057
|
{
|
|
3618
3058
|
label,
|
|
@@ -3635,8 +3075,8 @@ const SelectField = React.forwardRef(
|
|
|
3635
3075
|
labelClassName,
|
|
3636
3076
|
id,
|
|
3637
3077
|
name,
|
|
3638
|
-
}
|
|
3639
|
-
ref
|
|
3078
|
+
},
|
|
3079
|
+
ref
|
|
3640
3080
|
) => {
|
|
3641
3081
|
// Internal state for search
|
|
3642
3082
|
const [searchQuery, setSearchQuery] = React.useState("");
|
|
@@ -3964,7 +3404,7 @@ export interface MultiSelectProps extends VariantProps<
|
|
|
3964
3404
|
* />
|
|
3965
3405
|
* \`\`\`
|
|
3966
3406
|
*/
|
|
3967
|
-
const MultiSelect = React.forwardRef(
|
|
3407
|
+
const MultiSelect = React.forwardRef<HTMLButtonElement, MultiSelectProps>(
|
|
3968
3408
|
(
|
|
3969
3409
|
{
|
|
3970
3410
|
label,
|
|
@@ -3987,8 +3427,8 @@ const MultiSelect = React.forwardRef(
|
|
|
3987
3427
|
state,
|
|
3988
3428
|
id,
|
|
3989
3429
|
name,
|
|
3990
|
-
}
|
|
3991
|
-
ref
|
|
3430
|
+
},
|
|
3431
|
+
ref
|
|
3992
3432
|
) => {
|
|
3993
3433
|
// Internal state for selected values (uncontrolled mode)
|
|
3994
3434
|
const [internalValue, setInternalValue] =
|
|
@@ -4011,6 +3451,7 @@ const MultiSelect = React.forwardRef(
|
|
|
4011
3451
|
// Generate unique IDs for accessibility
|
|
4012
3452
|
const generatedId = React.useId();
|
|
4013
3453
|
const selectId = id || generatedId;
|
|
3454
|
+
const listboxId = \`\${selectId}-listbox\`;
|
|
4014
3455
|
const helperId = \`\${selectId}-helper\`;
|
|
4015
3456
|
const errorId = \`\${selectId}-error\`;
|
|
4016
3457
|
|
|
@@ -4124,6 +3565,7 @@ const MultiSelect = React.forwardRef(
|
|
|
4124
3565
|
role="combobox"
|
|
4125
3566
|
aria-expanded={isOpen}
|
|
4126
3567
|
aria-haspopup="listbox"
|
|
3568
|
+
aria-controls={listboxId}
|
|
4127
3569
|
aria-invalid={!!error}
|
|
4128
3570
|
aria-describedby={ariaDescribedBy}
|
|
4129
3571
|
disabled={disabled || loading}
|
|
@@ -4203,6 +3645,7 @@ const MultiSelect = React.forwardRef(
|
|
|
4203
3645
|
{/* Dropdown */}
|
|
4204
3646
|
{isOpen && (
|
|
4205
3647
|
<div
|
|
3648
|
+
id={listboxId}
|
|
4206
3649
|
className={cn(
|
|
4207
3650
|
"absolute z-50 mt-1 w-full rounded bg-semantic-bg-primary border border-semantic-border-layout shadow-md",
|
|
4208
3651
|
"top-full"
|
|
@@ -4372,7 +3815,7 @@ export interface CreatableSelectProps
|
|
|
4372
3815
|
maxLength?: number
|
|
4373
3816
|
}
|
|
4374
3817
|
|
|
4375
|
-
const CreatableSelect = React.forwardRef(
|
|
3818
|
+
const CreatableSelect = React.forwardRef<HTMLDivElement, CreatableSelectProps>(
|
|
4376
3819
|
(
|
|
4377
3820
|
{
|
|
4378
3821
|
className,
|
|
@@ -4385,8 +3828,8 @@ const CreatableSelect = React.forwardRef(
|
|
|
4385
3828
|
disabled = false,
|
|
4386
3829
|
maxLength,
|
|
4387
3830
|
...props
|
|
4388
|
-
}
|
|
4389
|
-
ref
|
|
3831
|
+
},
|
|
3832
|
+
ref
|
|
4390
3833
|
) => {
|
|
4391
3834
|
const [open, setOpen] = React.useState(false)
|
|
4392
3835
|
const [search, setSearch] = React.useState("")
|
|
@@ -4394,6 +3837,7 @@ const CreatableSelect = React.forwardRef(
|
|
|
4394
3837
|
const containerRef = React.useRef<HTMLDivElement>(null)
|
|
4395
3838
|
const inputRef = React.useRef<HTMLInputElement>(null)
|
|
4396
3839
|
const listRef = React.useRef<HTMLDivElement>(null)
|
|
3840
|
+
const listboxId = React.useId()
|
|
4397
3841
|
|
|
4398
3842
|
// Merge forwarded ref with internal ref
|
|
4399
3843
|
React.useImperativeHandle(ref, () => containerRef.current!)
|
|
@@ -4536,6 +3980,7 @@ const CreatableSelect = React.forwardRef(
|
|
|
4536
3980
|
placeholder={selectedLabel || placeholder}
|
|
4537
3981
|
aria-expanded="true"
|
|
4538
3982
|
aria-haspopup="listbox"
|
|
3983
|
+
aria-controls={listboxId}
|
|
4539
3984
|
role="combobox"
|
|
4540
3985
|
aria-autocomplete="list"
|
|
4541
3986
|
/>
|
|
@@ -4552,6 +3997,7 @@ const CreatableSelect = React.forwardRef(
|
|
|
4552
3997
|
)}
|
|
4553
3998
|
aria-haspopup="listbox"
|
|
4554
3999
|
aria-expanded="false"
|
|
4000
|
+
aria-controls={listboxId}
|
|
4555
4001
|
>
|
|
4556
4002
|
<span
|
|
4557
4003
|
className={cn(
|
|
@@ -4581,6 +4027,7 @@ const CreatableSelect = React.forwardRef(
|
|
|
4581
4027
|
{/* Options list */}
|
|
4582
4028
|
<div
|
|
4583
4029
|
ref={listRef}
|
|
4030
|
+
id={listboxId}
|
|
4584
4031
|
role="listbox"
|
|
4585
4032
|
className="max-h-60 overflow-y-auto p-1"
|
|
4586
4033
|
>
|
|
@@ -4717,7 +4164,10 @@ export interface CreatableMultiSelectProps
|
|
|
4717
4164
|
maxLengthPerItem?: number
|
|
4718
4165
|
}
|
|
4719
4166
|
|
|
4720
|
-
const CreatableMultiSelect = React.forwardRef
|
|
4167
|
+
const CreatableMultiSelect = React.forwardRef<
|
|
4168
|
+
HTMLDivElement,
|
|
4169
|
+
CreatableMultiSelectProps
|
|
4170
|
+
>(
|
|
4721
4171
|
(
|
|
4722
4172
|
{
|
|
4723
4173
|
className,
|
|
@@ -4732,13 +4182,14 @@ const CreatableMultiSelect = React.forwardRef(
|
|
|
4732
4182
|
maxItems,
|
|
4733
4183
|
maxLengthPerItem,
|
|
4734
4184
|
...props
|
|
4735
|
-
}
|
|
4736
|
-
ref
|
|
4185
|
+
},
|
|
4186
|
+
ref
|
|
4737
4187
|
) => {
|
|
4738
4188
|
const [isOpen, setIsOpen] = React.useState(false)
|
|
4739
4189
|
const [inputValue, setInputValue] = React.useState("")
|
|
4740
4190
|
const containerRef = React.useRef<HTMLDivElement>(null)
|
|
4741
4191
|
const inputRef = React.useRef<HTMLInputElement>(null)
|
|
4192
|
+
const listboxId = React.useId()
|
|
4742
4193
|
|
|
4743
4194
|
React.useImperativeHandle(ref, () => containerRef.current!)
|
|
4744
4195
|
|
|
@@ -4876,6 +4327,7 @@ const CreatableMultiSelect = React.forwardRef(
|
|
|
4876
4327
|
className="flex-1 min-w-[100px] text-base bg-transparent outline-none text-semantic-text-primary placeholder:text-semantic-text-muted"
|
|
4877
4328
|
role="combobox"
|
|
4878
4329
|
aria-expanded={isOpen}
|
|
4330
|
+
aria-controls={listboxId}
|
|
4879
4331
|
aria-haspopup="listbox"
|
|
4880
4332
|
/>
|
|
4881
4333
|
|
|
@@ -4889,7 +4341,7 @@ const CreatableMultiSelect = React.forwardRef(
|
|
|
4889
4341
|
|
|
4890
4342
|
{/* Dropdown panel */}
|
|
4891
4343
|
{isOpen && (
|
|
4892
|
-
<div className="absolute z-[9999] top-full mt-1 w-full bg-semantic-bg-primary border border-semantic-border-layout rounded shadow-md animate-in fade-in-0 zoom-in-95 slide-in-from-top-2 duration-200">
|
|
4344
|
+
<div id={listboxId} role="listbox" className="absolute z-[9999] top-full mt-1 w-full bg-semantic-bg-primary border border-semantic-border-layout rounded shadow-md animate-in fade-in-0 zoom-in-95 slide-in-from-top-2 duration-200">
|
|
4893
4345
|
{/* Creatable hint \u2014 Enter key */}
|
|
4894
4346
|
<div className="flex items-center justify-between px-4 py-2 border-b border-semantic-border-layout">
|
|
4895
4347
|
<span className="text-sm text-semantic-text-muted">
|
|
@@ -5028,8 +4480,8 @@ export interface TableProps
|
|
|
5028
4480
|
wrapContent?: boolean;
|
|
5029
4481
|
}
|
|
5030
4482
|
|
|
5031
|
-
const Table = React.forwardRef(
|
|
5032
|
-
({ className, size, withoutBorder, wrapContent, ...props }
|
|
4483
|
+
const Table = React.forwardRef<HTMLTableElement, TableProps>(
|
|
4484
|
+
({ className, size, withoutBorder, wrapContent, ...props }, ref) => (
|
|
5033
4485
|
<div
|
|
5034
4486
|
className={cn(
|
|
5035
4487
|
"relative w-full overflow-auto",
|
|
@@ -5050,7 +4502,10 @@ const Table = React.forwardRef(
|
|
|
5050
4502
|
);
|
|
5051
4503
|
Table.displayName = "Table";
|
|
5052
4504
|
|
|
5053
|
-
const TableHeader = React.forwardRef
|
|
4505
|
+
const TableHeader = React.forwardRef<
|
|
4506
|
+
HTMLTableSectionElement,
|
|
4507
|
+
React.HTMLAttributes<HTMLTableSectionElement>
|
|
4508
|
+
>(({ className, ...props }, ref) => (
|
|
5054
4509
|
<thead
|
|
5055
4510
|
ref={ref}
|
|
5056
4511
|
className={cn("bg-[var(--color-neutral-100)] [&_tr]:border-b", className)}
|
|
@@ -5069,8 +4524,8 @@ export interface TableBodyProps
|
|
|
5069
4524
|
loadingColumns?: number;
|
|
5070
4525
|
}
|
|
5071
4526
|
|
|
5072
|
-
const TableBody = React.forwardRef(
|
|
5073
|
-
({ className, isLoading, loadingRows = 5, loadingColumns = 5, children, ...props }
|
|
4527
|
+
const TableBody = React.forwardRef<HTMLTableSectionElement, TableBodyProps>(
|
|
4528
|
+
({ className, isLoading, loadingRows = 5, loadingColumns = 5, children, ...props }, ref) => (
|
|
5074
4529
|
<tbody
|
|
5075
4530
|
ref={ref}
|
|
5076
4531
|
className={cn("[&_tr:last-child]:border-0", className)}
|
|
@@ -5086,7 +4541,10 @@ const TableBody = React.forwardRef(
|
|
|
5086
4541
|
);
|
|
5087
4542
|
TableBody.displayName = "TableBody";
|
|
5088
4543
|
|
|
5089
|
-
const TableFooter = React.forwardRef
|
|
4544
|
+
const TableFooter = React.forwardRef<
|
|
4545
|
+
HTMLTableSectionElement,
|
|
4546
|
+
React.HTMLAttributes<HTMLTableSectionElement>
|
|
4547
|
+
>(({ className, ...props }, ref) => (
|
|
5090
4548
|
<tfoot
|
|
5091
4549
|
ref={ref}
|
|
5092
4550
|
className={cn(
|
|
@@ -5103,8 +4561,8 @@ export interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement>
|
|
|
5103
4561
|
highlighted?: boolean;
|
|
5104
4562
|
}
|
|
5105
4563
|
|
|
5106
|
-
const TableRow = React.forwardRef(
|
|
5107
|
-
({ className, highlighted, ...props }
|
|
4564
|
+
const TableRow = React.forwardRef<HTMLTableRowElement, TableRowProps>(
|
|
4565
|
+
({ className, highlighted, ...props }, ref) => (
|
|
5108
4566
|
<tr
|
|
5109
4567
|
ref={ref}
|
|
5110
4568
|
className={cn(
|
|
@@ -5129,10 +4587,10 @@ export interface TableHeadProps extends React.ThHTMLAttributes<HTMLTableCellElem
|
|
|
5129
4587
|
infoTooltip?: string;
|
|
5130
4588
|
}
|
|
5131
4589
|
|
|
5132
|
-
const TableHead = React.forwardRef(
|
|
4590
|
+
const TableHead = React.forwardRef<HTMLTableCellElement, TableHeadProps>(
|
|
5133
4591
|
(
|
|
5134
|
-
{ className, sticky, sortDirection, infoTooltip, children, ...props }
|
|
5135
|
-
ref
|
|
4592
|
+
{ className, sticky, sortDirection, infoTooltip, children, ...props },
|
|
4593
|
+
ref
|
|
5136
4594
|
) => (
|
|
5137
4595
|
<th
|
|
5138
4596
|
ref={ref}
|
|
@@ -5170,8 +4628,8 @@ export interface TableCellProps extends React.TdHTMLAttributes<HTMLTableCellElem
|
|
|
5170
4628
|
sticky?: boolean;
|
|
5171
4629
|
}
|
|
5172
4630
|
|
|
5173
|
-
const TableCell = React.forwardRef(
|
|
5174
|
-
({ className, sticky, ...props }
|
|
4631
|
+
const TableCell = React.forwardRef<HTMLTableCellElement, TableCellProps>(
|
|
4632
|
+
({ className, sticky, ...props }, ref) => (
|
|
5175
4633
|
<td
|
|
5176
4634
|
ref={ref}
|
|
5177
4635
|
className={cn(
|
|
@@ -5185,7 +4643,10 @@ const TableCell = React.forwardRef(
|
|
|
5185
4643
|
);
|
|
5186
4644
|
TableCell.displayName = "TableCell";
|
|
5187
4645
|
|
|
5188
|
-
const TableCaption = React.forwardRef
|
|
4646
|
+
const TableCaption = React.forwardRef<
|
|
4647
|
+
HTMLTableCaptionElement,
|
|
4648
|
+
React.HTMLAttributes<HTMLTableCaptionElement>
|
|
4649
|
+
>(({ className, ...props }, ref) => (
|
|
5189
4650
|
<caption
|
|
5190
4651
|
ref={ref}
|
|
5191
4652
|
className={cn("mt-4 text-sm text-semantic-text-muted", className)}
|
|
@@ -5274,8 +4735,8 @@ export interface TableToggleProps extends Omit<SwitchProps, "size"> {
|
|
|
5274
4735
|
size?: "sm" | "default";
|
|
5275
4736
|
}
|
|
5276
4737
|
|
|
5277
|
-
const TableToggle = React.forwardRef(
|
|
5278
|
-
({ size = "sm", ...props }
|
|
4738
|
+
const TableToggle = React.forwardRef<HTMLButtonElement, TableToggleProps>(
|
|
4739
|
+
({ size = "sm", ...props }, ref) => (
|
|
5279
4740
|
<Switch ref={ref} size={size} {...props} />
|
|
5280
4741
|
)
|
|
5281
4742
|
);
|
|
@@ -5340,7 +4801,10 @@ export interface TabsListProps
|
|
|
5340
4801
|
fullWidth?: boolean
|
|
5341
4802
|
}
|
|
5342
4803
|
|
|
5343
|
-
const TabsList = React.forwardRef
|
|
4804
|
+
const TabsList = React.forwardRef<
|
|
4805
|
+
React.ComponentRef<typeof TabsPrimitive.List>,
|
|
4806
|
+
TabsListProps
|
|
4807
|
+
>(({ className, fullWidth, ...props }, ref) => (
|
|
5344
4808
|
<TabsPrimitive.List
|
|
5345
4809
|
ref={ref}
|
|
5346
4810
|
className={cn(
|
|
@@ -5353,7 +4817,10 @@ const TabsList = React.forwardRef(({ className, fullWidth, ...props }: TabsListP
|
|
|
5353
4817
|
))
|
|
5354
4818
|
TabsList.displayName = TabsPrimitive.List.displayName
|
|
5355
4819
|
|
|
5356
|
-
const TabsTrigger = React.forwardRef
|
|
4820
|
+
const TabsTrigger = React.forwardRef<
|
|
4821
|
+
React.ComponentRef<typeof TabsPrimitive.Trigger>,
|
|
4822
|
+
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
|
|
4823
|
+
>(({ className, ...props }, ref) => (
|
|
5357
4824
|
<TabsPrimitive.Trigger
|
|
5358
4825
|
ref={ref}
|
|
5359
4826
|
className={cn(
|
|
@@ -5368,7 +4835,10 @@ const TabsTrigger = React.forwardRef(({ className, ...props }: React.ComponentPr
|
|
|
5368
4835
|
))
|
|
5369
4836
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName
|
|
5370
4837
|
|
|
5371
|
-
const TabsContent = React.forwardRef
|
|
4838
|
+
const TabsContent = React.forwardRef<
|
|
4839
|
+
React.ComponentRef<typeof TabsPrimitive.Content>,
|
|
4840
|
+
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
|
|
4841
|
+
>(({ className, ...props }, ref) => (
|
|
5372
4842
|
<TabsPrimitive.Content
|
|
5373
4843
|
ref={ref}
|
|
5374
4844
|
className={cn(
|
|
@@ -5415,7 +4885,10 @@ const DialogPortal = DialogPrimitive.Portal;
|
|
|
5415
4885
|
|
|
5416
4886
|
const DialogClose = DialogPrimitive.Close;
|
|
5417
4887
|
|
|
5418
|
-
const DialogOverlay = React.forwardRef
|
|
4888
|
+
const DialogOverlay = React.forwardRef<
|
|
4889
|
+
React.ElementRef<typeof DialogPrimitive.Overlay>,
|
|
4890
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
|
|
4891
|
+
>(({ className, ...props }, ref) => (
|
|
5419
4892
|
<DialogPrimitive.Overlay
|
|
5420
4893
|
ref={ref}
|
|
5421
4894
|
className={cn(
|
|
@@ -5473,7 +4946,10 @@ const hasDialogDescription = (children: React.ReactNode): boolean => {
|
|
|
5473
4946
|
return found;
|
|
5474
4947
|
};
|
|
5475
4948
|
|
|
5476
|
-
const DialogContent = React.forwardRef
|
|
4949
|
+
const DialogContent = React.forwardRef<
|
|
4950
|
+
React.ElementRef<typeof DialogPrimitive.Content>,
|
|
4951
|
+
DialogContentProps
|
|
4952
|
+
>(({ className, children, size, hideCloseButton = false, ...props }, ref) => {
|
|
5477
4953
|
const hasDescription = hasDialogDescription(children);
|
|
5478
4954
|
|
|
5479
4955
|
return (
|
|
@@ -5531,7 +5007,10 @@ const DialogFooter = ({
|
|
|
5531
5007
|
);
|
|
5532
5008
|
DialogFooter.displayName = "DialogFooter";
|
|
5533
5009
|
|
|
5534
|
-
const DialogTitle = React.forwardRef
|
|
5010
|
+
const DialogTitle = React.forwardRef<
|
|
5011
|
+
React.ElementRef<typeof DialogPrimitive.Title>,
|
|
5012
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
|
|
5013
|
+
>(({ className, ...props }, ref) => (
|
|
5535
5014
|
<DialogPrimitive.Title
|
|
5536
5015
|
ref={ref}
|
|
5537
5016
|
className={cn(
|
|
@@ -5543,7 +5022,10 @@ const DialogTitle = React.forwardRef(({ className, ...props }: React.ComponentPr
|
|
|
5543
5022
|
));
|
|
5544
5023
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
5545
5024
|
|
|
5546
|
-
const DialogDescription = React.forwardRef
|
|
5025
|
+
const DialogDescription = React.forwardRef<
|
|
5026
|
+
React.ElementRef<typeof DialogPrimitive.Description>,
|
|
5027
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
|
|
5028
|
+
>(({ className, ...props }, ref) => (
|
|
5547
5029
|
<DialogPrimitive.Description
|
|
5548
5030
|
ref={ref}
|
|
5549
5031
|
className={cn("text-sm text-muted-foreground", className)}
|
|
@@ -5591,7 +5073,10 @@ import { cn } from "../../lib/utils";
|
|
|
5591
5073
|
|
|
5592
5074
|
const DropdownMenu = DropdownMenuPrimitive.Root;
|
|
5593
5075
|
|
|
5594
|
-
const DropdownMenuTrigger = React.forwardRef
|
|
5076
|
+
const DropdownMenuTrigger = React.forwardRef<
|
|
5077
|
+
React.ElementRef<typeof DropdownMenuPrimitive.Trigger>,
|
|
5078
|
+
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger>
|
|
5079
|
+
>(({ className, ...props }, ref) => (
|
|
5595
5080
|
<DropdownMenuPrimitive.Trigger
|
|
5596
5081
|
ref={ref}
|
|
5597
5082
|
className={cn("focus-visible:outline-none focus-visible:ring-0", className)}
|
|
@@ -5608,9 +5093,12 @@ const DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
|
5608
5093
|
|
|
5609
5094
|
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
5610
5095
|
|
|
5611
|
-
const DropdownMenuSubTrigger = React.forwardRef
|
|
5096
|
+
const DropdownMenuSubTrigger = React.forwardRef<
|
|
5097
|
+
React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
|
|
5098
|
+
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
5612
5099
|
inset?: boolean;
|
|
5613
|
-
}
|
|
5100
|
+
}
|
|
5101
|
+
>(({ className, inset, children, ...props }, ref) => (
|
|
5614
5102
|
<DropdownMenuPrimitive.SubTrigger
|
|
5615
5103
|
ref={ref}
|
|
5616
5104
|
className={cn(
|
|
@@ -5627,7 +5115,10 @@ const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, .
|
|
|
5627
5115
|
DropdownMenuSubTrigger.displayName =
|
|
5628
5116
|
DropdownMenuPrimitive.SubTrigger.displayName;
|
|
5629
5117
|
|
|
5630
|
-
const DropdownMenuSubContent = React.forwardRef
|
|
5118
|
+
const DropdownMenuSubContent = React.forwardRef<
|
|
5119
|
+
React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
|
|
5120
|
+
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
|
|
5121
|
+
>(({ className, ...props }, ref) => (
|
|
5631
5122
|
<DropdownMenuPrimitive.SubContent
|
|
5632
5123
|
ref={ref}
|
|
5633
5124
|
className={cn(
|
|
@@ -5640,7 +5131,10 @@ const DropdownMenuSubContent = React.forwardRef(({ className, ...props }: React.
|
|
|
5640
5131
|
DropdownMenuSubContent.displayName =
|
|
5641
5132
|
DropdownMenuPrimitive.SubContent.displayName;
|
|
5642
5133
|
|
|
5643
|
-
const DropdownMenuContent = React.forwardRef
|
|
5134
|
+
const DropdownMenuContent = React.forwardRef<
|
|
5135
|
+
React.ElementRef<typeof DropdownMenuPrimitive.Content>,
|
|
5136
|
+
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
|
|
5137
|
+
>(({ className, sideOffset = 4, ...props }, ref) => (
|
|
5644
5138
|
<DropdownMenuPrimitive.Portal>
|
|
5645
5139
|
<DropdownMenuPrimitive.Content
|
|
5646
5140
|
ref={ref}
|
|
@@ -5656,13 +5150,16 @@ const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...pr
|
|
|
5656
5150
|
));
|
|
5657
5151
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
5658
5152
|
|
|
5659
|
-
const DropdownMenuItem = React.forwardRef
|
|
5153
|
+
const DropdownMenuItem = React.forwardRef<
|
|
5154
|
+
React.ElementRef<typeof DropdownMenuPrimitive.Item>,
|
|
5155
|
+
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
|
|
5660
5156
|
inset?: boolean;
|
|
5661
5157
|
/** Secondary text displayed below children */
|
|
5662
5158
|
description?: string;
|
|
5663
5159
|
/** Content displayed at the right edge of the item */
|
|
5664
5160
|
suffix?: React.ReactNode;
|
|
5665
|
-
}
|
|
5161
|
+
}
|
|
5162
|
+
>(({ className, inset, children, description, suffix, ...props }, ref) => (
|
|
5666
5163
|
<DropdownMenuPrimitive.Item
|
|
5667
5164
|
ref={ref}
|
|
5668
5165
|
className={cn(
|
|
@@ -5687,12 +5184,15 @@ const DropdownMenuItem = React.forwardRef(({ className, inset, children, descrip
|
|
|
5687
5184
|
));
|
|
5688
5185
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
5689
5186
|
|
|
5690
|
-
const DropdownMenuCheckboxItem = React.forwardRef
|
|
5187
|
+
const DropdownMenuCheckboxItem = React.forwardRef<
|
|
5188
|
+
React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
|
|
5189
|
+
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem> & {
|
|
5691
5190
|
/** Secondary text displayed below children */
|
|
5692
5191
|
description?: string;
|
|
5693
5192
|
/** Content displayed at the right edge of the item */
|
|
5694
5193
|
suffix?: React.ReactNode;
|
|
5695
|
-
}
|
|
5194
|
+
}
|
|
5195
|
+
>(({ className, children, checked, description, suffix, ...props }, ref) => (
|
|
5696
5196
|
<DropdownMenuPrimitive.CheckboxItem
|
|
5697
5197
|
ref={ref}
|
|
5698
5198
|
className={cn(
|
|
@@ -5723,12 +5223,15 @@ const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checke
|
|
|
5723
5223
|
DropdownMenuCheckboxItem.displayName =
|
|
5724
5224
|
DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
5725
5225
|
|
|
5726
|
-
const DropdownMenuRadioItem = React.forwardRef
|
|
5226
|
+
const DropdownMenuRadioItem = React.forwardRef<
|
|
5227
|
+
React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
|
|
5228
|
+
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem> & {
|
|
5727
5229
|
/** Secondary text displayed below children */
|
|
5728
5230
|
description?: string;
|
|
5729
5231
|
/** Content displayed at the right edge of the item */
|
|
5730
5232
|
suffix?: React.ReactNode;
|
|
5731
|
-
}
|
|
5233
|
+
}
|
|
5234
|
+
>(({ className, children, description, suffix, ...props }, ref) => (
|
|
5732
5235
|
<DropdownMenuPrimitive.RadioItem
|
|
5733
5236
|
ref={ref}
|
|
5734
5237
|
className={cn(
|
|
@@ -5757,9 +5260,12 @@ const DropdownMenuRadioItem = React.forwardRef(({ className, children, descripti
|
|
|
5757
5260
|
));
|
|
5758
5261
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
5759
5262
|
|
|
5760
|
-
const DropdownMenuLabel = React.forwardRef
|
|
5263
|
+
const DropdownMenuLabel = React.forwardRef<
|
|
5264
|
+
React.ElementRef<typeof DropdownMenuPrimitive.Label>,
|
|
5265
|
+
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
|
|
5761
5266
|
inset?: boolean;
|
|
5762
|
-
}
|
|
5267
|
+
}
|
|
5268
|
+
>(({ className, inset, ...props }, ref) => (
|
|
5763
5269
|
<DropdownMenuPrimitive.Label
|
|
5764
5270
|
ref={ref}
|
|
5765
5271
|
className={cn(
|
|
@@ -5772,7 +5278,10 @@ const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }: Reac
|
|
|
5772
5278
|
));
|
|
5773
5279
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
5774
5280
|
|
|
5775
|
-
const DropdownMenuSeparator = React.forwardRef
|
|
5281
|
+
const DropdownMenuSeparator = React.forwardRef<
|
|
5282
|
+
React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
|
|
5283
|
+
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
|
|
5284
|
+
>(({ className, ...props }, ref) => (
|
|
5776
5285
|
<DropdownMenuPrimitive.Separator
|
|
5777
5286
|
ref={ref}
|
|
5778
5287
|
className={cn("-mx-1 my-1 h-px bg-semantic-border-layout", className)}
|
|
@@ -5839,7 +5348,10 @@ const Tooltip = TooltipPrimitive.Root;
|
|
|
5839
5348
|
|
|
5840
5349
|
const TooltipTrigger = TooltipPrimitive.Trigger;
|
|
5841
5350
|
|
|
5842
|
-
const TooltipContent = React.forwardRef
|
|
5351
|
+
const TooltipContent = React.forwardRef<
|
|
5352
|
+
React.ElementRef<typeof TooltipPrimitive.Content>,
|
|
5353
|
+
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
|
|
5354
|
+
>(({ className, sideOffset = 4, ...props }, ref) => (
|
|
5843
5355
|
<TooltipPrimitive.Portal>
|
|
5844
5356
|
<TooltipPrimitive.Content
|
|
5845
5357
|
ref={ref}
|
|
@@ -5854,7 +5366,10 @@ const TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }
|
|
|
5854
5366
|
));
|
|
5855
5367
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
5856
5368
|
|
|
5857
|
-
const TooltipArrow = React.forwardRef
|
|
5369
|
+
const TooltipArrow = React.forwardRef<
|
|
5370
|
+
React.ElementRef<typeof TooltipPrimitive.Arrow>,
|
|
5371
|
+
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>
|
|
5372
|
+
>(({ className, ...props }, ref) => (
|
|
5858
5373
|
<TooltipPrimitive.Arrow
|
|
5859
5374
|
ref={ref}
|
|
5860
5375
|
className={cn("fill-semantic-primary", className)}
|
|
@@ -5958,7 +5473,10 @@ export interface DeleteConfirmationModalProps {
|
|
|
5958
5473
|
* />
|
|
5959
5474
|
* \`\`\`
|
|
5960
5475
|
*/
|
|
5961
|
-
const DeleteConfirmationModal = React.forwardRef
|
|
5476
|
+
const DeleteConfirmationModal = React.forwardRef<
|
|
5477
|
+
HTMLDivElement,
|
|
5478
|
+
DeleteConfirmationModalProps
|
|
5479
|
+
>(
|
|
5962
5480
|
(
|
|
5963
5481
|
{
|
|
5964
5482
|
open,
|
|
@@ -5974,8 +5492,8 @@ const DeleteConfirmationModal = React.forwardRef(
|
|
|
5974
5492
|
cancelButtonText = "Cancel",
|
|
5975
5493
|
trigger,
|
|
5976
5494
|
className,
|
|
5977
|
-
}
|
|
5978
|
-
ref
|
|
5495
|
+
},
|
|
5496
|
+
ref
|
|
5979
5497
|
) => {
|
|
5980
5498
|
const [inputValue, setInputValue] = React.useState("");
|
|
5981
5499
|
const isConfirmEnabled = inputValue === confirmText;
|
|
@@ -6143,7 +5661,10 @@ export interface ConfirmationModalProps {
|
|
|
6143
5661
|
* />
|
|
6144
5662
|
* \`\`\`
|
|
6145
5663
|
*/
|
|
6146
|
-
const ConfirmationModal = React.forwardRef
|
|
5664
|
+
const ConfirmationModal = React.forwardRef<
|
|
5665
|
+
HTMLDivElement,
|
|
5666
|
+
ConfirmationModalProps
|
|
5667
|
+
>(
|
|
6147
5668
|
(
|
|
6148
5669
|
{
|
|
6149
5670
|
open,
|
|
@@ -6158,8 +5679,8 @@ const ConfirmationModal = React.forwardRef(
|
|
|
6158
5679
|
cancelButtonText = "Cancel",
|
|
6159
5680
|
trigger,
|
|
6160
5681
|
className,
|
|
6161
|
-
}
|
|
6162
|
-
ref
|
|
5682
|
+
},
|
|
5683
|
+
ref
|
|
6163
5684
|
) => {
|
|
6164
5685
|
const handleConfirm = () => {
|
|
6165
5686
|
onConfirm?.();
|
|
@@ -6291,7 +5812,7 @@ export interface FormModalProps {
|
|
|
6291
5812
|
* </FormModal>
|
|
6292
5813
|
* \`\`\`
|
|
6293
5814
|
*/
|
|
6294
|
-
const FormModal = React.forwardRef(
|
|
5815
|
+
const FormModal = React.forwardRef<HTMLDivElement, FormModalProps>(
|
|
6295
5816
|
(
|
|
6296
5817
|
{
|
|
6297
5818
|
open,
|
|
@@ -6307,8 +5828,8 @@ const FormModal = React.forwardRef(
|
|
|
6307
5828
|
disableSave = false,
|
|
6308
5829
|
className,
|
|
6309
5830
|
size = "sm",
|
|
6310
|
-
}
|
|
6311
|
-
ref
|
|
5831
|
+
},
|
|
5832
|
+
ref
|
|
6312
5833
|
) => {
|
|
6313
5834
|
const handleSave = () => {
|
|
6314
5835
|
onSave?.();
|
|
@@ -6423,8 +5944,8 @@ export interface TagProps
|
|
|
6423
5944
|
label?: string;
|
|
6424
5945
|
}
|
|
6425
5946
|
|
|
6426
|
-
const Tag = React.forwardRef(
|
|
6427
|
-
({ className, variant, size, label, children, ...props }
|
|
5947
|
+
const Tag = React.forwardRef<HTMLSpanElement, TagProps>(
|
|
5948
|
+
({ className, variant, size, label, children, ...props }, ref) => {
|
|
6428
5949
|
return (
|
|
6429
5950
|
<span
|
|
6430
5951
|
className={cn(tagVariants({ variant, size, className }))}
|
|
@@ -6620,7 +6141,7 @@ export interface AlertProps
|
|
|
6620
6141
|
defaultOpen?: boolean;
|
|
6621
6142
|
}
|
|
6622
6143
|
|
|
6623
|
-
const Alert = React.forwardRef(
|
|
6144
|
+
const Alert = React.forwardRef<HTMLDivElement, AlertProps>(
|
|
6624
6145
|
(
|
|
6625
6146
|
{
|
|
6626
6147
|
className,
|
|
@@ -6635,8 +6156,8 @@ const Alert = React.forwardRef(
|
|
|
6635
6156
|
defaultOpen = true,
|
|
6636
6157
|
children,
|
|
6637
6158
|
...props
|
|
6638
|
-
}
|
|
6639
|
-
ref
|
|
6159
|
+
},
|
|
6160
|
+
ref
|
|
6640
6161
|
) => {
|
|
6641
6162
|
const [internalOpen, setInternalOpen] = React.useState(defaultOpen);
|
|
6642
6163
|
const isControlled = controlledOpen !== undefined;
|
|
@@ -6708,19 +6229,27 @@ Alert.displayName = "Alert";
|
|
|
6708
6229
|
/**
|
|
6709
6230
|
* Alert title component for the heading text.
|
|
6710
6231
|
*/
|
|
6711
|
-
const AlertTitle = React.forwardRef
|
|
6232
|
+
const AlertTitle = React.forwardRef<
|
|
6233
|
+
HTMLHeadingElement,
|
|
6234
|
+
React.HTMLAttributes<HTMLHeadingElement>
|
|
6235
|
+
>(({ className, children, ...props }, ref) => (
|
|
6712
6236
|
<h5
|
|
6713
6237
|
ref={ref}
|
|
6714
6238
|
className={cn("font-semibold leading-tight tracking-tight", className)}
|
|
6715
6239
|
{...props}
|
|
6716
|
-
|
|
6240
|
+
>
|
|
6241
|
+
{children}
|
|
6242
|
+
</h5>
|
|
6717
6243
|
));
|
|
6718
6244
|
AlertTitle.displayName = "AlertTitle";
|
|
6719
6245
|
|
|
6720
6246
|
/**
|
|
6721
6247
|
* Alert description component for the body text.
|
|
6722
6248
|
*/
|
|
6723
|
-
const AlertDescription = React.forwardRef
|
|
6249
|
+
const AlertDescription = React.forwardRef<
|
|
6250
|
+
HTMLParagraphElement,
|
|
6251
|
+
React.HTMLAttributes<HTMLParagraphElement>
|
|
6252
|
+
>(({ className, ...props }, ref) => (
|
|
6724
6253
|
<p ref={ref} className={cn("m-0 mt-1 text-sm", className)} {...props} />
|
|
6725
6254
|
));
|
|
6726
6255
|
AlertDescription.displayName = "AlertDescription";
|
|
@@ -6754,7 +6283,10 @@ import { cn } from "../../lib/utils";
|
|
|
6754
6283
|
|
|
6755
6284
|
const ToastProvider = ToastPrimitives.Provider;
|
|
6756
6285
|
|
|
6757
|
-
const ToastViewport = React.forwardRef
|
|
6286
|
+
const ToastViewport = React.forwardRef<
|
|
6287
|
+
React.ElementRef<typeof ToastPrimitives.Viewport>,
|
|
6288
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>
|
|
6289
|
+
>(({ className, ...props }, ref) => (
|
|
6758
6290
|
<ToastPrimitives.Viewport
|
|
6759
6291
|
ref={ref}
|
|
6760
6292
|
className={cn(
|
|
@@ -6788,8 +6320,11 @@ const toastVariants = cva(
|
|
|
6788
6320
|
}
|
|
6789
6321
|
);
|
|
6790
6322
|
|
|
6791
|
-
const Toast = React.forwardRef
|
|
6792
|
-
|
|
6323
|
+
const Toast = React.forwardRef<
|
|
6324
|
+
React.ElementRef<typeof ToastPrimitives.Root>,
|
|
6325
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &
|
|
6326
|
+
VariantProps<typeof toastVariants>
|
|
6327
|
+
>(({ className, variant, ...props }, ref) => {
|
|
6793
6328
|
return (
|
|
6794
6329
|
<ToastPrimitives.Root
|
|
6795
6330
|
ref={ref}
|
|
@@ -6800,7 +6335,10 @@ const Toast = React.forwardRef(({ className, variant, ...props }: React.Componen
|
|
|
6800
6335
|
});
|
|
6801
6336
|
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
6802
6337
|
|
|
6803
|
-
const ToastAction = React.forwardRef
|
|
6338
|
+
const ToastAction = React.forwardRef<
|
|
6339
|
+
React.ElementRef<typeof ToastPrimitives.Action>,
|
|
6340
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>
|
|
6341
|
+
>(({ className, ...props }, ref) => (
|
|
6804
6342
|
<ToastPrimitives.Action
|
|
6805
6343
|
ref={ref}
|
|
6806
6344
|
className={cn(
|
|
@@ -6816,7 +6354,10 @@ const ToastAction = React.forwardRef(({ className, ...props }: React.ComponentPr
|
|
|
6816
6354
|
));
|
|
6817
6355
|
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
6818
6356
|
|
|
6819
|
-
const ToastClose = React.forwardRef
|
|
6357
|
+
const ToastClose = React.forwardRef<
|
|
6358
|
+
React.ElementRef<typeof ToastPrimitives.Close>,
|
|
6359
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>
|
|
6360
|
+
>(({ className, ...props }, ref) => (
|
|
6820
6361
|
<ToastPrimitives.Close
|
|
6821
6362
|
ref={ref}
|
|
6822
6363
|
className={cn(
|
|
@@ -6831,7 +6372,10 @@ const ToastClose = React.forwardRef(({ className, ...props }: React.ComponentPro
|
|
|
6831
6372
|
));
|
|
6832
6373
|
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
6833
6374
|
|
|
6834
|
-
const ToastTitle = React.forwardRef
|
|
6375
|
+
const ToastTitle = React.forwardRef<
|
|
6376
|
+
React.ElementRef<typeof ToastPrimitives.Title>,
|
|
6377
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title>
|
|
6378
|
+
>(({ className, ...props }, ref) => (
|
|
6835
6379
|
<ToastPrimitives.Title
|
|
6836
6380
|
ref={ref}
|
|
6837
6381
|
className={cn("text-sm font-semibold tracking-[0.014px]", className)}
|
|
@@ -6840,7 +6384,10 @@ const ToastTitle = React.forwardRef(({ className, ...props }: React.ComponentPro
|
|
|
6840
6384
|
));
|
|
6841
6385
|
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
6842
6386
|
|
|
6843
|
-
const ToastDescription = React.forwardRef
|
|
6387
|
+
const ToastDescription = React.forwardRef<
|
|
6388
|
+
React.ElementRef<typeof ToastPrimitives.Description>,
|
|
6389
|
+
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description>
|
|
6390
|
+
>(({ className, ...props }, ref) => (
|
|
6844
6391
|
<ToastPrimitives.Description
|
|
6845
6392
|
ref={ref}
|
|
6846
6393
|
className={cn("text-xs tracking-[0.048px]", className)}
|
|
@@ -7289,7 +6836,7 @@ export interface SpinnerProps
|
|
|
7289
6836
|
"aria-label"?: string;
|
|
7290
6837
|
}
|
|
7291
6838
|
|
|
7292
|
-
const Spinner = React.forwardRef(
|
|
6839
|
+
const Spinner = React.forwardRef<HTMLDivElement, SpinnerProps>(
|
|
7293
6840
|
(
|
|
7294
6841
|
{
|
|
7295
6842
|
className,
|
|
@@ -7297,8 +6844,8 @@ const Spinner = React.forwardRef(
|
|
|
7297
6844
|
variant,
|
|
7298
6845
|
"aria-label": ariaLabel = "Loading",
|
|
7299
6846
|
...props
|
|
7300
|
-
}
|
|
7301
|
-
ref
|
|
6847
|
+
},
|
|
6848
|
+
ref
|
|
7302
6849
|
) => {
|
|
7303
6850
|
const strokeWidth = strokeWidths[size || "default"] ?? 3;
|
|
7304
6851
|
const radius = 10;
|
|
@@ -7418,8 +6965,8 @@ export interface SkeletonProps
|
|
|
7418
6965
|
height?: number | string;
|
|
7419
6966
|
}
|
|
7420
6967
|
|
|
7421
|
-
const Skeleton = React.forwardRef(
|
|
7422
|
-
({ className, variant, shape, width, height, style, ...props }
|
|
6968
|
+
const Skeleton = React.forwardRef<HTMLDivElement, SkeletonProps>(
|
|
6969
|
+
({ className, variant, shape, width, height, style, ...props }, ref) => {
|
|
7423
6970
|
const dimensionStyle: React.CSSProperties = {
|
|
7424
6971
|
...style,
|
|
7425
6972
|
...(width !== undefined
|
|
@@ -7662,7 +7209,7 @@ export interface AccordionProps
|
|
|
7662
7209
|
onValueChange?: (value: string[]) => void;
|
|
7663
7210
|
}
|
|
7664
7211
|
|
|
7665
|
-
const Accordion = React.forwardRef(
|
|
7212
|
+
const Accordion = React.forwardRef<HTMLDivElement, AccordionProps>(
|
|
7666
7213
|
(
|
|
7667
7214
|
{
|
|
7668
7215
|
className,
|
|
@@ -7673,8 +7220,8 @@ const Accordion = React.forwardRef(
|
|
|
7673
7220
|
onValueChange,
|
|
7674
7221
|
children,
|
|
7675
7222
|
...props
|
|
7676
|
-
}
|
|
7677
|
-
ref
|
|
7223
|
+
},
|
|
7224
|
+
ref
|
|
7678
7225
|
) => {
|
|
7679
7226
|
const [internalValue, setInternalValue] =
|
|
7680
7227
|
React.useState<string[]>(defaultValue);
|
|
@@ -7730,8 +7277,8 @@ export interface AccordionItemProps
|
|
|
7730
7277
|
disabled?: boolean;
|
|
7731
7278
|
}
|
|
7732
7279
|
|
|
7733
|
-
const AccordionItem = React.forwardRef(
|
|
7734
|
-
({ className, value, disabled, children, ...props }
|
|
7280
|
+
const AccordionItem = React.forwardRef<HTMLDivElement, AccordionItemProps>(
|
|
7281
|
+
({ className, value, disabled, children, ...props }, ref) => {
|
|
7735
7282
|
const { value: openValues, variant } = useAccordionContext();
|
|
7736
7283
|
const isOpen = openValues.includes(value);
|
|
7737
7284
|
|
|
@@ -7771,7 +7318,10 @@ export interface AccordionTriggerProps
|
|
|
7771
7318
|
showChevron?: boolean;
|
|
7772
7319
|
}
|
|
7773
7320
|
|
|
7774
|
-
const AccordionTrigger = React.forwardRef
|
|
7321
|
+
const AccordionTrigger = React.forwardRef<
|
|
7322
|
+
HTMLButtonElement,
|
|
7323
|
+
AccordionTriggerProps
|
|
7324
|
+
>(({ className, showChevron = true, children, ...props }, ref) => {
|
|
7775
7325
|
const {
|
|
7776
7326
|
type,
|
|
7777
7327
|
value: openValues,
|
|
@@ -7830,7 +7380,10 @@ export interface AccordionContentProps
|
|
|
7830
7380
|
React.HTMLAttributes<HTMLDivElement>,
|
|
7831
7381
|
VariantProps<typeof accordionContentVariants> {}
|
|
7832
7382
|
|
|
7833
|
-
const AccordionContent = React.forwardRef
|
|
7383
|
+
const AccordionContent = React.forwardRef<
|
|
7384
|
+
HTMLDivElement,
|
|
7385
|
+
AccordionContentProps
|
|
7386
|
+
>(({ className, children, ...props }, ref) => {
|
|
7834
7387
|
const { variant } = useAccordionContext();
|
|
7835
7388
|
const { isOpen } = useAccordionItemContext();
|
|
7836
7389
|
const contentRef = React.useRef<HTMLDivElement>(null);
|
|
@@ -7962,7 +7515,7 @@ export interface PageHeaderProps
|
|
|
7962
7515
|
mobileOverflowLimit?: number;
|
|
7963
7516
|
}
|
|
7964
7517
|
|
|
7965
|
-
const PageHeader = React.forwardRef(
|
|
7518
|
+
const PageHeader = React.forwardRef<HTMLDivElement, PageHeaderProps>(
|
|
7966
7519
|
(
|
|
7967
7520
|
{
|
|
7968
7521
|
className,
|
|
@@ -7978,8 +7531,8 @@ const PageHeader = React.forwardRef(
|
|
|
7978
7531
|
layout = "responsive",
|
|
7979
7532
|
mobileOverflowLimit = 2,
|
|
7980
7533
|
...props
|
|
7981
|
-
}
|
|
7982
|
-
ref
|
|
7534
|
+
},
|
|
7535
|
+
ref
|
|
7983
7536
|
) => {
|
|
7984
7537
|
// State for overflow expansion (moved to top level)
|
|
7985
7538
|
const [isOverflowExpanded, setIsOverflowExpanded] = React.useState(false);
|
|
@@ -8267,7 +7820,7 @@ export interface PanelProps
|
|
|
8267
7820
|
* </Panel>
|
|
8268
7821
|
* \`\`\`
|
|
8269
7822
|
*/
|
|
8270
|
-
const Panel = React.forwardRef(
|
|
7823
|
+
const Panel = React.forwardRef<HTMLElement, PanelProps>(
|
|
8271
7824
|
(
|
|
8272
7825
|
{
|
|
8273
7826
|
open = true,
|
|
@@ -8281,8 +7834,8 @@ const Panel = React.forwardRef(
|
|
|
8281
7834
|
"aria-label": ariaLabel,
|
|
8282
7835
|
onKeyDown,
|
|
8283
7836
|
...props
|
|
8284
|
-
}
|
|
8285
|
-
ref
|
|
7837
|
+
},
|
|
7838
|
+
ref
|
|
8286
7839
|
) => {
|
|
8287
7840
|
const resolvedSize = size ?? "default";
|
|
8288
7841
|
const widthClass = panelWidths[resolvedSize];
|
|
@@ -8726,7 +8279,10 @@ import type { EventSelectorProps, EventCategory, EventGroup } from "./types";
|
|
|
8726
8279
|
* />
|
|
8727
8280
|
* \`\`\`
|
|
8728
8281
|
*/
|
|
8729
|
-
export const EventSelector = React.forwardRef
|
|
8282
|
+
export const EventSelector = React.forwardRef<
|
|
8283
|
+
HTMLDivElement,
|
|
8284
|
+
EventSelectorProps
|
|
8285
|
+
>(
|
|
8730
8286
|
(
|
|
8731
8287
|
{
|
|
8732
8288
|
events,
|
|
@@ -8741,8 +8297,8 @@ export const EventSelector = React.forwardRef(
|
|
|
8741
8297
|
renderEmptyGroup,
|
|
8742
8298
|
className,
|
|
8743
8299
|
...props
|
|
8744
|
-
}
|
|
8745
|
-
ref
|
|
8300
|
+
},
|
|
8301
|
+
ref
|
|
8746
8302
|
) => {
|
|
8747
8303
|
// Controlled vs uncontrolled state
|
|
8748
8304
|
const [internalSelected, setInternalSelected] = React.useState<string[]>(
|
|
@@ -8903,7 +8459,10 @@ import type { EventGroupComponentProps } from "./types";
|
|
|
8903
8459
|
/**
|
|
8904
8460
|
* Event group with accordion section and group-level checkbox
|
|
8905
8461
|
*/
|
|
8906
|
-
export const EventGroupComponent = React.forwardRef
|
|
8462
|
+
export const EventGroupComponent = React.forwardRef<
|
|
8463
|
+
HTMLDivElement,
|
|
8464
|
+
EventGroupComponentProps & React.HTMLAttributes<HTMLDivElement>
|
|
8465
|
+
>(
|
|
8907
8466
|
(
|
|
8908
8467
|
{
|
|
8909
8468
|
group,
|
|
@@ -8915,8 +8474,8 @@ export const EventGroupComponent = React.forwardRef(
|
|
|
8915
8474
|
defaultExpanded = false,
|
|
8916
8475
|
className,
|
|
8917
8476
|
...props
|
|
8918
|
-
}
|
|
8919
|
-
ref
|
|
8477
|
+
},
|
|
8478
|
+
ref
|
|
8920
8479
|
) => {
|
|
8921
8480
|
// Calculate selection state for this group
|
|
8922
8481
|
const groupEventIds = events.map((e) => e.id);
|
|
@@ -9079,7 +8638,10 @@ import type { EventItemComponentProps } from "./types";
|
|
|
9079
8638
|
/**
|
|
9080
8639
|
* Individual event item with checkbox
|
|
9081
8640
|
*/
|
|
9082
|
-
export const EventItemComponent = React.forwardRef
|
|
8641
|
+
export const EventItemComponent = React.forwardRef<
|
|
8642
|
+
HTMLDivElement,
|
|
8643
|
+
EventItemComponentProps & React.HTMLAttributes<HTMLDivElement>
|
|
8644
|
+
>(({ event, isSelected, onSelectionChange, className, ...props }, ref) => {
|
|
9083
8645
|
return (
|
|
9084
8646
|
<div
|
|
9085
8647
|
ref={ref}
|
|
@@ -9290,7 +8852,10 @@ const generateId = () =>
|
|
|
9290
8852
|
* />
|
|
9291
8853
|
* \`\`\`
|
|
9292
8854
|
*/
|
|
9293
|
-
export const KeyValueInput = React.forwardRef
|
|
8855
|
+
export const KeyValueInput = React.forwardRef<
|
|
8856
|
+
HTMLDivElement,
|
|
8857
|
+
KeyValueInputProps
|
|
8858
|
+
>(
|
|
9294
8859
|
(
|
|
9295
8860
|
{
|
|
9296
8861
|
title,
|
|
@@ -9308,8 +8873,8 @@ export const KeyValueInput = React.forwardRef(
|
|
|
9308
8873
|
defaultValue = [],
|
|
9309
8874
|
className,
|
|
9310
8875
|
...props
|
|
9311
|
-
}
|
|
9312
|
-
ref
|
|
8876
|
+
},
|
|
8877
|
+
ref
|
|
9313
8878
|
) => {
|
|
9314
8879
|
// Controlled vs uncontrolled state
|
|
9315
8880
|
const [internalPairs, setInternalPairs] =
|
|
@@ -9506,7 +9071,10 @@ import type { KeyValueRowProps } from "./types";
|
|
|
9506
9071
|
/**
|
|
9507
9072
|
* Individual key-value pair row with inputs and delete button
|
|
9508
9073
|
*/
|
|
9509
|
-
export const KeyValueRow = React.forwardRef
|
|
9074
|
+
export const KeyValueRow = React.forwardRef<
|
|
9075
|
+
HTMLDivElement,
|
|
9076
|
+
KeyValueRowProps & React.HTMLAttributes<HTMLDivElement>
|
|
9077
|
+
>(
|
|
9510
9078
|
(
|
|
9511
9079
|
{
|
|
9512
9080
|
pair,
|
|
@@ -9522,8 +9090,8 @@ export const KeyValueRow = React.forwardRef(
|
|
|
9522
9090
|
onDelete,
|
|
9523
9091
|
className,
|
|
9524
9092
|
...props
|
|
9525
|
-
}
|
|
9526
|
-
ref
|
|
9093
|
+
},
|
|
9094
|
+
ref
|
|
9527
9095
|
) => {
|
|
9528
9096
|
// Determine if inputs should show error state
|
|
9529
9097
|
const keyHasError = isDuplicateKey || (keyRequired && isKeyEmpty);
|
|
@@ -9738,7 +9306,10 @@ export interface ApiFeatureCardProps
|
|
|
9738
9306
|
* />
|
|
9739
9307
|
* \`\`\`
|
|
9740
9308
|
*/
|
|
9741
|
-
export const ApiFeatureCard = React.forwardRef
|
|
9309
|
+
export const ApiFeatureCard = React.forwardRef<
|
|
9310
|
+
HTMLDivElement,
|
|
9311
|
+
ApiFeatureCardProps
|
|
9312
|
+
>(
|
|
9742
9313
|
(
|
|
9743
9314
|
{
|
|
9744
9315
|
icon,
|
|
@@ -9751,8 +9322,8 @@ export const ApiFeatureCard = React.forwardRef(
|
|
|
9751
9322
|
capabilitiesLabel = "Key Capabilities",
|
|
9752
9323
|
className,
|
|
9753
9324
|
...props
|
|
9754
|
-
}
|
|
9755
|
-
ref
|
|
9325
|
+
},
|
|
9326
|
+
ref
|
|
9756
9327
|
) => {
|
|
9757
9328
|
return (
|
|
9758
9329
|
<div
|
|
@@ -9924,7 +9495,10 @@ export interface EndpointDetailsProps
|
|
|
9924
9495
|
* />
|
|
9925
9496
|
* \`\`\`
|
|
9926
9497
|
*/
|
|
9927
|
-
export const EndpointDetails = React.forwardRef
|
|
9498
|
+
export const EndpointDetails = React.forwardRef<
|
|
9499
|
+
HTMLDivElement,
|
|
9500
|
+
EndpointDetailsProps
|
|
9501
|
+
>(
|
|
9928
9502
|
(
|
|
9929
9503
|
{
|
|
9930
9504
|
title = "Endpoint Details",
|
|
@@ -9945,8 +9519,8 @@ export const EndpointDetails = React.forwardRef(
|
|
|
9945
9519
|
revokeDescription = "Revoking access will immediately disable all integrations using these keys.",
|
|
9946
9520
|
className,
|
|
9947
9521
|
...props
|
|
9948
|
-
}
|
|
9949
|
-
ref
|
|
9522
|
+
},
|
|
9523
|
+
ref
|
|
9950
9524
|
) => {
|
|
9951
9525
|
const isCalling = variant === "calling";
|
|
9952
9526
|
|
|
@@ -10136,7 +9710,10 @@ export interface AlertConfigurationProps {
|
|
|
10136
9710
|
* AlertConfiguration component displays current alert values for minimum balance and top-up.
|
|
10137
9711
|
* Used in payment auto-pay setup to show notification thresholds.
|
|
10138
9712
|
*/
|
|
10139
|
-
export const AlertConfiguration = React.forwardRef
|
|
9713
|
+
export const AlertConfiguration = React.forwardRef<
|
|
9714
|
+
HTMLDivElement,
|
|
9715
|
+
AlertConfigurationProps
|
|
9716
|
+
>(
|
|
10140
9717
|
(
|
|
10141
9718
|
{
|
|
10142
9719
|
minimumBalance,
|
|
@@ -10144,8 +9721,8 @@ export const AlertConfiguration = React.forwardRef(
|
|
|
10144
9721
|
currencySymbol = "\u20B9",
|
|
10145
9722
|
onEdit,
|
|
10146
9723
|
className,
|
|
10147
|
-
}
|
|
10148
|
-
ref
|
|
9724
|
+
},
|
|
9725
|
+
ref
|
|
10149
9726
|
) => {
|
|
10150
9727
|
const formatCurrency = (amount: number) => {
|
|
10151
9728
|
const formatted = amount.toLocaleString("en-IN", {
|
|
@@ -10280,7 +9857,10 @@ export interface AlertValuesModalProps {
|
|
|
10280
9857
|
* AlertValuesModal component for editing alert configuration values.
|
|
10281
9858
|
* Displays a form with inputs for minimum balance and minimum top-up.
|
|
10282
9859
|
*/
|
|
10283
|
-
export const AlertValuesModal = React.forwardRef
|
|
9860
|
+
export const AlertValuesModal = React.forwardRef<
|
|
9861
|
+
HTMLDivElement,
|
|
9862
|
+
AlertValuesModalProps
|
|
9863
|
+
>(
|
|
10284
9864
|
(
|
|
10285
9865
|
{
|
|
10286
9866
|
open,
|
|
@@ -10292,8 +9872,8 @@ export const AlertValuesModal = React.forwardRef(
|
|
|
10292
9872
|
topupOptions,
|
|
10293
9873
|
onSave,
|
|
10294
9874
|
loading = false,
|
|
10295
|
-
}
|
|
10296
|
-
ref
|
|
9875
|
+
},
|
|
9876
|
+
ref
|
|
10297
9877
|
) => {
|
|
10298
9878
|
const [minimumBalance, setMinimumBalance] = React.useState(
|
|
10299
9879
|
initialMinimumBalance.toString()
|
|
@@ -10442,7 +10022,7 @@ import type { AutoPaySetupProps } from "./types";
|
|
|
10442
10022
|
* />
|
|
10443
10023
|
* \`\`\`
|
|
10444
10024
|
*/
|
|
10445
|
-
export const AutoPaySetup = React.forwardRef(
|
|
10025
|
+
export const AutoPaySetup = React.forwardRef<HTMLDivElement, AutoPaySetupProps>(
|
|
10446
10026
|
(
|
|
10447
10027
|
{
|
|
10448
10028
|
title = "Auto-pay setup",
|
|
@@ -10461,8 +10041,8 @@ export const AutoPaySetup = React.forwardRef(
|
|
|
10461
10041
|
open,
|
|
10462
10042
|
onOpenChange,
|
|
10463
10043
|
className,
|
|
10464
|
-
}
|
|
10465
|
-
ref
|
|
10044
|
+
},
|
|
10045
|
+
ref
|
|
10466
10046
|
) => {
|
|
10467
10047
|
const isControlled = open !== undefined;
|
|
10468
10048
|
|
|
@@ -10653,7 +10233,7 @@ import type { BankDetailsProps, BankDetailItem } from "./types";
|
|
|
10653
10233
|
* />
|
|
10654
10234
|
* \`\`\`
|
|
10655
10235
|
*/
|
|
10656
|
-
export const BankDetails = React.forwardRef(
|
|
10236
|
+
export const BankDetails = React.forwardRef<HTMLDivElement, BankDetailsProps>(
|
|
10657
10237
|
(
|
|
10658
10238
|
{
|
|
10659
10239
|
title = "Bank details",
|
|
@@ -10665,8 +10245,8 @@ export const BankDetails = React.forwardRef(
|
|
|
10665
10245
|
onOpenChange,
|
|
10666
10246
|
onCopy,
|
|
10667
10247
|
className,
|
|
10668
|
-
}
|
|
10669
|
-
ref
|
|
10248
|
+
},
|
|
10249
|
+
ref
|
|
10670
10250
|
) => {
|
|
10671
10251
|
const isControlled = open !== undefined;
|
|
10672
10252
|
|
|
@@ -11482,8 +11062,8 @@ const BreakdownCardRow = ({ item }: { item: BreakdownCardItem }) => (
|
|
|
11482
11062
|
* />
|
|
11483
11063
|
* \`\`\`
|
|
11484
11064
|
*/
|
|
11485
|
-
export const PaymentSummary = React.forwardRef(
|
|
11486
|
-
({ items = [], summaryItems, className, title, headerInfo, subtotal, breakdownCard, creditLimit }
|
|
11065
|
+
export const PaymentSummary = React.forwardRef<HTMLDivElement, PaymentSummaryProps>(
|
|
11066
|
+
({ items = [], summaryItems, className, title, headerInfo, subtotal, breakdownCard, creditLimit }, ref) => {
|
|
11487
11067
|
const hasItemsBorder =
|
|
11488
11068
|
items.length > 0 &&
|
|
11489
11069
|
(!!subtotal || !!breakdownCard || (summaryItems && summaryItems.length > 0));
|
|
@@ -11680,7 +11260,10 @@ import type { PaymentOptionCardProps } from "./types";
|
|
|
11680
11260
|
* />
|
|
11681
11261
|
* \`\`\`
|
|
11682
11262
|
*/
|
|
11683
|
-
export const PaymentOptionCard = React.forwardRef
|
|
11263
|
+
export const PaymentOptionCard = React.forwardRef<
|
|
11264
|
+
HTMLDivElement,
|
|
11265
|
+
PaymentOptionCardProps
|
|
11266
|
+
>(
|
|
11684
11267
|
(
|
|
11685
11268
|
{
|
|
11686
11269
|
title = "Select payment method",
|
|
@@ -11695,8 +11278,8 @@ export const PaymentOptionCard = React.forwardRef(
|
|
|
11695
11278
|
loading = false,
|
|
11696
11279
|
disabled = false,
|
|
11697
11280
|
className,
|
|
11698
|
-
}
|
|
11699
|
-
ref
|
|
11281
|
+
},
|
|
11282
|
+
ref
|
|
11700
11283
|
) => {
|
|
11701
11284
|
const [internalSelected, setInternalSelected] = React.useState<
|
|
11702
11285
|
string | undefined
|
|
@@ -11829,7 +11412,10 @@ export interface PaymentOptionCardModalProps
|
|
|
11829
11412
|
* />
|
|
11830
11413
|
* \`\`\`
|
|
11831
11414
|
*/
|
|
11832
|
-
export const PaymentOptionCardModal = React.forwardRef
|
|
11415
|
+
export const PaymentOptionCardModal = React.forwardRef<
|
|
11416
|
+
HTMLDivElement,
|
|
11417
|
+
PaymentOptionCardModalProps
|
|
11418
|
+
>(
|
|
11833
11419
|
(
|
|
11834
11420
|
{
|
|
11835
11421
|
open,
|
|
@@ -11845,8 +11431,8 @@ export const PaymentOptionCardModal = React.forwardRef(
|
|
|
11845
11431
|
loading,
|
|
11846
11432
|
disabled,
|
|
11847
11433
|
className,
|
|
11848
|
-
}
|
|
11849
|
-
ref
|
|
11434
|
+
},
|
|
11435
|
+
ref
|
|
11850
11436
|
) => {
|
|
11851
11437
|
const handleClose = () => {
|
|
11852
11438
|
onOpenChange(false);
|
|
@@ -11984,7 +11570,7 @@ const DEFAULT_FEATURES: PlanFeature[] = [
|
|
|
11984
11570
|
{ name: "Channel(s)", free: "1 Pair(s)", rate: "\u20B9 300.00" },
|
|
11985
11571
|
];
|
|
11986
11572
|
|
|
11987
|
-
const PlanDetailModal = React.forwardRef(
|
|
11573
|
+
const PlanDetailModal = React.forwardRef<HTMLDivElement, PlanDetailModalProps>(
|
|
11988
11574
|
(
|
|
11989
11575
|
{
|
|
11990
11576
|
open,
|
|
@@ -11995,8 +11581,8 @@ const PlanDetailModal = React.forwardRef(
|
|
|
11995
11581
|
onClose,
|
|
11996
11582
|
className,
|
|
11997
11583
|
...props
|
|
11998
|
-
}
|
|
11999
|
-
ref
|
|
11584
|
+
},
|
|
11585
|
+
ref
|
|
12000
11586
|
) => {
|
|
12001
11587
|
const handleClose = () => {
|
|
12002
11588
|
onClose?.();
|
|
@@ -12205,7 +11791,7 @@ const renderOptionIcon = (icon: BillingCycleOption["icon"]) => {
|
|
|
12205
11791
|
return icon;
|
|
12206
11792
|
};
|
|
12207
11793
|
|
|
12208
|
-
const PlanUpgradeModal = React.forwardRef(
|
|
11794
|
+
const PlanUpgradeModal = React.forwardRef<HTMLDivElement, PlanUpgradeModalProps>(
|
|
12209
11795
|
(
|
|
12210
11796
|
{
|
|
12211
11797
|
open,
|
|
@@ -12222,8 +11808,8 @@ const PlanUpgradeModal = React.forwardRef(
|
|
|
12222
11808
|
onClose,
|
|
12223
11809
|
className,
|
|
12224
11810
|
...props
|
|
12225
|
-
}
|
|
12226
|
-
ref
|
|
11811
|
+
},
|
|
11812
|
+
ref
|
|
12227
11813
|
) => {
|
|
12228
11814
|
const initialOptionId = defaultSelectedOptionId ?? options[0]?.id;
|
|
12229
11815
|
const [internalSelectedOptionId, setInternalSelectedOptionId] = React.useState<
|
|
@@ -12501,7 +12087,10 @@ const getStatusIcon = (tone: PlanUpgradeSummaryTone) => {
|
|
|
12501
12087
|
return <AlertCircle className="size-6 text-semantic-warning-text" aria-hidden="true" />;
|
|
12502
12088
|
};
|
|
12503
12089
|
|
|
12504
|
-
const PlanUpgradeSummaryModal = React.forwardRef
|
|
12090
|
+
const PlanUpgradeSummaryModal = React.forwardRef<
|
|
12091
|
+
HTMLDivElement,
|
|
12092
|
+
PlanUpgradeSummaryModalProps
|
|
12093
|
+
>(
|
|
12505
12094
|
(
|
|
12506
12095
|
{
|
|
12507
12096
|
open,
|
|
@@ -12523,8 +12112,8 @@ const PlanUpgradeSummaryModal = React.forwardRef(
|
|
|
12523
12112
|
closeAriaLabel = "Close plan summary modal",
|
|
12524
12113
|
className,
|
|
12525
12114
|
...props
|
|
12526
|
-
}
|
|
12527
|
-
ref
|
|
12115
|
+
},
|
|
12116
|
+
ref
|
|
12528
12117
|
) => {
|
|
12529
12118
|
const resolvedStatus = status ?? defaultStatusByMode[mode];
|
|
12530
12119
|
const resolvedTone = resolvedStatus.tone ?? defaultStatusByMode[mode].tone ?? "warning";
|
|
@@ -12761,7 +12350,7 @@ import type { LetUsDriveCardProps } from "./types";
|
|
|
12761
12350
|
* />
|
|
12762
12351
|
* \`\`\`
|
|
12763
12352
|
*/
|
|
12764
|
-
const LetUsDriveCard = React.forwardRef(
|
|
12353
|
+
const LetUsDriveCard = React.forwardRef<HTMLDivElement, LetUsDriveCardProps>(
|
|
12765
12354
|
(
|
|
12766
12355
|
{
|
|
12767
12356
|
title,
|
|
@@ -12781,8 +12370,8 @@ const LetUsDriveCard = React.forwardRef(
|
|
|
12781
12370
|
onCtaClick,
|
|
12782
12371
|
className,
|
|
12783
12372
|
...props
|
|
12784
|
-
}
|
|
12785
|
-
ref
|
|
12373
|
+
},
|
|
12374
|
+
ref
|
|
12786
12375
|
) => {
|
|
12787
12376
|
const [internalExpanded, setInternalExpanded] = React.useState(false);
|
|
12788
12377
|
const isControlled = controlledExpanded !== undefined;
|
|
@@ -12806,7 +12395,7 @@ const LetUsDriveCard = React.forwardRef(
|
|
|
12806
12395
|
<div
|
|
12807
12396
|
ref={ref}
|
|
12808
12397
|
className={cn(
|
|
12809
|
-
"flex min-h-0 flex-col gap-6 rounded-[14px] border border-semantic-border-layout bg-card p-5 shadow-sm",
|
|
12398
|
+
"flex h-full min-h-0 flex-col gap-6 rounded-[14px] border border-semantic-border-layout bg-card p-5 shadow-sm",
|
|
12810
12399
|
className
|
|
12811
12400
|
)}
|
|
12812
12401
|
{...props}
|
|
@@ -13045,7 +12634,7 @@ import type { PowerUpCardProps } from "./types";
|
|
|
13045
12634
|
* />
|
|
13046
12635
|
* \`\`\`
|
|
13047
12636
|
*/
|
|
13048
|
-
const PowerUpCard = React.forwardRef(
|
|
12637
|
+
const PowerUpCard = React.forwardRef<HTMLDivElement, PowerUpCardProps>(
|
|
13049
12638
|
(
|
|
13050
12639
|
{
|
|
13051
12640
|
icon,
|
|
@@ -13056,8 +12645,8 @@ const PowerUpCard = React.forwardRef(
|
|
|
13056
12645
|
onCtaClick,
|
|
13057
12646
|
className,
|
|
13058
12647
|
...props
|
|
13059
|
-
}
|
|
13060
|
-
ref
|
|
12648
|
+
},
|
|
12649
|
+
ref
|
|
13061
12650
|
) => {
|
|
13062
12651
|
return (
|
|
13063
12652
|
<div
|
|
@@ -13184,7 +12773,7 @@ import type { PricingCardProps } from "./types";
|
|
|
13184
12773
|
* />
|
|
13185
12774
|
* \`\`\`
|
|
13186
12775
|
*/
|
|
13187
|
-
const PricingCard = React.forwardRef(
|
|
12776
|
+
const PricingCard = React.forwardRef<HTMLDivElement, PricingCardProps>(
|
|
13188
12777
|
(
|
|
13189
12778
|
{
|
|
13190
12779
|
planName,
|
|
@@ -13208,8 +12797,8 @@ const PricingCard = React.forwardRef(
|
|
|
13208
12797
|
infoText,
|
|
13209
12798
|
className,
|
|
13210
12799
|
...props
|
|
13211
|
-
}
|
|
13212
|
-
ref
|
|
12800
|
+
},
|
|
12801
|
+
ref
|
|
13213
12802
|
) => {
|
|
13214
12803
|
const buttonText =
|
|
13215
12804
|
ctaText || (isCurrentPlan ? "Current plan" : "Select plan");
|
|
@@ -13231,6 +12820,9 @@ const PricingCard = React.forwardRef(
|
|
|
13231
12820
|
{/* Header */}
|
|
13232
12821
|
<div
|
|
13233
12822
|
className="flex flex-col gap-4 rounded-t-xl rounded-b-lg p-4"
|
|
12823
|
+
style={
|
|
12824
|
+
headerBgColor ? { backgroundColor: headerBgColor } : undefined
|
|
12825
|
+
}
|
|
13234
12826
|
>
|
|
13235
12827
|
{/* Plan name + badge */}
|
|
13236
12828
|
<div className="flex items-center gap-4">
|
|
@@ -13288,11 +12880,11 @@ const PricingCard = React.forwardRef(
|
|
|
13288
12880
|
</div>
|
|
13289
12881
|
)}
|
|
13290
12882
|
<Button
|
|
13291
|
-
variant={isCurrentPlan ? "
|
|
12883
|
+
variant={isCurrentPlan ? "outline" : "default"}
|
|
13292
12884
|
className="w-full"
|
|
13293
12885
|
onClick={onCtaClick}
|
|
13294
12886
|
loading={ctaLoading}
|
|
13295
|
-
disabled={ctaDisabled
|
|
12887
|
+
disabled={ctaDisabled}
|
|
13296
12888
|
>
|
|
13297
12889
|
{buttonText}
|
|
13298
12890
|
</Button>
|
|
@@ -13339,34 +12931,29 @@ const PricingCard = React.forwardRef(
|
|
|
13339
12931
|
</div>
|
|
13340
12932
|
)}
|
|
13341
12933
|
|
|
13342
|
-
{/*
|
|
13343
|
-
{
|
|
13344
|
-
<div className="
|
|
13345
|
-
{
|
|
13346
|
-
|
|
13347
|
-
<div className="flex items-center gap-2.5 rounded-md bg-[var(--color-info-25)] border border-[#f3f5f6] pl-4 py-2.5">
|
|
13348
|
-
{addon.icon && (
|
|
13349
|
-
<div className="size-5 shrink-0">{addon.icon}</div>
|
|
13350
|
-
)}
|
|
13351
|
-
<span className="text-sm text-semantic-text-primary tracking-[0.035px]">
|
|
13352
|
-
{addon.text}
|
|
13353
|
-
</span>
|
|
13354
|
-
</div>
|
|
12934
|
+
{/* Addon */}
|
|
12935
|
+
{addon && (
|
|
12936
|
+
<div className="flex items-center gap-2.5 rounded-md bg-[var(--color-info-25)] border border-[#f3f5f6] pl-4 py-2.5">
|
|
12937
|
+
{addon.icon && (
|
|
12938
|
+
<div className="size-5 shrink-0">{addon.icon}</div>
|
|
13355
12939
|
)}
|
|
12940
|
+
<span className="text-sm text-semantic-text-primary tracking-[0.035px]">
|
|
12941
|
+
{addon.text}
|
|
12942
|
+
</span>
|
|
12943
|
+
</div>
|
|
12944
|
+
)}
|
|
13356
12945
|
|
|
13357
|
-
|
|
13358
|
-
|
|
13359
|
-
|
|
13360
|
-
|
|
13361
|
-
|
|
13362
|
-
|
|
13363
|
-
|
|
13364
|
-
|
|
13365
|
-
|
|
13366
|
-
</div>
|
|
13367
|
-
))}
|
|
12946
|
+
{/* Usage Details */}
|
|
12947
|
+
{usageDetails && usageDetails.length > 0 && (
|
|
12948
|
+
<div className="flex flex-col gap-2.5 rounded-md bg-[var(--color-info-25)] border border-[#f3f5f6] px-4 py-2.5">
|
|
12949
|
+
{usageDetails.map((detail, index) => (
|
|
12950
|
+
<div key={index} className="flex items-start gap-2">
|
|
12951
|
+
<span className="size-1.5 rounded-full bg-semantic-primary shrink-0 mt-[7px]" />
|
|
12952
|
+
<span className="text-sm text-semantic-text-primary tracking-[0.035px]">
|
|
12953
|
+
<strong>{detail.label}:</strong> {detail.value}
|
|
12954
|
+
</span>
|
|
13368
12955
|
</div>
|
|
13369
|
-
)}
|
|
12956
|
+
))}
|
|
13370
12957
|
</div>
|
|
13371
12958
|
)}
|
|
13372
12959
|
</div>
|
|
@@ -13387,8 +12974,8 @@ interface PlanIconProps extends React.SVGAttributes<SVGElement> {
|
|
|
13387
12974
|
className?: string;
|
|
13388
12975
|
}
|
|
13389
12976
|
|
|
13390
|
-
const CompactCarIcon = React.forwardRef(
|
|
13391
|
-
({ className, ...props }
|
|
12977
|
+
const CompactCarIcon = React.forwardRef<SVGSVGElement, PlanIconProps>(
|
|
12978
|
+
({ className, ...props }, ref) => (
|
|
13392
12979
|
<svg
|
|
13393
12980
|
ref={ref}
|
|
13394
12981
|
className={className}
|
|
@@ -13427,8 +13014,8 @@ const CompactCarIcon = React.forwardRef(
|
|
|
13427
13014
|
);
|
|
13428
13015
|
CompactCarIcon.displayName = "CompactCarIcon";
|
|
13429
13016
|
|
|
13430
|
-
const SedanCarIcon = React.forwardRef(
|
|
13431
|
-
({ className, ...props }
|
|
13017
|
+
const SedanCarIcon = React.forwardRef<SVGSVGElement, PlanIconProps>(
|
|
13018
|
+
({ className, ...props }, ref) => (
|
|
13432
13019
|
<svg
|
|
13433
13020
|
ref={ref}
|
|
13434
13021
|
className={className}
|
|
@@ -13479,8 +13066,8 @@ const SedanCarIcon = React.forwardRef(
|
|
|
13479
13066
|
);
|
|
13480
13067
|
SedanCarIcon.displayName = "SedanCarIcon";
|
|
13481
13068
|
|
|
13482
|
-
const SuvCarIcon = React.forwardRef(
|
|
13483
|
-
({ className, ...props }
|
|
13069
|
+
const SuvCarIcon = React.forwardRef<SVGSVGElement, PlanIconProps>(
|
|
13070
|
+
({ className, ...props }, ref) => (
|
|
13484
13071
|
<svg
|
|
13485
13072
|
ref={ref}
|
|
13486
13073
|
className={className}
|
|
@@ -13693,7 +13280,7 @@ import type { PricingPageProps } from "./types";
|
|
|
13693
13280
|
* />
|
|
13694
13281
|
* \`\`\`
|
|
13695
13282
|
*/
|
|
13696
|
-
const PricingPage = React.forwardRef(
|
|
13283
|
+
const PricingPage = React.forwardRef<HTMLDivElement, PricingPageProps>(
|
|
13697
13284
|
(
|
|
13698
13285
|
{
|
|
13699
13286
|
title = "Select business plan",
|
|
@@ -13713,10 +13300,11 @@ const PricingPage = React.forwardRef(
|
|
|
13713
13300
|
onFeatureComparisonClick,
|
|
13714
13301
|
letUsDriveCards = [],
|
|
13715
13302
|
letUsDriveTitle = "Let us drive \u2014 Full-service management",
|
|
13303
|
+
letUsDriveExpandMode,
|
|
13716
13304
|
className,
|
|
13717
13305
|
...props
|
|
13718
|
-
}
|
|
13719
|
-
ref
|
|
13306
|
+
},
|
|
13307
|
+
ref
|
|
13720
13308
|
) => {
|
|
13721
13309
|
// Internal state for uncontrolled mode
|
|
13722
13310
|
const [internalTab, setInternalTab] = React.useState(
|
|
@@ -13725,6 +13313,9 @@ const PricingPage = React.forwardRef(
|
|
|
13725
13313
|
const [internalBilling, setInternalBilling] = React.useState<
|
|
13726
13314
|
"monthly" | "yearly"
|
|
13727
13315
|
>("monthly");
|
|
13316
|
+
const [expandedLetUsDriveIndices, setExpandedLetUsDriveIndices] =
|
|
13317
|
+
React.useState<number[]>([]);
|
|
13318
|
+
|
|
13728
13319
|
const currentTab = controlledTab ?? internalTab;
|
|
13729
13320
|
const currentBilling = controlledBilling ?? internalBilling;
|
|
13730
13321
|
|
|
@@ -13738,6 +13329,30 @@ const PricingPage = React.forwardRef(
|
|
|
13738
13329
|
onBillingPeriodChange?.(period);
|
|
13739
13330
|
};
|
|
13740
13331
|
|
|
13332
|
+
const cardCount = letUsDriveCards.length;
|
|
13333
|
+
|
|
13334
|
+
const handleLetUsDriveExpandedChange = (index: number, expanded: boolean) => {
|
|
13335
|
+
if (letUsDriveExpandMode === "all") {
|
|
13336
|
+
if (expanded) {
|
|
13337
|
+
setExpandedLetUsDriveIndices(
|
|
13338
|
+
Array.from({ length: cardCount }, (_, i) => i)
|
|
13339
|
+
);
|
|
13340
|
+
} else {
|
|
13341
|
+
setExpandedLetUsDriveIndices((prev) =>
|
|
13342
|
+
prev.filter((i) => i !== index)
|
|
13343
|
+
);
|
|
13344
|
+
}
|
|
13345
|
+
} else {
|
|
13346
|
+
if (expanded) {
|
|
13347
|
+
setExpandedLetUsDriveIndices([index]);
|
|
13348
|
+
} else {
|
|
13349
|
+
setExpandedLetUsDriveIndices((prev) =>
|
|
13350
|
+
prev.filter((i) => i !== index)
|
|
13351
|
+
);
|
|
13352
|
+
}
|
|
13353
|
+
}
|
|
13354
|
+
};
|
|
13355
|
+
|
|
13741
13356
|
const hasPowerUps = powerUpCards.length > 0;
|
|
13742
13357
|
const hasLetUsDrive = letUsDriveCards.length > 0;
|
|
13743
13358
|
|
|
@@ -13833,11 +13448,22 @@ const PricingPage = React.forwardRef(
|
|
|
13833
13448
|
{letUsDriveTitle}
|
|
13834
13449
|
</h2>
|
|
13835
13450
|
|
|
13836
|
-
{/* Service cards \u2014 items-
|
|
13837
|
-
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 items-
|
|
13838
|
-
{letUsDriveCards.map((cardProps, index) =>
|
|
13839
|
-
|
|
13840
|
-
|
|
13451
|
+
{/* Service cards \u2014 items-stretch + card h-full + mt-auto on actions align Talk to us buttons */}
|
|
13452
|
+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 items-stretch">
|
|
13453
|
+
{letUsDriveCards.map((cardProps, index) => {
|
|
13454
|
+
const hasDetailsContent =
|
|
13455
|
+
cardProps.detailsContent &&
|
|
13456
|
+
cardProps.detailsContent.items.length > 0;
|
|
13457
|
+
const useControlledExpand =
|
|
13458
|
+
letUsDriveExpandMode && hasDetailsContent;
|
|
13459
|
+
const merged = { ...cardProps };
|
|
13460
|
+
if (useControlledExpand) {
|
|
13461
|
+
merged.expanded = expandedLetUsDriveIndices.includes(index);
|
|
13462
|
+
merged.onExpandedChange = (expanded: boolean) =>
|
|
13463
|
+
handleLetUsDriveExpandedChange(index, expanded);
|
|
13464
|
+
}
|
|
13465
|
+
return <LetUsDriveCard key={index} {...merged} />;
|
|
13466
|
+
})}
|
|
13841
13467
|
</div>
|
|
13842
13468
|
</div>
|
|
13843
13469
|
</div>
|
|
@@ -13926,6 +13552,13 @@ export interface PricingPageProps
|
|
|
13926
13552
|
letUsDriveCards?: LetUsDriveCardProps[];
|
|
13927
13553
|
/** Let-us-drive section heading (default: "Let us drive \u2014 Full-service management") */
|
|
13928
13554
|
letUsDriveTitle?: string;
|
|
13555
|
+
/**
|
|
13556
|
+
* When set, controls how "Show details" expands across cards.
|
|
13557
|
+
* - "single": only the clicked card expands (accordion).
|
|
13558
|
+
* - "all": clicking "Show details" on any card expands all cards that have detailsContent.
|
|
13559
|
+
* Ignored when cards are used without detailsContent or without controlled expanded state.
|
|
13560
|
+
*/
|
|
13561
|
+
letUsDriveExpandMode?: "single" | "all";
|
|
13929
13562
|
}
|
|
13930
13563
|
`, prefix)
|
|
13931
13564
|
},
|
|
@@ -13982,7 +13615,7 @@ import type { PricingToggleProps } from "./types";
|
|
|
13982
13615
|
* />
|
|
13983
13616
|
* \`\`\`
|
|
13984
13617
|
*/
|
|
13985
|
-
const PricingToggle = React.forwardRef(
|
|
13618
|
+
const PricingToggle = React.forwardRef<HTMLDivElement, PricingToggleProps>(
|
|
13986
13619
|
(
|
|
13987
13620
|
{
|
|
13988
13621
|
tabs,
|
|
@@ -13995,8 +13628,8 @@ const PricingToggle = React.forwardRef(
|
|
|
13995
13628
|
yearlyLabel = "Yearly (Save 20%)",
|
|
13996
13629
|
className,
|
|
13997
13630
|
...props
|
|
13998
|
-
}
|
|
13999
|
-
ref
|
|
13631
|
+
},
|
|
13632
|
+
ref
|
|
14000
13633
|
) => {
|
|
14001
13634
|
const isYearly = billingPeriod === "yearly";
|
|
14002
13635
|
|
|
@@ -14241,8 +13874,8 @@ interface BrandIconProps extends React.SVGAttributes<SVGElement> {
|
|
|
14241
13874
|
* Used in TalkToUsModal and available for any component that needs
|
|
14242
13875
|
* the MyOperator contact/chat branding.
|
|
14243
13876
|
*/
|
|
14244
|
-
const MyOperatorChatIcon = React.forwardRef(
|
|
14245
|
-
({ className, ...props }
|
|
13877
|
+
const MyOperatorChatIcon = React.forwardRef<SVGSVGElement, BrandIconProps>(
|
|
13878
|
+
({ className, ...props }, ref) => (
|
|
14246
13879
|
<svg
|
|
14247
13880
|
ref={ref}
|
|
14248
13881
|
className={className}
|
|
@@ -14375,8 +14008,8 @@ function getTypeLabel(
|
|
|
14375
14008
|
* All displayed data (icon, badge, name, count, last published) comes from the \`bot\` prop.
|
|
14376
14009
|
* Set bot.type to "chatbot" or "voicebot"; no separate card components needed.
|
|
14377
14010
|
*/
|
|
14378
|
-
export const BotCard = React.forwardRef(
|
|
14379
|
-
({ bot, typeLabels, onEdit, onDelete, className, ...props }
|
|
14011
|
+
export const BotCard = React.forwardRef<HTMLDivElement, BotCardProps>(
|
|
14012
|
+
({ bot, typeLabels, onEdit, onDelete, className, ...props }, ref) => {
|
|
14380
14013
|
const typeLabel = getTypeLabel(bot, typeLabels);
|
|
14381
14014
|
const isChatbot = bot.type === "chatbot";
|
|
14382
14015
|
|
|
@@ -14406,6 +14039,7 @@ export const BotCard = React.forwardRef(
|
|
|
14406
14039
|
className={cn(
|
|
14407
14040
|
"relative bg-semantic-bg-primary border border-semantic-border-layout rounded-[5px] min-w-0 max-w-full overflow-hidden flex flex-col",
|
|
14408
14041
|
"shadow-[0px_4px_15.1px_0px_rgba(0,0,0,0.06)] p-3 sm:p-4 md:p-5",
|
|
14042
|
+
"min-h-[180px] sm:min-h-[207px] h-full shrink-0",
|
|
14409
14043
|
onEdit && "cursor-pointer",
|
|
14410
14044
|
className
|
|
14411
14045
|
)}
|
|
@@ -14463,7 +14097,7 @@ export const BotCard = React.forwardRef(
|
|
|
14463
14097
|
</div>
|
|
14464
14098
|
|
|
14465
14099
|
{/* Bot name */}
|
|
14466
|
-
<h3 className="m-0 text-sm sm:text-base font-normal text-semantic-text-primary
|
|
14100
|
+
<h3 className="m-0 text-sm sm:text-base font-normal text-semantic-text-primary truncate mb-1 min-w-0">
|
|
14467
14101
|
{bot.name}
|
|
14468
14102
|
</h3>
|
|
14469
14103
|
|
|
@@ -14491,7 +14125,7 @@ export const BotCard = React.forwardRef(
|
|
|
14491
14125
|
</span>
|
|
14492
14126
|
)}
|
|
14493
14127
|
{(bot.lastPublishedBy || bot.lastPublishedDate) ? (
|
|
14494
|
-
<p className="m-0 text-xs sm:text-sm text-semantic-text-muted
|
|
14128
|
+
<p className="m-0 text-xs sm:text-sm text-semantic-text-muted truncate">
|
|
14495
14129
|
{bot.lastPublishedBy
|
|
14496
14130
|
? \`\${bot.lastPublishedBy} | \${bot.lastPublishedDate ?? "\u2014"}\`
|
|
14497
14131
|
: bot.lastPublishedDate}
|
|
@@ -14541,7 +14175,10 @@ const BOT_TYPE_OPTIONS: BotTypeOption[] = [
|
|
|
14541
14175
|
},
|
|
14542
14176
|
];
|
|
14543
14177
|
|
|
14544
|
-
export const CreateBotModal = React.forwardRef
|
|
14178
|
+
export const CreateBotModal = React.forwardRef<
|
|
14179
|
+
HTMLDivElement,
|
|
14180
|
+
CreateBotModalProps
|
|
14181
|
+
>(({ open, onOpenChange, onSubmit, isLoading, className }, ref) => {
|
|
14545
14182
|
const [name, setName] = React.useState("");
|
|
14546
14183
|
const [selectedType, setSelectedType] = React.useState<BotType>("chatbot");
|
|
14547
14184
|
|
|
@@ -14689,15 +14326,15 @@ import type { CreateBotFlowProps } from "./types";
|
|
|
14689
14326
|
* Create bot flow: "Create new bot" card + Create Bot modal. No header (title/subtitle/search).
|
|
14690
14327
|
* Use when you want the create-bot experience without the list header.
|
|
14691
14328
|
*/
|
|
14692
|
-
export const CreateBotFlow = React.forwardRef(
|
|
14329
|
+
export const CreateBotFlow = React.forwardRef<HTMLDivElement, CreateBotFlowProps>(
|
|
14693
14330
|
(
|
|
14694
14331
|
{
|
|
14695
14332
|
createCardLabel = "Create new bot",
|
|
14696
14333
|
onSubmit,
|
|
14697
14334
|
className,
|
|
14698
14335
|
...props
|
|
14699
|
-
}
|
|
14700
|
-
ref
|
|
14336
|
+
},
|
|
14337
|
+
ref
|
|
14701
14338
|
) => {
|
|
14702
14339
|
const [modalOpen, setModalOpen] = React.useState(false);
|
|
14703
14340
|
|
|
@@ -14813,7 +14450,7 @@ import { BotListGrid } from "./bot-list-grid";
|
|
|
14813
14450
|
import { CreateBotModal } from "./create-bot-modal";
|
|
14814
14451
|
import type { BotListProps } from "./types";
|
|
14815
14452
|
|
|
14816
|
-
export const BotList = React.forwardRef(
|
|
14453
|
+
export const BotList = React.forwardRef<HTMLDivElement, BotListProps>(
|
|
14817
14454
|
(
|
|
14818
14455
|
{
|
|
14819
14456
|
bots = [],
|
|
@@ -14829,8 +14466,8 @@ export const BotList = React.forwardRef(
|
|
|
14829
14466
|
createCardLabel = "Create new bot",
|
|
14830
14467
|
className,
|
|
14831
14468
|
...props
|
|
14832
|
-
}
|
|
14833
|
-
ref
|
|
14469
|
+
},
|
|
14470
|
+
ref
|
|
14834
14471
|
) => {
|
|
14835
14472
|
const [searchQuery, setSearchQuery] = React.useState("");
|
|
14836
14473
|
const [createModalOpen, setCreateModalOpen] = React.useState(false);
|
|
@@ -14940,10 +14577,10 @@ const botListHeaderVariants = cva("min-w-0", {
|
|
|
14940
14577
|
},
|
|
14941
14578
|
});
|
|
14942
14579
|
|
|
14943
|
-
export const BotListHeader = React.forwardRef(
|
|
14580
|
+
export const BotListHeader = React.forwardRef<HTMLDivElement, BotListHeaderProps>(
|
|
14944
14581
|
(
|
|
14945
|
-
{ title, subtitle, variant = "default", rightContent, className, ...props }
|
|
14946
|
-
ref
|
|
14582
|
+
{ title, subtitle, variant = "default", rightContent, className, ...props },
|
|
14583
|
+
ref
|
|
14947
14584
|
) => {
|
|
14948
14585
|
const rootClassName = cn(botListHeaderVariants({ variant }), className);
|
|
14949
14586
|
const titleBlock = (
|
|
@@ -14990,7 +14627,7 @@ import { Search } from "lucide-react";
|
|
|
14990
14627
|
import { cn } from "../../../lib/utils";
|
|
14991
14628
|
import type { BotListSearchProps } from "./types";
|
|
14992
14629
|
|
|
14993
|
-
export const BotListSearch = React.forwardRef(
|
|
14630
|
+
export const BotListSearch = React.forwardRef<HTMLDivElement, BotListSearchProps>(
|
|
14994
14631
|
(
|
|
14995
14632
|
{
|
|
14996
14633
|
value,
|
|
@@ -14999,8 +14636,8 @@ export const BotListSearch = React.forwardRef(
|
|
|
14999
14636
|
defaultValue,
|
|
15000
14637
|
className,
|
|
15001
14638
|
...props
|
|
15002
|
-
}
|
|
15003
|
-
ref
|
|
14639
|
+
},
|
|
14640
|
+
ref
|
|
15004
14641
|
) => {
|
|
15005
14642
|
const [internalValue, setInternalValue] = React.useState(defaultValue ?? "");
|
|
15006
14643
|
const isControlled = value !== undefined;
|
|
@@ -15047,15 +14684,18 @@ import { Plus } from "lucide-react";
|
|
|
15047
14684
|
import { cn } from "../../../lib/utils";
|
|
15048
14685
|
import type { BotListCreateCardProps } from "./types";
|
|
15049
14686
|
|
|
15050
|
-
export const BotListCreateCard = React.forwardRef
|
|
14687
|
+
export const BotListCreateCard = React.forwardRef<
|
|
14688
|
+
HTMLButtonElement,
|
|
14689
|
+
BotListCreateCardProps
|
|
14690
|
+
>(
|
|
15051
14691
|
(
|
|
15052
14692
|
{
|
|
15053
14693
|
label = "Create new bot",
|
|
15054
14694
|
onClick,
|
|
15055
14695
|
className,
|
|
15056
14696
|
...props
|
|
15057
|
-
}
|
|
15058
|
-
ref
|
|
14697
|
+
},
|
|
14698
|
+
ref
|
|
15059
14699
|
) => (
|
|
15060
14700
|
<button
|
|
15061
14701
|
ref={ref}
|
|
@@ -15104,13 +14744,14 @@ BotListCreateCard.displayName = "BotListCreateCard";
|
|
|
15104
14744
|
import { cn } from "../../../lib/utils";
|
|
15105
14745
|
import type { BotListGridProps } from "./types";
|
|
15106
14746
|
|
|
15107
|
-
export const BotListGrid = React.forwardRef(
|
|
15108
|
-
({ children, className, ...props }
|
|
14747
|
+
export const BotListGrid = React.forwardRef<HTMLDivElement, BotListGridProps>(
|
|
14748
|
+
({ children, className, ...props }, ref) => (
|
|
15109
14749
|
<div
|
|
15110
14750
|
ref={ref}
|
|
15111
14751
|
className={cn(
|
|
15112
|
-
"grid w-full min-w-0 max-w-full
|
|
14752
|
+
"grid w-full min-w-0 max-w-full content-start gap-3 sm:gap-5 md:gap-6",
|
|
15113
14753
|
"grid-cols-[repeat(auto-fill,minmax(min(100%,280px),1fr))]",
|
|
14754
|
+
"auto-rows-auto items-stretch",
|
|
15114
14755
|
className
|
|
15115
14756
|
)}
|
|
15116
14757
|
{...props}
|
|
@@ -15406,7 +15047,7 @@ function getTimeRemaining(progress: number) {
|
|
|
15406
15047
|
: \`\${secs} seconds remaining\`;
|
|
15407
15048
|
}
|
|
15408
15049
|
|
|
15409
|
-
const FileUploadModal = React.forwardRef(
|
|
15050
|
+
const FileUploadModal = React.forwardRef<HTMLDivElement, FileUploadModalProps>(
|
|
15410
15051
|
(
|
|
15411
15052
|
{
|
|
15412
15053
|
open,
|
|
@@ -15429,8 +15070,8 @@ const FileUploadModal = React.forwardRef(
|
|
|
15429
15070
|
loading = false,
|
|
15430
15071
|
className,
|
|
15431
15072
|
...props
|
|
15432
|
-
}
|
|
15433
|
-
ref
|
|
15073
|
+
},
|
|
15074
|
+
ref
|
|
15434
15075
|
) => {
|
|
15435
15076
|
const [items, setItems] = React.useState<UploadItem[]>([]);
|
|
15436
15077
|
const fileInputRef = React.useRef<HTMLInputElement>(null);
|
|
@@ -15800,8 +15441,8 @@ import { X, Play, File } from "lucide-react";
|
|
|
15800
15441
|
import { cn } from "../../../lib/utils";
|
|
15801
15442
|
import type { AttachmentPreviewProps } from "./types";
|
|
15802
15443
|
|
|
15803
|
-
const AttachmentPreview = React.forwardRef(
|
|
15804
|
-
({ className, file, onRemove, ...props }
|
|
15444
|
+
const AttachmentPreview = React.forwardRef<HTMLDivElement, AttachmentPreviewProps>(
|
|
15445
|
+
({ className, file, onRemove, ...props }, ref) => {
|
|
15805
15446
|
const url = React.useMemo(() => URL.createObjectURL(file), [file]);
|
|
15806
15447
|
|
|
15807
15448
|
const isImage = file.type.startsWith("image/");
|
|
@@ -15959,7 +15600,7 @@ const BAR_WIDTH = 2;
|
|
|
15959
15600
|
const BAR_GAP = 1.5;
|
|
15960
15601
|
const SVG_HEIGHT = 32;
|
|
15961
15602
|
|
|
15962
|
-
const AudioMedia = React.forwardRef(
|
|
15603
|
+
const AudioMedia = React.forwardRef<HTMLDivElement, AudioMediaProps>(
|
|
15963
15604
|
(
|
|
15964
15605
|
{
|
|
15965
15606
|
className,
|
|
@@ -15973,8 +15614,8 @@ const AudioMedia = React.forwardRef(
|
|
|
15973
15614
|
onPlayChange,
|
|
15974
15615
|
onSpeedChange,
|
|
15975
15616
|
...props
|
|
15976
|
-
}
|
|
15977
|
-
ref
|
|
15617
|
+
},
|
|
15618
|
+
ref
|
|
15978
15619
|
) => {
|
|
15979
15620
|
const [playing, setPlaying] = React.useState(false);
|
|
15980
15621
|
const [speed, setSpeed] = React.useState(1);
|
|
@@ -16174,8 +15815,8 @@ import { Reply, ExternalLink, ChevronLeft, ChevronRight } from "lucide-react";
|
|
|
16174
15815
|
import { cn } from "../../../lib/utils";
|
|
16175
15816
|
import type { CarouselMediaProps } from "./types";
|
|
16176
15817
|
|
|
16177
|
-
const CarouselMedia = React.forwardRef(
|
|
16178
|
-
({ className, cards, cardWidth = 260, imageHeight = 200, ...props }
|
|
15818
|
+
const CarouselMedia = React.forwardRef<HTMLDivElement, CarouselMediaProps>(
|
|
15819
|
+
({ className, cards, cardWidth = 260, imageHeight = 200, ...props }, ref) => {
|
|
16179
15820
|
const scrollRef = useRef<HTMLDivElement>(null);
|
|
16180
15821
|
const [canScrollLeft, setCanScrollLeft] = useState(false);
|
|
16181
15822
|
const [canScrollRight, setCanScrollRight] = useState(
|
|
@@ -16429,7 +16070,7 @@ function DeliveryFooter({
|
|
|
16429
16070
|
* </ChatBubble>
|
|
16430
16071
|
* \`\`\`
|
|
16431
16072
|
*/
|
|
16432
|
-
const ChatBubble = React.forwardRef(
|
|
16073
|
+
const ChatBubble = React.forwardRef<HTMLDivElement, ChatBubbleProps>(
|
|
16433
16074
|
(
|
|
16434
16075
|
{
|
|
16435
16076
|
variant,
|
|
@@ -16444,8 +16085,8 @@ const ChatBubble = React.forwardRef(
|
|
|
16444
16085
|
children,
|
|
16445
16086
|
className,
|
|
16446
16087
|
...props
|
|
16447
|
-
}
|
|
16448
|
-
ref
|
|
16088
|
+
},
|
|
16089
|
+
ref
|
|
16449
16090
|
) => {
|
|
16450
16091
|
const hasMedia = !!media;
|
|
16451
16092
|
|
|
@@ -16618,7 +16259,7 @@ import type { ChatComposerProps } from "./types";
|
|
|
16618
16259
|
* />
|
|
16619
16260
|
* \`\`\`
|
|
16620
16261
|
*/
|
|
16621
|
-
const ChatComposer = React.forwardRef(
|
|
16262
|
+
const ChatComposer = React.forwardRef<HTMLDivElement, ChatComposerProps>(
|
|
16622
16263
|
(
|
|
16623
16264
|
{
|
|
16624
16265
|
className,
|
|
@@ -16642,8 +16283,8 @@ const ChatComposer = React.forwardRef(
|
|
|
16642
16283
|
expiredMessage = "This chat has expired. Send a template to continue.",
|
|
16643
16284
|
onTemplateClick,
|
|
16644
16285
|
...props
|
|
16645
|
-
}
|
|
16646
|
-
ref
|
|
16286
|
+
},
|
|
16287
|
+
ref
|
|
16647
16288
|
) => {
|
|
16648
16289
|
const textareaRef = React.useRef<HTMLTextAreaElement>(null);
|
|
16649
16290
|
|
|
@@ -16860,7 +16501,7 @@ import { cn } from "../../../lib/utils";
|
|
|
16860
16501
|
import { File, FileSpreadsheet, ArrowDownToLine } from "lucide-react";
|
|
16861
16502
|
import type { DocMediaProps } from "./types";
|
|
16862
16503
|
|
|
16863
|
-
const DocMedia = React.forwardRef(
|
|
16504
|
+
const DocMedia = React.forwardRef<HTMLDivElement, DocMediaProps>(
|
|
16864
16505
|
(
|
|
16865
16506
|
{
|
|
16866
16507
|
className,
|
|
@@ -16873,8 +16514,8 @@ const DocMedia = React.forwardRef(
|
|
|
16873
16514
|
caption,
|
|
16874
16515
|
onDownload,
|
|
16875
16516
|
...props
|
|
16876
|
-
}
|
|
16877
|
-
ref
|
|
16517
|
+
},
|
|
16518
|
+
ref
|
|
16878
16519
|
) => {
|
|
16879
16520
|
if (variant === "preview") {
|
|
16880
16521
|
return (
|
|
@@ -17061,7 +16702,7 @@ import type { VideoMediaProps } from "./types";
|
|
|
17061
16702
|
|
|
17062
16703
|
const DEFAULT_SPEED_OPTIONS = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2];
|
|
17063
16704
|
|
|
17064
|
-
const VideoMedia = React.forwardRef(
|
|
16705
|
+
const VideoMedia = React.forwardRef<HTMLDivElement, VideoMediaProps>(
|
|
17065
16706
|
(
|
|
17066
16707
|
{
|
|
17067
16708
|
className,
|
|
@@ -17073,8 +16714,8 @@ const VideoMedia = React.forwardRef(
|
|
|
17073
16714
|
onSpeedChange,
|
|
17074
16715
|
onClick,
|
|
17075
16716
|
...props
|
|
17076
|
-
}
|
|
17077
|
-
ref
|
|
16717
|
+
},
|
|
16718
|
+
ref
|
|
17078
16719
|
) => {
|
|
17079
16720
|
const [playing, setPlaying] = useState(false);
|
|
17080
16721
|
const [muted, setMuted] = useState(false);
|
|
@@ -17307,10 +16948,7 @@ export type { VideoMediaProps } from "./types";
|
|
|
17307
16948
|
"creatable-multi-select",
|
|
17308
16949
|
"page-header",
|
|
17309
16950
|
"tag",
|
|
17310
|
-
"file-upload-modal"
|
|
17311
|
-
"form-modal",
|
|
17312
|
-
"text-field",
|
|
17313
|
-
"textarea"
|
|
16951
|
+
"file-upload-modal"
|
|
17314
16952
|
],
|
|
17315
16953
|
isMultiFile: true,
|
|
17316
16954
|
directory: "ivr-bot",
|
|
@@ -17362,7 +17000,7 @@ const DEFAULT_DATA: IvrBotConfigData = {
|
|
|
17362
17000
|
};
|
|
17363
17001
|
|
|
17364
17002
|
// \u2500\u2500\u2500 Main IvrBotConfig \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
17365
|
-
export const IvrBotConfig = React.forwardRef(
|
|
17003
|
+
export const IvrBotConfig = React.forwardRef<HTMLDivElement, IvrBotConfigProps>(
|
|
17366
17004
|
(
|
|
17367
17005
|
{
|
|
17368
17006
|
botTitle = "IVR bot",
|
|
@@ -17409,8 +17047,8 @@ export const IvrBotConfig = React.forwardRef(
|
|
|
17409
17047
|
callEndThresholdMin,
|
|
17410
17048
|
callEndThresholdMax,
|
|
17411
17049
|
className,
|
|
17412
|
-
}
|
|
17413
|
-
ref
|
|
17050
|
+
},
|
|
17051
|
+
ref
|
|
17414
17052
|
) => {
|
|
17415
17053
|
const [data, setData] = React.useState<IvrBotConfigData>({
|
|
17416
17054
|
...DEFAULT_DATA,
|
|
@@ -17613,7 +17251,7 @@ IvrBotConfig.displayName = "IvrBotConfig";
|
|
|
17613
17251
|
{
|
|
17614
17252
|
name: "create-function-modal.tsx",
|
|
17615
17253
|
content: prefixTailwindClasses(`import * as React from "react";
|
|
17616
|
-
import { Trash2, ChevronDown, X, Plus
|
|
17254
|
+
import { Trash2, ChevronDown, X, Plus } from "lucide-react";
|
|
17617
17255
|
import { cn } from "../../../lib/utils";
|
|
17618
17256
|
import {
|
|
17619
17257
|
Dialog,
|
|
@@ -17621,9 +17259,6 @@ import {
|
|
|
17621
17259
|
DialogTitle,
|
|
17622
17260
|
} from "../dialog";
|
|
17623
17261
|
import { Button } from "../button";
|
|
17624
|
-
import { FormModal } from "../form-modal";
|
|
17625
|
-
import { TextField } from "../text-field";
|
|
17626
|
-
import { Textarea } from "../textarea";
|
|
17627
17262
|
import type {
|
|
17628
17263
|
CreateFunctionModalProps,
|
|
17629
17264
|
CreateFunctionData,
|
|
@@ -17631,12 +17266,10 @@ import type {
|
|
|
17631
17266
|
FunctionTabType,
|
|
17632
17267
|
HttpMethod,
|
|
17633
17268
|
KeyValuePair,
|
|
17634
|
-
VariableGroup,
|
|
17635
|
-
VariableItem,
|
|
17636
|
-
VariableFormData,
|
|
17637
17269
|
} from "./types";
|
|
17638
17270
|
|
|
17639
17271
|
const HTTP_METHODS: HttpMethod[] = ["GET", "POST", "PUT", "DELETE", "PATCH"];
|
|
17272
|
+
const METHODS_WITH_BODY: HttpMethod[] = ["POST", "PUT", "PATCH"];
|
|
17640
17273
|
const FUNCTION_NAME_MAX = 100;
|
|
17641
17274
|
const BODY_MAX = 4000;
|
|
17642
17275
|
const URL_MAX = 500;
|
|
@@ -17644,8 +17277,6 @@ const HEADER_KEY_MAX = 512;
|
|
|
17644
17277
|
const HEADER_VALUE_MAX = 2048;
|
|
17645
17278
|
|
|
17646
17279
|
const FUNCTION_NAME_REGEX = /^(?!_+$)(?=.*[a-zA-Z])[a-zA-Z][a-zA-Z0-9_]*$/;
|
|
17647
|
-
const VARIABLE_NAME_MAX = 30;
|
|
17648
|
-
const VARIABLE_NAME_REGEX = /^[a-zA-Z][a-zA-Z0-9_]*$/;
|
|
17649
17280
|
const URL_REGEX = /^https?:\\/\\//;
|
|
17650
17281
|
const HEADER_KEY_REGEX = /^[!#$%&'*+\\-.^_\`|~0-9a-zA-Z]+$/;
|
|
17651
17282
|
// Query parameter validation (aligned with apiIntegrationSchema.queryParams)
|
|
@@ -17701,30 +17332,6 @@ function extractVarRefs(texts: string[]): string[] {
|
|
|
17701
17332
|
return Array.from(new Set(all));
|
|
17702
17333
|
}
|
|
17703
17334
|
|
|
17704
|
-
// \u2500\u2500 Value segment parser \u2014 splits "text {{var}} text" into typed segments \u2500\u2500\u2500\u2500\u2500
|
|
17705
|
-
|
|
17706
|
-
type ValueSegment =
|
|
17707
|
-
| { type: "text"; content: string }
|
|
17708
|
-
| { type: "var"; name: string; raw: string };
|
|
17709
|
-
|
|
17710
|
-
function parseValueSegments(value: string): ValueSegment[] {
|
|
17711
|
-
const segments: ValueSegment[] = [];
|
|
17712
|
-
const regex = /\\{\\{([^}]+)\\}\\}/g;
|
|
17713
|
-
let lastIndex = 0;
|
|
17714
|
-
let match;
|
|
17715
|
-
while ((match = regex.exec(value)) !== null) {
|
|
17716
|
-
if (match.index > lastIndex) {
|
|
17717
|
-
segments.push({ type: "text", content: value.slice(lastIndex, match.index) });
|
|
17718
|
-
}
|
|
17719
|
-
segments.push({ type: "var", name: match[1], raw: match[0] });
|
|
17720
|
-
lastIndex = regex.lastIndex;
|
|
17721
|
-
}
|
|
17722
|
-
if (lastIndex < value.length) {
|
|
17723
|
-
segments.push({ type: "text", content: value.slice(lastIndex) });
|
|
17724
|
-
}
|
|
17725
|
-
return segments;
|
|
17726
|
-
}
|
|
17727
|
-
|
|
17728
17335
|
/** Mirror-div technique \u2014 returns { top, left } relative to the element's top-left corner. */
|
|
17729
17336
|
function getCaretPixelPos(
|
|
17730
17337
|
el: HTMLTextAreaElement | HTMLInputElement,
|
|
@@ -17774,320 +17381,71 @@ function getCaretPixelPos(
|
|
|
17774
17381
|
|
|
17775
17382
|
// Uses same visual classes as DropdownMenuContent + DropdownMenuItem.
|
|
17776
17383
|
// Position is cursor-anchored via getCaretPixelPos.
|
|
17777
|
-
// No search bar \u2014 typing after {{ already filters via filterQuery.
|
|
17778
17384
|
function VarPopup({
|
|
17779
17385
|
variables,
|
|
17780
|
-
variableGroups,
|
|
17781
|
-
filterQuery = "",
|
|
17782
17386
|
onSelect,
|
|
17783
|
-
onAddVariable,
|
|
17784
|
-
onEditVariable,
|
|
17785
17387
|
style,
|
|
17786
17388
|
}: {
|
|
17787
17389
|
variables: string[];
|
|
17788
|
-
variableGroups?: VariableGroup[];
|
|
17789
|
-
filterQuery?: string;
|
|
17790
17390
|
onSelect: (v: string) => void;
|
|
17791
|
-
onAddVariable?: () => void;
|
|
17792
|
-
onEditVariable?: (variable: string) => void;
|
|
17793
17391
|
style?: React.CSSProperties;
|
|
17794
17392
|
}) {
|
|
17795
|
-
|
|
17796
|
-
|
|
17797
|
-
if (!hasGroups && variables.length === 0) return null;
|
|
17798
|
-
|
|
17799
|
-
// Flat mode \u2014 variables are already pre-filtered by VariableInput
|
|
17800
|
-
if (!hasGroups) {
|
|
17801
|
-
return (
|
|
17802
|
-
<div
|
|
17803
|
-
role="listbox"
|
|
17804
|
-
style={style}
|
|
17805
|
-
className="absolute z-[9999] min-w-[14rem] max-w-sm rounded-md border border-semantic-border-layout bg-semantic-bg-primary py-1 text-semantic-text-primary shadow-md"
|
|
17806
|
-
>
|
|
17807
|
-
{/* Add new variable */}
|
|
17808
|
-
{onAddVariable && (
|
|
17809
|
-
<button
|
|
17810
|
-
type="button"
|
|
17811
|
-
onMouseDown={(e) => { e.preventDefault(); onAddVariable(); }}
|
|
17812
|
-
className="flex w-full items-center gap-2 px-3 py-2 text-sm font-medium text-semantic-text-primary hover:bg-semantic-bg-ui transition-colors"
|
|
17813
|
-
>
|
|
17814
|
-
<Plus className="size-3.5 shrink-0" />
|
|
17815
|
-
Add new variable
|
|
17816
|
-
</button>
|
|
17817
|
-
)}
|
|
17818
|
-
|
|
17819
|
-
{/* Variable list */}
|
|
17820
|
-
<div className="max-h-48 overflow-y-auto p-1">
|
|
17821
|
-
{variables.map((v) => (
|
|
17822
|
-
<button
|
|
17823
|
-
key={v}
|
|
17824
|
-
type="button"
|
|
17825
|
-
role="option"
|
|
17826
|
-
onMouseDown={(e) => { e.preventDefault(); onSelect(v); }}
|
|
17827
|
-
className="relative flex w-full cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-semantic-bg-ui"
|
|
17828
|
-
>
|
|
17829
|
-
{v}
|
|
17830
|
-
</button>
|
|
17831
|
-
))}
|
|
17832
|
-
{variables.length === 0 && (
|
|
17833
|
-
<p className="m-0 px-2 py-1.5 text-sm text-semantic-text-muted">No variables found</p>
|
|
17834
|
-
)}
|
|
17835
|
-
</div>
|
|
17836
|
-
</div>
|
|
17837
|
-
);
|
|
17838
|
-
}
|
|
17839
|
-
|
|
17840
|
-
// Grouped mode \u2014 filter by the {{ trigger query
|
|
17841
|
-
const lowerQuery = filterQuery.toLowerCase();
|
|
17842
|
-
const filteredGroups = variableGroups.map((g) => ({
|
|
17843
|
-
...g,
|
|
17844
|
-
items: g.items.filter((item) =>
|
|
17845
|
-
item.name.toLowerCase().includes(lowerQuery)
|
|
17846
|
-
),
|
|
17847
|
-
})).filter((g) => g.items.length > 0);
|
|
17848
|
-
|
|
17393
|
+
if (variables.length === 0) return null;
|
|
17849
17394
|
return (
|
|
17850
17395
|
<div
|
|
17851
17396
|
role="listbox"
|
|
17852
17397
|
style={style}
|
|
17853
|
-
className="absolute z-[9999] min-w-[
|
|
17398
|
+
className="absolute z-[9999] min-w-[8rem] max-w-xs overflow-hidden rounded-md border border-semantic-border-layout bg-semantic-bg-primary p-1 text-semantic-text-primary shadow-md"
|
|
17854
17399
|
>
|
|
17855
|
-
{
|
|
17856
|
-
|
|
17857
|
-
|
|
17858
|
-
|
|
17859
|
-
|
|
17860
|
-
|
|
17861
|
-
|
|
17862
|
-
|
|
17863
|
-
|
|
17864
|
-
|
|
17865
|
-
|
|
17866
|
-
|
|
17867
|
-
|
|
17868
|
-
|
|
17869
|
-
|
|
17870
|
-
{/* Grouped variable list */}
|
|
17871
|
-
<div className="max-h-48 overflow-y-auto p-1">
|
|
17872
|
-
{filteredGroups.map((group) => (
|
|
17873
|
-
<div key={group.label}>
|
|
17874
|
-
<p className="m-0 px-2 pt-2 pb-1 text-sm font-medium text-semantic-text-muted">
|
|
17875
|
-
{group.label}
|
|
17876
|
-
</p>
|
|
17877
|
-
{group.items.map((item) => {
|
|
17878
|
-
const insertValue = item.value ?? \`{{\${item.name}}}\`;
|
|
17879
|
-
return (
|
|
17880
|
-
<div key={item.name} className="flex items-center rounded-sm transition-colors hover:bg-semantic-bg-ui">
|
|
17881
|
-
<button
|
|
17882
|
-
type="button"
|
|
17883
|
-
role="option"
|
|
17884
|
-
onMouseDown={(e) => { e.preventDefault(); onSelect(insertValue); }}
|
|
17885
|
-
className="relative flex flex-1 min-w-0 cursor-pointer select-none items-center px-2 py-1.5 text-sm outline-none"
|
|
17886
|
-
>
|
|
17887
|
-
{\`{{\${item.name}}}\`}
|
|
17888
|
-
</button>
|
|
17889
|
-
{item.editable && onEditVariable && (
|
|
17890
|
-
<button
|
|
17891
|
-
type="button"
|
|
17892
|
-
onMouseDown={(e) => { e.preventDefault(); onEditVariable(item.name); }}
|
|
17893
|
-
className="shrink-0 p-1.5 rounded text-semantic-text-muted hover:text-semantic-text-primary transition-colors"
|
|
17894
|
-
aria-label={\`Edit \${item.name}\`}
|
|
17895
|
-
>
|
|
17896
|
-
<Pencil className="size-3.5" />
|
|
17897
|
-
</button>
|
|
17898
|
-
)}
|
|
17899
|
-
</div>
|
|
17900
|
-
);
|
|
17901
|
-
})}
|
|
17902
|
-
</div>
|
|
17903
|
-
))}
|
|
17904
|
-
{filteredGroups.length === 0 && (
|
|
17905
|
-
<p className="m-0 px-2 py-1.5 text-sm text-semantic-text-muted">No variables found</p>
|
|
17906
|
-
)}
|
|
17907
|
-
</div>
|
|
17400
|
+
{variables.map((v) => (
|
|
17401
|
+
<button
|
|
17402
|
+
key={v}
|
|
17403
|
+
type="button"
|
|
17404
|
+
role="option"
|
|
17405
|
+
aria-selected={false}
|
|
17406
|
+
onMouseDown={(e) => {
|
|
17407
|
+
e.preventDefault(); // keep input focused so blur doesn't close popup first
|
|
17408
|
+
onSelect(v);
|
|
17409
|
+
}}
|
|
17410
|
+
className="relative flex w-full cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-semantic-bg-ui focus:bg-semantic-bg-ui"
|
|
17411
|
+
>
|
|
17412
|
+
{v}
|
|
17413
|
+
</button>
|
|
17414
|
+
))}
|
|
17908
17415
|
</div>
|
|
17909
17416
|
);
|
|
17910
17417
|
}
|
|
17911
17418
|
|
|
17912
|
-
// \u2500\u2500
|
|
17913
|
-
|
|
17914
|
-
function VariableFormModal({
|
|
17915
|
-
open,
|
|
17916
|
-
onOpenChange,
|
|
17917
|
-
mode,
|
|
17918
|
-
initialData,
|
|
17919
|
-
onSave,
|
|
17920
|
-
}: {
|
|
17921
|
-
open: boolean;
|
|
17922
|
-
onOpenChange: (open: boolean) => void;
|
|
17923
|
-
mode: "create" | "edit";
|
|
17924
|
-
initialData?: VariableItem;
|
|
17925
|
-
onSave: (data: VariableFormData) => void;
|
|
17926
|
-
}) {
|
|
17927
|
-
const [name, setName] = React.useState("");
|
|
17928
|
-
const [description, setDescription] = React.useState("");
|
|
17929
|
-
const [required, setRequired] = React.useState(false);
|
|
17930
|
-
const [nameError, setNameError] = React.useState("");
|
|
17931
|
-
|
|
17932
|
-
// Reset form when modal opens
|
|
17933
|
-
React.useEffect(() => {
|
|
17934
|
-
if (open) {
|
|
17935
|
-
setName(initialData?.name ?? "");
|
|
17936
|
-
setDescription(initialData?.description ?? "");
|
|
17937
|
-
setRequired(initialData?.required ?? false);
|
|
17938
|
-
setNameError("");
|
|
17939
|
-
}
|
|
17940
|
-
}, [open, initialData]);
|
|
17941
|
-
|
|
17942
|
-
const validateName = (v: string) => {
|
|
17943
|
-
if (!v.trim()) return "";
|
|
17944
|
-
if (!VARIABLE_NAME_REGEX.test(v)) {
|
|
17945
|
-
return "Variable name should start with alphabet; Cannot have special characters except underscore (_)";
|
|
17946
|
-
}
|
|
17947
|
-
return "";
|
|
17948
|
-
};
|
|
17949
|
-
|
|
17950
|
-
const handleNameChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
17951
|
-
const v = e.target.value;
|
|
17952
|
-
setName(v);
|
|
17953
|
-
setNameError(validateName(v));
|
|
17954
|
-
};
|
|
17955
|
-
|
|
17956
|
-
const handleSave = () => {
|
|
17957
|
-
const error = validateName(name);
|
|
17958
|
-
if (error || !name.trim()) {
|
|
17959
|
-
setNameError(error || "Variable name is required");
|
|
17960
|
-
return;
|
|
17961
|
-
}
|
|
17962
|
-
onSave({ name: name.trim(), description: description.trim() || undefined, required });
|
|
17963
|
-
};
|
|
17964
|
-
|
|
17965
|
-
return (
|
|
17966
|
-
<FormModal
|
|
17967
|
-
open={open}
|
|
17968
|
-
onOpenChange={onOpenChange}
|
|
17969
|
-
title={mode === "create" ? "Create new variable" : "Edit variable"}
|
|
17970
|
-
saveButtonText={mode === "create" ? "Save" : "Save Changes"}
|
|
17971
|
-
disableSave={!name.trim() || !!nameError}
|
|
17972
|
-
onSave={handleSave}
|
|
17973
|
-
size="default"
|
|
17974
|
-
>
|
|
17975
|
-
<div className="flex flex-col gap-4">
|
|
17976
|
-
<div className="flex flex-col gap-1.5">
|
|
17977
|
-
<label className="text-sm font-medium text-semantic-text-muted">
|
|
17978
|
-
Variable name{" "}
|
|
17979
|
-
<span className="text-semantic-error-primary">*</span>
|
|
17980
|
-
</label>
|
|
17981
|
-
<div className="relative">
|
|
17982
|
-
<input
|
|
17983
|
-
type="text"
|
|
17984
|
-
value={name}
|
|
17985
|
-
onChange={handleNameChange}
|
|
17986
|
-
placeholder="e.g., customer_name"
|
|
17987
|
-
maxLength={VARIABLE_NAME_MAX}
|
|
17988
|
-
className={cn(inputCls, "pr-16")}
|
|
17989
|
-
/>
|
|
17990
|
-
<span className="absolute right-3 top-1/2 -translate-y-1/2 text-sm text-semantic-text-muted pointer-events-none">
|
|
17991
|
-
{name.length}/{VARIABLE_NAME_MAX}
|
|
17992
|
-
</span>
|
|
17993
|
-
</div>
|
|
17994
|
-
<span className={cn("text-sm", nameError ? "text-semantic-error-primary" : "text-semantic-text-muted")}>
|
|
17995
|
-
{nameError || "Variable name should start with alphabet; Cannot have special characters except underscore (_)"}
|
|
17996
|
-
</span>
|
|
17997
|
-
</div>
|
|
17998
|
-
<TextField
|
|
17999
|
-
label="Description (optional)"
|
|
18000
|
-
placeholder="What this variable represents"
|
|
18001
|
-
value={description}
|
|
18002
|
-
onChange={(e) => setDescription(e.target.value)}
|
|
18003
|
-
/>
|
|
18004
|
-
<div className="flex flex-col gap-1.5">
|
|
18005
|
-
<span className="text-sm font-medium text-semantic-text-muted">Required</span>
|
|
18006
|
-
<div className="flex items-center gap-6">
|
|
18007
|
-
<label className="flex items-center gap-2 cursor-pointer">
|
|
18008
|
-
<input
|
|
18009
|
-
type="radio"
|
|
18010
|
-
name="variable-required"
|
|
18011
|
-
checked={required}
|
|
18012
|
-
onChange={() => setRequired(true)}
|
|
18013
|
-
className="size-4 accent-semantic-primary"
|
|
18014
|
-
/>
|
|
18015
|
-
<span className="text-base text-semantic-text-primary">Yes</span>
|
|
18016
|
-
</label>
|
|
18017
|
-
<label className="flex items-center gap-2 cursor-pointer">
|
|
18018
|
-
<input
|
|
18019
|
-
type="radio"
|
|
18020
|
-
name="variable-required"
|
|
18021
|
-
checked={!required}
|
|
18022
|
-
onChange={() => setRequired(false)}
|
|
18023
|
-
className="size-4 accent-semantic-primary"
|
|
18024
|
-
/>
|
|
18025
|
-
<span className="text-base text-semantic-text-primary">No</span>
|
|
18026
|
-
</label>
|
|
18027
|
-
</div>
|
|
18028
|
-
</div>
|
|
18029
|
-
</div>
|
|
18030
|
-
</FormModal>
|
|
18031
|
-
);
|
|
18032
|
-
}
|
|
18033
|
-
|
|
18034
|
-
// \u2500\u2500 VariableInput \u2014 input with {{ autocomplete + badge display \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
17419
|
+
// \u2500\u2500 VariableInput \u2014 input with {{ autocomplete \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
18035
17420
|
|
|
18036
17421
|
function VariableInput({
|
|
18037
17422
|
value,
|
|
18038
17423
|
onChange,
|
|
18039
17424
|
sessionVariables,
|
|
18040
|
-
variableGroups,
|
|
18041
|
-
onAddVariable,
|
|
18042
|
-
onEditVariable,
|
|
18043
17425
|
placeholder,
|
|
18044
17426
|
maxLength,
|
|
18045
17427
|
className,
|
|
18046
17428
|
inputRef: externalInputRef,
|
|
18047
|
-
disabled,
|
|
18048
17429
|
...inputProps
|
|
18049
17430
|
}: {
|
|
18050
17431
|
value: string;
|
|
18051
17432
|
onChange: (v: string) => void;
|
|
18052
17433
|
sessionVariables: string[];
|
|
18053
|
-
variableGroups?: VariableGroup[];
|
|
18054
|
-
onAddVariable?: () => void;
|
|
18055
|
-
onEditVariable?: (variable: string) => void;
|
|
18056
17434
|
placeholder?: string;
|
|
18057
17435
|
maxLength?: number;
|
|
18058
17436
|
className?: string;
|
|
18059
17437
|
inputRef?: React.RefObject<HTMLInputElement>;
|
|
18060
|
-
disabled?: boolean;
|
|
18061
17438
|
[k: string]: unknown;
|
|
18062
17439
|
}) {
|
|
18063
17440
|
const internalRef = React.useRef<HTMLInputElement>(null);
|
|
18064
17441
|
const inputRef = externalInputRef ?? internalRef;
|
|
18065
|
-
const displayRef = React.useRef<HTMLDivElement>(null);
|
|
18066
17442
|
const [trigger, setTrigger] = React.useState<TriggerState | null>(null);
|
|
18067
17443
|
const [popupStyle, setPopupStyle] = React.useState<React.CSSProperties | undefined>();
|
|
18068
|
-
const [isEditing, setIsEditing] = React.useState(false);
|
|
18069
|
-
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
18070
|
-
const [isOverflowing, setIsOverflowing] = React.useState(false);
|
|
18071
17444
|
|
|
18072
17445
|
const filtered = trigger
|
|
18073
17446
|
? sessionVariables.filter((v) => v.toLowerCase().includes(trigger.query))
|
|
18074
17447
|
: [];
|
|
18075
17448
|
|
|
18076
|
-
// Parse value into text + variable segments
|
|
18077
|
-
const segments = React.useMemo(() => parseValueSegments(value), [value]);
|
|
18078
|
-
const hasVariables = segments.some((s) => s.type === "var");
|
|
18079
|
-
const showDisplay = !isEditing && value.length > 0 && hasVariables;
|
|
18080
|
-
|
|
18081
|
-
// Check overflow in display mode
|
|
18082
|
-
React.useEffect(() => {
|
|
18083
|
-
if (showDisplay && displayRef.current && !isExpanded) {
|
|
18084
|
-
const el = displayRef.current;
|
|
18085
|
-
setIsOverflowing(el.scrollWidth > el.clientWidth);
|
|
18086
|
-
} else {
|
|
18087
|
-
setIsOverflowing(false);
|
|
18088
|
-
}
|
|
18089
|
-
}, [showDisplay, value, isExpanded]);
|
|
18090
|
-
|
|
18091
17449
|
const updatePopupPos = (el: HTMLInputElement, cursor: number) => {
|
|
18092
17450
|
const caret = getCaretPixelPos(el, cursor);
|
|
18093
17451
|
const lineHeight = parseFloat(window.getComputedStyle(el).lineHeight) || 20;
|
|
@@ -18116,15 +17474,13 @@ function VariableInput({
|
|
|
18116
17474
|
|
|
18117
17475
|
return (
|
|
18118
17476
|
<div className="relative w-full">
|
|
18119
|
-
{/* Input \u2014 always in DOM, hidden when display mode is active */}
|
|
18120
17477
|
<input
|
|
18121
17478
|
ref={inputRef}
|
|
18122
17479
|
type="text"
|
|
18123
17480
|
value={value}
|
|
18124
17481
|
placeholder={placeholder}
|
|
18125
17482
|
maxLength={maxLength}
|
|
18126
|
-
|
|
18127
|
-
className={cn(className, showDisplay && "opacity-0 pointer-events-none")}
|
|
17483
|
+
className={className}
|
|
18128
17484
|
onChange={(e) => {
|
|
18129
17485
|
onChange(e.target.value);
|
|
18130
17486
|
const cursor = e.target.selectionStart ?? e.target.value.length;
|
|
@@ -18136,88 +17492,10 @@ function VariableInput({
|
|
|
18136
17492
|
onKeyDown={(e) => {
|
|
18137
17493
|
if (e.key === "Escape") clearTrigger();
|
|
18138
17494
|
}}
|
|
18139
|
-
|
|
18140
|
-
onBlur={() => {
|
|
18141
|
-
clearTrigger();
|
|
18142
|
-
setIsEditing(false);
|
|
18143
|
-
setIsExpanded(false);
|
|
18144
|
-
}}
|
|
17495
|
+
onBlur={() => clearTrigger()}
|
|
18145
17496
|
{...inputProps}
|
|
18146
17497
|
/>
|
|
18147
|
-
|
|
18148
|
-
{/* Display mode \u2014 variable badges + text + overflow */}
|
|
18149
|
-
{showDisplay && (
|
|
18150
|
-
<div
|
|
18151
|
-
className={cn(
|
|
18152
|
-
"absolute cursor-text",
|
|
18153
|
-
!isExpanded && "inset-0 flex items-center",
|
|
18154
|
-
isExpanded && "inset-x-0 top-0 z-10",
|
|
18155
|
-
disabled && "opacity-50 cursor-not-allowed"
|
|
18156
|
-
)}
|
|
18157
|
-
onClick={() => {
|
|
18158
|
-
if (!disabled) inputRef.current?.focus();
|
|
18159
|
-
}}
|
|
18160
|
-
>
|
|
18161
|
-
<div
|
|
18162
|
-
ref={displayRef}
|
|
18163
|
-
className={cn(
|
|
18164
|
-
"flex items-center gap-1 px-2",
|
|
18165
|
-
!isExpanded && "flex-1 min-w-0 overflow-hidden",
|
|
18166
|
-
isExpanded && "flex-wrap bg-semantic-bg-primary border border-semantic-border-input rounded py-1.5 shadow-sm"
|
|
18167
|
-
)}
|
|
18168
|
-
>
|
|
18169
|
-
{segments.map((seg, i) =>
|
|
18170
|
-
seg.type === "text" ? (
|
|
18171
|
-
<span key={i} className="text-sm text-semantic-text-primary whitespace-pre shrink-0">{seg.content}</span>
|
|
18172
|
-
) : (
|
|
18173
|
-
<span
|
|
18174
|
-
key={i}
|
|
18175
|
-
className="inline-flex items-center gap-1 shrink-0 rounded px-1.5 py-0.5 text-sm bg-semantic-info-surface text-semantic-text-primary"
|
|
18176
|
-
>
|
|
18177
|
-
{seg.name}
|
|
18178
|
-
{onEditVariable && (
|
|
18179
|
-
<button
|
|
18180
|
-
type="button"
|
|
18181
|
-
onMouseDown={(e) => {
|
|
18182
|
-
e.preventDefault();
|
|
18183
|
-
e.stopPropagation();
|
|
18184
|
-
onEditVariable(seg.name);
|
|
18185
|
-
}}
|
|
18186
|
-
className="p-0.5 text-semantic-text-muted hover:text-semantic-text-primary transition-colors"
|
|
18187
|
-
>
|
|
18188
|
-
<Pencil className="size-3" />
|
|
18189
|
-
</button>
|
|
18190
|
-
)}
|
|
18191
|
-
</span>
|
|
18192
|
-
)
|
|
18193
|
-
)}
|
|
18194
|
-
</div>
|
|
18195
|
-
{isOverflowing && !isExpanded && (
|
|
18196
|
-
<button
|
|
18197
|
-
type="button"
|
|
18198
|
-
onMouseDown={(e) => {
|
|
18199
|
-
e.preventDefault();
|
|
18200
|
-
e.stopPropagation();
|
|
18201
|
-
setIsExpanded(true);
|
|
18202
|
-
}}
|
|
18203
|
-
className="shrink-0 px-1 text-sm font-medium text-semantic-text-muted hover:text-semantic-text-primary"
|
|
18204
|
-
>
|
|
18205
|
-
...
|
|
18206
|
-
</button>
|
|
18207
|
-
)}
|
|
18208
|
-
</div>
|
|
18209
|
-
)}
|
|
18210
|
-
|
|
18211
|
-
{/* VarPopup */}
|
|
18212
|
-
<VarPopup
|
|
18213
|
-
variables={filtered}
|
|
18214
|
-
variableGroups={trigger ? variableGroups : undefined}
|
|
18215
|
-
filterQuery={trigger?.query ?? ""}
|
|
18216
|
-
onSelect={handleSelect}
|
|
18217
|
-
onAddVariable={onAddVariable}
|
|
18218
|
-
onEditVariable={onEditVariable}
|
|
18219
|
-
style={popupStyle}
|
|
18220
|
-
/>
|
|
17498
|
+
<VarPopup variables={filtered} onSelect={handleSelect} style={popupStyle} />
|
|
18221
17499
|
</div>
|
|
18222
17500
|
);
|
|
18223
17501
|
}
|
|
@@ -18227,7 +17505,7 @@ const inputCls = cn(
|
|
|
18227
17505
|
"w-full h-[42px] px-4 text-base rounded border",
|
|
18228
17506
|
"border-semantic-border-input bg-semantic-bg-primary",
|
|
18229
17507
|
"text-semantic-text-primary placeholder:text-semantic-text-muted",
|
|
18230
|
-
"outline-none",
|
|
17508
|
+
"outline-none hover:border-semantic-border-input-focus",
|
|
18231
17509
|
"focus:border-semantic-border-input-focus focus:shadow-[0_0_0_1px_rgba(43,188,202,0.15)]",
|
|
18232
17510
|
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
18233
17511
|
);
|
|
@@ -18236,7 +17514,7 @@ const textareaCls = cn(
|
|
|
18236
17514
|
"w-full px-4 py-2.5 text-base rounded border resize-none",
|
|
18237
17515
|
"border-semantic-border-input bg-semantic-bg-primary",
|
|
18238
17516
|
"text-semantic-text-primary placeholder:text-semantic-text-muted",
|
|
18239
|
-
"outline-none",
|
|
17517
|
+
"outline-none hover:border-semantic-border-input-focus",
|
|
18240
17518
|
"focus:border-semantic-border-input-focus focus:shadow-[0_0_0_1px_rgba(43,188,202,0.15)]",
|
|
18241
17519
|
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
18242
17520
|
);
|
|
@@ -18254,9 +17532,6 @@ function KeyValueTable({
|
|
|
18254
17532
|
keyRegex,
|
|
18255
17533
|
keyRegexError,
|
|
18256
17534
|
sessionVariables = [],
|
|
18257
|
-
variableGroups,
|
|
18258
|
-
onAddVariable,
|
|
18259
|
-
onEditVariable,
|
|
18260
17535
|
disabled = false,
|
|
18261
17536
|
}: {
|
|
18262
17537
|
rows: KeyValuePair[];
|
|
@@ -18268,9 +17543,6 @@ function KeyValueTable({
|
|
|
18268
17543
|
keyRegex?: RegExp;
|
|
18269
17544
|
keyRegexError?: string;
|
|
18270
17545
|
sessionVariables?: string[];
|
|
18271
|
-
variableGroups?: VariableGroup[];
|
|
18272
|
-
onAddVariable?: () => void;
|
|
18273
|
-
onEditVariable?: (variable: string) => void;
|
|
18274
17546
|
disabled?: boolean;
|
|
18275
17547
|
}) {
|
|
18276
17548
|
const update = (id: string, patch: Partial<KeyValuePair>) => {
|
|
@@ -18302,14 +17574,14 @@ function KeyValueTable({
|
|
|
18302
17574
|
|
|
18303
17575
|
return (
|
|
18304
17576
|
<div className="flex flex-col gap-1.5">
|
|
18305
|
-
<span className="text-
|
|
18306
|
-
<div className="border border-semantic-border-layout rounded">
|
|
17577
|
+
<span className="text-xs text-semantic-text-muted">{label}</span>
|
|
17578
|
+
<div className="border border-semantic-border-layout rounded overflow-hidden">
|
|
18307
17579
|
{/* Column headers \u2014 desktop only; border-r on Key cell defines column boundary */}
|
|
18308
|
-
<div className="hidden sm:flex border-b border-semantic-border-layout
|
|
18309
|
-
<div className="flex-1 min-w-0 px-3 py-2 text-
|
|
17580
|
+
<div className="hidden sm:flex bg-semantic-bg-ui border-b border-semantic-border-layout">
|
|
17581
|
+
<div className="flex-1 min-w-0 px-3 py-2 text-xs font-semibold text-semantic-text-muted border-r border-semantic-border-layout">
|
|
18310
17582
|
Key
|
|
18311
17583
|
</div>
|
|
18312
|
-
<div className="flex-[2] min-w-0 px-3 py-2 text-
|
|
17584
|
+
<div className="flex-[2] min-w-0 px-3 py-2 text-xs font-semibold text-semantic-text-muted">
|
|
18313
17585
|
Value
|
|
18314
17586
|
</div>
|
|
18315
17587
|
<div className="w-10 shrink-0" aria-hidden="true" />
|
|
@@ -18325,7 +17597,7 @@ function KeyValueTable({
|
|
|
18325
17597
|
>
|
|
18326
17598
|
{/* Key column \u2014 border-r on column (not input) so it aligns with header */}
|
|
18327
17599
|
<div className="flex-1 flex flex-col min-w-0 sm:border-r sm:border-semantic-border-layout">
|
|
18328
|
-
<span className="sm:hidden px-3 pt-2.5 pb-0.5 text-
|
|
17600
|
+
<span className="sm:hidden px-3 pt-2.5 pb-0.5 text-[10px] font-semibold text-semantic-text-muted uppercase tracking-wide">
|
|
18329
17601
|
Key
|
|
18330
17602
|
</span>
|
|
18331
17603
|
<input
|
|
@@ -18336,36 +17608,45 @@ function KeyValueTable({
|
|
|
18336
17608
|
maxLength={keyMaxLength}
|
|
18337
17609
|
disabled={disabled}
|
|
18338
17610
|
className={cn(
|
|
18339
|
-
"w-full px-3 py-2.5 text-base text-semantic-text-primary placeholder:text-semantic-text-muted bg-semantic-bg-primary outline-none",
|
|
17611
|
+
"w-full px-3 py-2.5 text-base text-semantic-text-primary placeholder:text-semantic-text-muted bg-semantic-bg-primary outline-none focus:bg-semantic-bg-hover",
|
|
18340
17612
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
18341
|
-
errors.key && "
|
|
17613
|
+
errors.key && "border-semantic-error-primary"
|
|
18342
17614
|
)}
|
|
18343
17615
|
aria-invalid={Boolean(errors.key)}
|
|
17616
|
+
aria-describedby={errors.key ? \`err-key-\${row.id}\` : undefined}
|
|
18344
17617
|
/>
|
|
17618
|
+
{errors.key && (
|
|
17619
|
+
<p id={\`err-key-\${row.id}\`} className="m-0 px-3 pt-0.5 text-xs text-semantic-error-primary">
|
|
17620
|
+
{errors.key}
|
|
17621
|
+
</p>
|
|
17622
|
+
)}
|
|
18345
17623
|
</div>
|
|
18346
17624
|
|
|
18347
17625
|
{/* Value column \u2014 uses VariableInput for {{ autocomplete */}
|
|
18348
17626
|
<div className="flex-[2] flex flex-col min-w-0">
|
|
18349
|
-
<span className="sm:hidden px-3 pt-2.5 pb-0.5 text-
|
|
17627
|
+
<span className="sm:hidden px-3 pt-2.5 pb-0.5 text-[10px] font-semibold text-semantic-text-muted uppercase tracking-wide">
|
|
18350
17628
|
Value
|
|
18351
17629
|
</span>
|
|
18352
17630
|
<VariableInput
|
|
18353
17631
|
value={row.value}
|
|
18354
17632
|
onChange={(v) => update(row.id, { value: v })}
|
|
18355
17633
|
sessionVariables={sessionVariables}
|
|
18356
|
-
variableGroups={variableGroups}
|
|
18357
|
-
onAddVariable={onAddVariable}
|
|
18358
|
-
onEditVariable={onEditVariable}
|
|
18359
17634
|
placeholder="Type {{ to add variables"
|
|
18360
17635
|
maxLength={valueMaxLength}
|
|
18361
17636
|
disabled={disabled}
|
|
18362
17637
|
className={cn(
|
|
18363
|
-
"w-full px-3 py-2.5 text-base text-semantic-text-primary placeholder:text-semantic-text-muted bg-semantic-bg-primary outline-none",
|
|
17638
|
+
"w-full px-3 py-2.5 text-base text-semantic-text-primary placeholder:text-semantic-text-muted bg-semantic-bg-primary outline-none focus:bg-semantic-bg-hover",
|
|
18364
17639
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
18365
|
-
errors.value && "
|
|
17640
|
+
errors.value && "border-semantic-error-primary"
|
|
18366
17641
|
)}
|
|
18367
17642
|
aria-invalid={Boolean(errors.value)}
|
|
17643
|
+
aria-describedby={errors.value ? \`err-value-\${row.id}\` : undefined}
|
|
18368
17644
|
/>
|
|
17645
|
+
{errors.value && (
|
|
17646
|
+
<p id={\`err-value-\${row.id}\`} className="m-0 px-3 pt-0.5 text-xs text-semantic-error-primary">
|
|
17647
|
+
{errors.value}
|
|
17648
|
+
</p>
|
|
17649
|
+
)}
|
|
18369
17650
|
</div>
|
|
18370
17651
|
|
|
18371
17652
|
{/* Action column \u2014 delete aligned with row (same as KeyValueRow / knowledge-base-card) */}
|
|
@@ -18392,7 +17673,7 @@ function KeyValueTable({
|
|
|
18392
17673
|
onClick={add}
|
|
18393
17674
|
disabled={disabled}
|
|
18394
17675
|
className={cn(
|
|
18395
|
-
"w-full flex items-center gap-2 px-3 py-2.5 text-sm text-semantic-text-muted hover:bg-semantic-bg-
|
|
17676
|
+
"w-full flex items-center gap-2 px-3 py-2.5 text-sm text-semantic-text-muted hover:bg-semantic-bg-hover transition-colors",
|
|
18396
17677
|
disabled && "opacity-50 cursor-not-allowed"
|
|
18397
17678
|
)}
|
|
18398
17679
|
>
|
|
@@ -18400,35 +17681,15 @@ function KeyValueTable({
|
|
|
18400
17681
|
<span>Add row</span>
|
|
18401
17682
|
</button>
|
|
18402
17683
|
</div>
|
|
18403
|
-
|
|
18404
|
-
{/* Collected row errors \u2014 shown below the table */}
|
|
18405
|
-
{(() => {
|
|
18406
|
-
const allErrors = rows
|
|
18407
|
-
.map((row) => {
|
|
18408
|
-
const errs = getErrors(row);
|
|
18409
|
-
const msgs: string[] = [];
|
|
18410
|
-
if (errs.key) msgs.push(errs.key);
|
|
18411
|
-
if (errs.value) msgs.push(errs.value);
|
|
18412
|
-
return msgs;
|
|
18413
|
-
})
|
|
18414
|
-
.flat();
|
|
18415
|
-
if (allErrors.length === 0) return null;
|
|
18416
|
-
// Deduplicate
|
|
18417
|
-
const unique = Array.from(new Set(allErrors));
|
|
18418
|
-
return (
|
|
18419
|
-
<div className="flex flex-col gap-0.5">
|
|
18420
|
-
{unique.map((msg) => (
|
|
18421
|
-
<p key={msg} className="m-0 text-sm text-semantic-error-primary">{msg}</p>
|
|
18422
|
-
))}
|
|
18423
|
-
</div>
|
|
18424
|
-
);
|
|
18425
|
-
})()}
|
|
18426
17684
|
</div>
|
|
18427
17685
|
);
|
|
18428
17686
|
}
|
|
18429
17687
|
|
|
18430
17688
|
// \u2500\u2500 Modal \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
18431
|
-
export const CreateFunctionModal = React.forwardRef
|
|
17689
|
+
export const CreateFunctionModal = React.forwardRef<
|
|
17690
|
+
HTMLDivElement,
|
|
17691
|
+
CreateFunctionModalProps
|
|
17692
|
+
>(
|
|
18432
17693
|
(
|
|
18433
17694
|
{
|
|
18434
17695
|
open,
|
|
@@ -18442,13 +17703,10 @@ export const CreateFunctionModal = React.forwardRef(
|
|
|
18442
17703
|
initialStep = 1,
|
|
18443
17704
|
initialTab = "header",
|
|
18444
17705
|
sessionVariables = DEFAULT_SESSION_VARIABLES,
|
|
18445
|
-
variableGroups,
|
|
18446
|
-
onAddVariable,
|
|
18447
|
-
onEditVariable,
|
|
18448
17706
|
disabled = false,
|
|
18449
17707
|
className,
|
|
18450
|
-
}
|
|
18451
|
-
ref
|
|
17708
|
+
},
|
|
17709
|
+
ref
|
|
18452
17710
|
) => {
|
|
18453
17711
|
const [step, setStep] = React.useState<1 | 2>(initialStep);
|
|
18454
17712
|
|
|
@@ -18469,35 +17727,6 @@ export const CreateFunctionModal = React.forwardRef(
|
|
|
18469
17727
|
const [urlError, setUrlError] = React.useState("");
|
|
18470
17728
|
const [bodyError, setBodyError] = React.useState("");
|
|
18471
17729
|
|
|
18472
|
-
// Variable modal state
|
|
18473
|
-
const [varModalOpen, setVarModalOpen] = React.useState(false);
|
|
18474
|
-
const [varModalMode, setVarModalMode] = React.useState<"create" | "edit">("create");
|
|
18475
|
-
const [varModalInitialData, setVarModalInitialData] = React.useState<VariableItem | undefined>();
|
|
18476
|
-
|
|
18477
|
-
const handleAddVariableClick = () => {
|
|
18478
|
-
setVarModalMode("create");
|
|
18479
|
-
setVarModalInitialData(undefined);
|
|
18480
|
-
setVarModalOpen(true);
|
|
18481
|
-
};
|
|
18482
|
-
|
|
18483
|
-
const handleEditVariableClick = (variableName: string) => {
|
|
18484
|
-
const variable = variableGroups
|
|
18485
|
-
?.flatMap((g) => g.items)
|
|
18486
|
-
.find((item) => item.name === variableName);
|
|
18487
|
-
setVarModalMode("edit");
|
|
18488
|
-
setVarModalInitialData(variable ?? { name: variableName, editable: true });
|
|
18489
|
-
setVarModalOpen(true);
|
|
18490
|
-
};
|
|
18491
|
-
|
|
18492
|
-
const handleVariableSave = (data: VariableFormData) => {
|
|
18493
|
-
if (varModalMode === "create") {
|
|
18494
|
-
onAddVariable?.(data);
|
|
18495
|
-
} else {
|
|
18496
|
-
onEditVariable?.(varModalInitialData?.name ?? "", data);
|
|
18497
|
-
}
|
|
18498
|
-
setVarModalOpen(false);
|
|
18499
|
-
};
|
|
18500
|
-
|
|
18501
17730
|
// Variable trigger state for URL and body
|
|
18502
17731
|
const urlInputRef = React.useRef<HTMLInputElement>(null);
|
|
18503
17732
|
const bodyTextareaRef = React.useRef<HTMLTextAreaElement>(null);
|
|
@@ -18592,7 +17821,14 @@ export const CreateFunctionModal = React.forwardRef(
|
|
|
18592
17821
|
onOpenChange(false);
|
|
18593
17822
|
}, [reset, onOpenChange]);
|
|
18594
17823
|
|
|
18595
|
-
|
|
17824
|
+
const supportsBody = METHODS_WITH_BODY.includes(method);
|
|
17825
|
+
|
|
17826
|
+
// When switching to a method without body, reset to header tab if body was active
|
|
17827
|
+
React.useEffect(() => {
|
|
17828
|
+
if (!supportsBody && activeTab === "body") {
|
|
17829
|
+
setActiveTab("header");
|
|
17830
|
+
}
|
|
17831
|
+
}, [supportsBody, activeTab]);
|
|
18596
17832
|
|
|
18597
17833
|
const validateName = (value: string) => {
|
|
18598
17834
|
if (value.trim() && !FUNCTION_NAME_REGEX.test(value.trim())) {
|
|
@@ -18727,10 +17963,11 @@ export const CreateFunctionModal = React.forwardRef(
|
|
|
18727
17963
|
body: "Body",
|
|
18728
17964
|
};
|
|
18729
17965
|
|
|
18730
|
-
const visibleTabs: FunctionTabType[] =
|
|
17966
|
+
const visibleTabs: FunctionTabType[] = supportsBody
|
|
17967
|
+
? ["header", "queryParams", "body"]
|
|
17968
|
+
: ["header", "queryParams"];
|
|
18731
17969
|
|
|
18732
17970
|
return (
|
|
18733
|
-
<>
|
|
18734
17971
|
<Dialog open={open} onOpenChange={onOpenChange}>
|
|
18735
17972
|
<DialogContent
|
|
18736
17973
|
ref={ref}
|
|
@@ -18738,7 +17975,7 @@ export const CreateFunctionModal = React.forwardRef(
|
|
|
18738
17975
|
hideCloseButton
|
|
18739
17976
|
className={cn(
|
|
18740
17977
|
"flex flex-col gap-0 p-0 w-[calc(100vw-2rem)] sm:w-full",
|
|
18741
|
-
"max-h-[calc(
|
|
17978
|
+
"max-h-[calc(100svh-2rem)] overflow-hidden",
|
|
18742
17979
|
className
|
|
18743
17980
|
)}
|
|
18744
17981
|
>
|
|
@@ -18758,7 +17995,7 @@ export const CreateFunctionModal = React.forwardRef(
|
|
|
18758
17995
|
</div>
|
|
18759
17996
|
|
|
18760
17997
|
{/* \u2500\u2500 Scrollable body \u2500\u2500 */}
|
|
18761
|
-
<div className="flex-1 overflow-y-auto min-h-0
|
|
17998
|
+
<div className="flex-1 overflow-y-auto min-h-0 px-4 py-5 sm:px-6">
|
|
18762
17999
|
{/* \u2500 Step 1 \u2500 */}
|
|
18763
18000
|
{step === 1 && (
|
|
18764
18001
|
<div className="flex flex-col gap-5">
|
|
@@ -18785,33 +18022,44 @@ export const CreateFunctionModal = React.forwardRef(
|
|
|
18785
18022
|
placeholder="Enter name of the function"
|
|
18786
18023
|
className={cn(inputCls, "pr-16")}
|
|
18787
18024
|
/>
|
|
18788
|
-
<span className="absolute right-3 top-1/2 -translate-y-1/2 text-
|
|
18025
|
+
<span className="absolute right-3 top-1/2 -translate-y-1/2 text-xs italic text-semantic-text-muted pointer-events-none">
|
|
18789
18026
|
{name.length}/{FUNCTION_NAME_MAX}
|
|
18790
18027
|
</span>
|
|
18791
18028
|
</div>
|
|
18792
18029
|
{nameError && (
|
|
18793
|
-
<p className="m-0 text-
|
|
18030
|
+
<p className="m-0 text-xs text-semantic-error-primary">{nameError}</p>
|
|
18794
18031
|
)}
|
|
18795
18032
|
</div>
|
|
18796
18033
|
|
|
18797
|
-
<
|
|
18798
|
-
|
|
18799
|
-
|
|
18800
|
-
|
|
18801
|
-
|
|
18802
|
-
|
|
18803
|
-
|
|
18804
|
-
|
|
18805
|
-
|
|
18806
|
-
|
|
18807
|
-
|
|
18808
|
-
|
|
18809
|
-
|
|
18810
|
-
|
|
18811
|
-
|
|
18812
|
-
|
|
18813
|
-
|
|
18814
|
-
|
|
18034
|
+
<div className="flex flex-col gap-1.5">
|
|
18035
|
+
<label
|
|
18036
|
+
htmlFor="fn-prompt"
|
|
18037
|
+
className="text-sm font-semibold text-semantic-text-primary"
|
|
18038
|
+
>
|
|
18039
|
+
Prompt{" "}
|
|
18040
|
+
<span className="text-semantic-error-primary">*</span>
|
|
18041
|
+
</label>
|
|
18042
|
+
<div className="relative">
|
|
18043
|
+
<textarea
|
|
18044
|
+
id="fn-prompt"
|
|
18045
|
+
value={prompt}
|
|
18046
|
+
maxLength={promptMaxLength}
|
|
18047
|
+
disabled={disabled}
|
|
18048
|
+
onChange={(e) => setPrompt(e.target.value)}
|
|
18049
|
+
placeholder="Enter the description of the function"
|
|
18050
|
+
rows={5}
|
|
18051
|
+
className={cn(textareaCls, "pb-7")}
|
|
18052
|
+
/>
|
|
18053
|
+
<span className="absolute bottom-2 right-3 text-xs italic text-semantic-text-muted pointer-events-none">
|
|
18054
|
+
{prompt.length}/{promptMaxLength}
|
|
18055
|
+
</span>
|
|
18056
|
+
</div>
|
|
18057
|
+
{prompt.length > 0 && prompt.trim().length < promptMinLength && (
|
|
18058
|
+
<p className="m-0 text-xs text-semantic-error-primary">
|
|
18059
|
+
Minimum {promptMinLength} characters required
|
|
18060
|
+
</p>
|
|
18061
|
+
)}
|
|
18062
|
+
</div>
|
|
18815
18063
|
</div>
|
|
18816
18064
|
)}
|
|
18817
18065
|
|
|
@@ -18820,12 +18068,13 @@ export const CreateFunctionModal = React.forwardRef(
|
|
|
18820
18068
|
<div className="flex flex-col gap-5">
|
|
18821
18069
|
{/* API URL \u2014 always a single combined row */}
|
|
18822
18070
|
<div className="flex flex-col gap-1.5">
|
|
18823
|
-
<span className="text-
|
|
18071
|
+
<span className="text-xs text-semantic-text-muted tracking-[0.048px]">
|
|
18824
18072
|
API URL
|
|
18825
18073
|
</span>
|
|
18826
18074
|
<div
|
|
18827
18075
|
className={cn(
|
|
18828
18076
|
"flex h-[42px] rounded border border-semantic-border-input overflow-visible bg-semantic-bg-primary",
|
|
18077
|
+
"hover:border-semantic-border-input-focus",
|
|
18829
18078
|
"focus-within:border-semantic-border-input-focus focus-within:shadow-[0_0_0_1px_rgba(43,188,202,0.15)]",
|
|
18830
18079
|
"transition-shadow"
|
|
18831
18080
|
)}
|
|
@@ -18886,19 +18135,11 @@ export const CreateFunctionModal = React.forwardRef(
|
|
|
18886
18135
|
disabled && "opacity-50 cursor-not-allowed"
|
|
18887
18136
|
)}
|
|
18888
18137
|
/>
|
|
18889
|
-
<VarPopup
|
|
18890
|
-
variables={filteredUrlVars}
|
|
18891
|
-
variableGroups={urlTrigger ? variableGroups : undefined}
|
|
18892
|
-
filterQuery={urlTrigger?.query ?? ""}
|
|
18893
|
-
onSelect={handleUrlVarSelect}
|
|
18894
|
-
onAddVariable={onAddVariable ? handleAddVariableClick : undefined}
|
|
18895
|
-
onEditVariable={onEditVariable ? handleEditVariableClick : undefined}
|
|
18896
|
-
style={urlPopupStyle}
|
|
18897
|
-
/>
|
|
18138
|
+
<VarPopup variables={filteredUrlVars} onSelect={handleUrlVarSelect} style={urlPopupStyle} />
|
|
18898
18139
|
</div>
|
|
18899
18140
|
</div>
|
|
18900
18141
|
{urlError && (
|
|
18901
|
-
<p className="m-0 text-
|
|
18142
|
+
<p className="m-0 text-xs text-semantic-error-primary">{urlError}</p>
|
|
18902
18143
|
)}
|
|
18903
18144
|
</div>
|
|
18904
18145
|
|
|
@@ -18938,9 +18179,6 @@ export const CreateFunctionModal = React.forwardRef(
|
|
|
18938
18179
|
keyRegex={HEADER_KEY_REGEX}
|
|
18939
18180
|
keyRegexError="Invalid header key. Use only alphanumeric and !#$%&'*+-.^_\`|~ characters."
|
|
18940
18181
|
sessionVariables={sessionVariables}
|
|
18941
|
-
variableGroups={variableGroups}
|
|
18942
|
-
onAddVariable={handleAddVariableClick}
|
|
18943
|
-
onEditVariable={handleEditVariableClick}
|
|
18944
18182
|
disabled={disabled}
|
|
18945
18183
|
/>
|
|
18946
18184
|
)}
|
|
@@ -18960,15 +18198,12 @@ export const CreateFunctionModal = React.forwardRef(
|
|
|
18960
18198
|
};
|
|
18961
18199
|
}}
|
|
18962
18200
|
sessionVariables={sessionVariables}
|
|
18963
|
-
variableGroups={variableGroups}
|
|
18964
|
-
onAddVariable={handleAddVariableClick}
|
|
18965
|
-
onEditVariable={handleEditVariableClick}
|
|
18966
18201
|
disabled={disabled}
|
|
18967
18202
|
/>
|
|
18968
18203
|
)}
|
|
18969
18204
|
{activeTab === "body" && (
|
|
18970
18205
|
<div className="flex flex-col gap-1.5">
|
|
18971
|
-
<span className="text-
|
|
18206
|
+
<span className="text-xs text-semantic-text-muted">
|
|
18972
18207
|
Body
|
|
18973
18208
|
</span>
|
|
18974
18209
|
<div className={cn("relative")}>
|
|
@@ -18998,21 +18233,13 @@ export const CreateFunctionModal = React.forwardRef(
|
|
|
18998
18233
|
rows={6}
|
|
18999
18234
|
className={cn(textareaCls, "pb-7")}
|
|
19000
18235
|
/>
|
|
19001
|
-
<span className="absolute bottom-2 right-3 text-
|
|
18236
|
+
<span className="absolute bottom-2 right-3 text-xs italic text-semantic-text-muted pointer-events-none">
|
|
19002
18237
|
{body.length}/{BODY_MAX}
|
|
19003
18238
|
</span>
|
|
19004
|
-
<VarPopup
|
|
19005
|
-
variables={filteredBodyVars}
|
|
19006
|
-
variableGroups={bodyTrigger ? variableGroups : undefined}
|
|
19007
|
-
filterQuery={bodyTrigger?.query ?? ""}
|
|
19008
|
-
onSelect={handleBodyVarSelect}
|
|
19009
|
-
onAddVariable={onAddVariable ? handleAddVariableClick : undefined}
|
|
19010
|
-
onEditVariable={onEditVariable ? handleEditVariableClick : undefined}
|
|
19011
|
-
style={bodyPopupStyle}
|
|
19012
|
-
/>
|
|
18239
|
+
<VarPopup variables={filteredBodyVars} onSelect={handleBodyVarSelect} style={bodyPopupStyle} />
|
|
19013
18240
|
</div>
|
|
19014
18241
|
{bodyError && (
|
|
19015
|
-
<p className="m-0 text-
|
|
18242
|
+
<p className="m-0 text-xs text-semantic-error-primary">{bodyError}</p>
|
|
19016
18243
|
)}
|
|
19017
18244
|
</div>
|
|
19018
18245
|
)}
|
|
@@ -19021,7 +18248,7 @@ export const CreateFunctionModal = React.forwardRef(
|
|
|
19021
18248
|
{/* Test Your API */}
|
|
19022
18249
|
<div className="flex flex-col gap-4">
|
|
19023
18250
|
<div className="flex flex-col gap-1.5">
|
|
19024
|
-
<span className="text-
|
|
18251
|
+
<span className="text-xs font-semibold text-semantic-text-muted tracking-[0.048px]">
|
|
19025
18252
|
Test Your API
|
|
19026
18253
|
</span>
|
|
19027
18254
|
<div className="border-t border-semantic-border-layout" />
|
|
@@ -19030,12 +18257,12 @@ export const CreateFunctionModal = React.forwardRef(
|
|
|
19030
18257
|
{/* Variable test values \u2014 shown when URL/body/params contain {{variables}} */}
|
|
19031
18258
|
{testableVars.length > 0 && (
|
|
19032
18259
|
<div className="flex flex-col gap-2">
|
|
19033
|
-
<span className="text-
|
|
18260
|
+
<span className="text-xs text-semantic-text-muted">
|
|
19034
18261
|
Variable values for testing
|
|
19035
18262
|
</span>
|
|
19036
18263
|
{testableVars.map((variable) => (
|
|
19037
18264
|
<div key={variable} className="flex items-center gap-3">
|
|
19038
|
-
<span className="text-
|
|
18265
|
+
<span className="text-xs text-semantic-text-muted font-mono shrink-0 min-w-[120px]">
|
|
19039
18266
|
{variable}
|
|
19040
18267
|
</span>
|
|
19041
18268
|
<input
|
|
@@ -19065,7 +18292,7 @@ export const CreateFunctionModal = React.forwardRef(
|
|
|
19065
18292
|
</button>
|
|
19066
18293
|
|
|
19067
18294
|
<div className="flex flex-col gap-1.5">
|
|
19068
|
-
<span className="text-
|
|
18295
|
+
<span className="text-xs text-semantic-text-muted">
|
|
19069
18296
|
Response from API
|
|
19070
18297
|
</span>
|
|
19071
18298
|
<textarea
|
|
@@ -19123,15 +18350,6 @@ export const CreateFunctionModal = React.forwardRef(
|
|
|
19123
18350
|
</div>
|
|
19124
18351
|
</DialogContent>
|
|
19125
18352
|
</Dialog>
|
|
19126
|
-
|
|
19127
|
-
<VariableFormModal
|
|
19128
|
-
open={varModalOpen}
|
|
19129
|
-
onOpenChange={setVarModalOpen}
|
|
19130
|
-
mode={varModalMode}
|
|
19131
|
-
initialData={varModalInitialData}
|
|
19132
|
-
onSave={handleVariableSave}
|
|
19133
|
-
/>
|
|
19134
|
-
</>
|
|
19135
18353
|
);
|
|
19136
18354
|
}
|
|
19137
18355
|
);
|
|
@@ -19343,7 +18561,7 @@ const DEFAULT_LANGUAGE_OPTIONS: LanguageOption[] = [
|
|
|
19343
18561
|
|
|
19344
18562
|
// \u2500\u2500\u2500 Component \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
19345
18563
|
|
|
19346
|
-
const BotIdentityCard = React.forwardRef(
|
|
18564
|
+
const BotIdentityCard = React.forwardRef<HTMLDivElement, BotIdentityCardProps>(
|
|
19347
18565
|
(
|
|
19348
18566
|
{
|
|
19349
18567
|
data,
|
|
@@ -19357,8 +18575,8 @@ const BotIdentityCard = React.forwardRef(
|
|
|
19357
18575
|
playingVoice,
|
|
19358
18576
|
disabled,
|
|
19359
18577
|
className,
|
|
19360
|
-
}
|
|
19361
|
-
ref
|
|
18578
|
+
},
|
|
18579
|
+
ref
|
|
19362
18580
|
) => {
|
|
19363
18581
|
return (
|
|
19364
18582
|
<div
|
|
@@ -19660,6 +18878,7 @@ function VarPopup({
|
|
|
19660
18878
|
key={v}
|
|
19661
18879
|
type="button"
|
|
19662
18880
|
role="option"
|
|
18881
|
+
aria-selected={false}
|
|
19663
18882
|
onMouseDown={(e) => {
|
|
19664
18883
|
e.preventDefault(); // keep textarea focused so blur doesn't close popup first
|
|
19665
18884
|
onSelect(v);
|
|
@@ -19703,7 +18922,7 @@ function SectionCard({
|
|
|
19703
18922
|
|
|
19704
18923
|
// \u2500\u2500\u2500 Component \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
19705
18924
|
|
|
19706
|
-
const BotBehaviorCard = React.forwardRef(
|
|
18925
|
+
const BotBehaviorCard = React.forwardRef<HTMLDivElement, BotBehaviorCardProps>(
|
|
19707
18926
|
(
|
|
19708
18927
|
{
|
|
19709
18928
|
data,
|
|
@@ -19713,8 +18932,8 @@ const BotBehaviorCard = React.forwardRef(
|
|
|
19713
18932
|
maxLength = 5000,
|
|
19714
18933
|
disabled,
|
|
19715
18934
|
className,
|
|
19716
|
-
}
|
|
19717
|
-
ref
|
|
18935
|
+
},
|
|
18936
|
+
ref
|
|
19718
18937
|
) => {
|
|
19719
18938
|
const prompt = data.systemPrompt ?? "";
|
|
19720
18939
|
const MAX = maxLength;
|
|
@@ -19898,7 +19117,7 @@ import {
|
|
|
19898
19117
|
TooltipTrigger,
|
|
19899
19118
|
} from "../tooltip";
|
|
19900
19119
|
import { BOT_KNOWLEDGE_STATUS } from "./types";
|
|
19901
|
-
import type { KnowledgeBaseFile } from "./types";
|
|
19120
|
+
import type { KnowledgeBaseFile, KnowledgeFileStatus } from "./types";
|
|
19902
19121
|
|
|
19903
19122
|
// \u2500\u2500\u2500 Types \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
19904
19123
|
|
|
@@ -19932,7 +19151,7 @@ export interface KnowledgeBaseCardProps {
|
|
|
19932
19151
|
// \u2500\u2500\u2500 Status config \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
19933
19152
|
|
|
19934
19153
|
type BadgeVariant = "default" | "active" | "destructive";
|
|
19935
|
-
const STATUS_CONFIG: Record<
|
|
19154
|
+
const STATUS_CONFIG: Record<KnowledgeFileStatus, { label: string; variant: BadgeVariant }> = {
|
|
19936
19155
|
[BOT_KNOWLEDGE_STATUS.PENDING]: { label: "Pending", variant: "default" },
|
|
19937
19156
|
[BOT_KNOWLEDGE_STATUS.READY]: { label: "Ready", variant: "active" },
|
|
19938
19157
|
[BOT_KNOWLEDGE_STATUS.PROCESSING]: { label: "Processing", variant: "active" },
|
|
@@ -19941,7 +19160,7 @@ const STATUS_CONFIG: Record<BOT_KNOWLEDGE_STATUS, { label: string; variant: Badg
|
|
|
19941
19160
|
|
|
19942
19161
|
// \u2500\u2500\u2500 Component \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
19943
19162
|
|
|
19944
|
-
const KnowledgeBaseCard = React.forwardRef(
|
|
19163
|
+
const KnowledgeBaseCard = React.forwardRef<HTMLDivElement, KnowledgeBaseCardProps>(
|
|
19945
19164
|
(
|
|
19946
19165
|
{
|
|
19947
19166
|
files,
|
|
@@ -19953,8 +19172,8 @@ const KnowledgeBaseCard = React.forwardRef(
|
|
|
19953
19172
|
downloadDisabled,
|
|
19954
19173
|
deleteDisabled,
|
|
19955
19174
|
className,
|
|
19956
|
-
}
|
|
19957
|
-
ref
|
|
19175
|
+
},
|
|
19176
|
+
ref
|
|
19958
19177
|
) => {
|
|
19959
19178
|
return (
|
|
19960
19179
|
<div
|
|
@@ -20106,8 +19325,8 @@ export interface FunctionsCardProps {
|
|
|
20106
19325
|
|
|
20107
19326
|
// \u2500\u2500\u2500 Component \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
20108
19327
|
|
|
20109
|
-
const FunctionsCard = React.forwardRef(
|
|
20110
|
-
({ functions, onAddFunction, onEditFunction, onDeleteFunction, infoTooltip, disabled, editDisabled, deleteDisabled, className }
|
|
19328
|
+
const FunctionsCard = React.forwardRef<HTMLDivElement, FunctionsCardProps>(
|
|
19329
|
+
({ functions, onAddFunction, onEditFunction, onDeleteFunction, infoTooltip, disabled, editDisabled, deleteDisabled, className }, ref) => {
|
|
20111
19330
|
return (
|
|
20112
19331
|
<div
|
|
20113
19332
|
ref={ref}
|
|
@@ -20293,8 +19512,8 @@ function Field({
|
|
|
20293
19512
|
|
|
20294
19513
|
// \u2500\u2500\u2500 Component \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
20295
19514
|
|
|
20296
|
-
const FrustrationHandoverCard = React.forwardRef(
|
|
20297
|
-
({ data, onChange, departmentOptions = DEFAULT_DEPARTMENT_OPTIONS, disabled, className }
|
|
19515
|
+
const FrustrationHandoverCard = React.forwardRef<HTMLDivElement, FrustrationHandoverCardProps>(
|
|
19516
|
+
({ data, onChange, departmentOptions = DEFAULT_DEPARTMENT_OPTIONS, disabled, className }, ref) => {
|
|
20298
19517
|
return (
|
|
20299
19518
|
<div
|
|
20300
19519
|
ref={ref}
|
|
@@ -20467,7 +19686,7 @@ function NumberSpinner({
|
|
|
20467
19686
|
|
|
20468
19687
|
// \u2500\u2500\u2500 Component \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
20469
19688
|
|
|
20470
|
-
const AdvancedSettingsCard = React.forwardRef(
|
|
19689
|
+
const AdvancedSettingsCard = React.forwardRef<HTMLDivElement, AdvancedSettingsCardProps>(
|
|
20471
19690
|
(
|
|
20472
19691
|
{
|
|
20473
19692
|
data,
|
|
@@ -20478,8 +19697,8 @@ const AdvancedSettingsCard = React.forwardRef(
|
|
|
20478
19697
|
callEndThresholdMax = 10,
|
|
20479
19698
|
disabled,
|
|
20480
19699
|
className,
|
|
20481
|
-
}
|
|
20482
|
-
ref
|
|
19700
|
+
},
|
|
19701
|
+
ref
|
|
20483
19702
|
) => {
|
|
20484
19703
|
return (
|
|
20485
19704
|
<div
|
|
@@ -20645,7 +19864,10 @@ function PromptField({
|
|
|
20645
19864
|
|
|
20646
19865
|
// \u2500\u2500\u2500 Component \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
20647
19866
|
|
|
20648
|
-
const FallbackPromptsCard = React.forwardRef
|
|
19867
|
+
const FallbackPromptsCard = React.forwardRef<
|
|
19868
|
+
HTMLDivElement,
|
|
19869
|
+
FallbackPromptsCardProps
|
|
19870
|
+
>(
|
|
20649
19871
|
(
|
|
20650
19872
|
{
|
|
20651
19873
|
data,
|
|
@@ -20656,8 +19878,8 @@ const FallbackPromptsCard = React.forwardRef(
|
|
|
20656
19878
|
disabled,
|
|
20657
19879
|
defaultOpen = false,
|
|
20658
19880
|
className,
|
|
20659
|
-
}
|
|
20660
|
-
ref
|
|
19881
|
+
},
|
|
19882
|
+
ref
|
|
20661
19883
|
) => {
|
|
20662
19884
|
return (
|
|
20663
19885
|
<div
|
|
@@ -20728,9 +19950,7 @@ export const BOT_KNOWLEDGE_STATUS = {
|
|
|
20728
19950
|
FAILED: "failed",
|
|
20729
19951
|
} as const;
|
|
20730
19952
|
|
|
20731
|
-
export type
|
|
20732
|
-
|
|
20733
|
-
export type KnowledgeFileStatus = BOT_KNOWLEDGE_STATUS;
|
|
19953
|
+
export type KnowledgeFileStatus = typeof BOT_KNOWLEDGE_STATUS[keyof typeof BOT_KNOWLEDGE_STATUS];
|
|
20734
19954
|
|
|
20735
19955
|
export interface KeyValuePair {
|
|
20736
19956
|
id: string;
|
|
@@ -20738,35 +19958,6 @@ export interface KeyValuePair {
|
|
|
20738
19958
|
value: string;
|
|
20739
19959
|
}
|
|
20740
19960
|
|
|
20741
|
-
/** A single variable shown in the {{ autocomplete popup */
|
|
20742
|
-
export interface VariableItem {
|
|
20743
|
-
/** Display name (e.g., "Order_id") */
|
|
20744
|
-
name: string;
|
|
20745
|
-
/** Value inserted into the input. Defaults to \`{{name}}\` if omitted */
|
|
20746
|
-
value?: string;
|
|
20747
|
-
/** When true, an edit icon is shown next to this variable */
|
|
20748
|
-
editable?: boolean;
|
|
20749
|
-
/** Description of what this variable represents */
|
|
20750
|
-
description?: string;
|
|
20751
|
-
/** Whether this variable is required */
|
|
20752
|
-
required?: boolean;
|
|
20753
|
-
}
|
|
20754
|
-
|
|
20755
|
-
/** Data shape for creating or editing a variable */
|
|
20756
|
-
export interface VariableFormData {
|
|
20757
|
-
name: string;
|
|
20758
|
-
description?: string;
|
|
20759
|
-
required?: boolean;
|
|
20760
|
-
}
|
|
20761
|
-
|
|
20762
|
-
/** A labelled group of variables in the autocomplete popup */
|
|
20763
|
-
export interface VariableGroup {
|
|
20764
|
-
/** Group header text (e.g., "Function variables", "Session variables") */
|
|
20765
|
-
label: string;
|
|
20766
|
-
/** Variables in this group */
|
|
20767
|
-
items: VariableItem[];
|
|
20768
|
-
}
|
|
20769
|
-
|
|
20770
19961
|
export interface FunctionItem {
|
|
20771
19962
|
id: string;
|
|
20772
19963
|
name: string;
|
|
@@ -20817,12 +20008,6 @@ export interface CreateFunctionModalProps {
|
|
|
20817
20008
|
initialTab?: FunctionTabType;
|
|
20818
20009
|
/** Session variables available for {{ autocomplete in URL, body, header values, and query param values */
|
|
20819
20010
|
sessionVariables?: string[];
|
|
20820
|
-
/** Grouped variables shown in the {{ autocomplete popup (overrides flat list display when provided) */
|
|
20821
|
-
variableGroups?: VariableGroup[];
|
|
20822
|
-
/** Called when user saves a new variable from the autocomplete popup */
|
|
20823
|
-
onAddVariable?: (data: VariableFormData) => void;
|
|
20824
|
-
/** Called when user edits a variable from the autocomplete popup */
|
|
20825
|
-
onEditVariable?: (originalName: string, data: VariableFormData) => void;
|
|
20826
20011
|
/** When true, all form fields are disabled (view mode) but Next is enabled so user can browse steps */
|
|
20827
20012
|
disabled?: boolean;
|
|
20828
20013
|
className?: string;
|
|
@@ -20983,9 +20168,6 @@ export type {
|
|
|
20983
20168
|
HttpMethod,
|
|
20984
20169
|
FunctionTabType,
|
|
20985
20170
|
SelectOption,
|
|
20986
|
-
VariableItem,
|
|
20987
|
-
VariableGroup,
|
|
20988
|
-
VariableFormData,
|
|
20989
20171
|
} from "./types";
|
|
20990
20172
|
`, prefix)
|
|
20991
20173
|
}
|
|
@@ -21055,7 +20237,7 @@ function formatCurrency(amount: number, symbol: string = "\u20B9"): string {
|
|
|
21055
20237
|
* />
|
|
21056
20238
|
* \`\`\`
|
|
21057
20239
|
*/
|
|
21058
|
-
export const WalletTopup = React.forwardRef(
|
|
20240
|
+
export const WalletTopup = React.forwardRef<HTMLDivElement, WalletTopupProps>(
|
|
21059
20241
|
(
|
|
21060
20242
|
{
|
|
21061
20243
|
title = "Instant wallet top-up",
|
|
@@ -21102,8 +20284,8 @@ export const WalletTopup = React.forwardRef(
|
|
|
21102
20284
|
open,
|
|
21103
20285
|
onOpenChange,
|
|
21104
20286
|
className,
|
|
21105
|
-
}
|
|
21106
|
-
ref
|
|
20287
|
+
},
|
|
20288
|
+
ref
|
|
21107
20289
|
) => {
|
|
21108
20290
|
const isOpenControlled = open !== undefined;
|
|
21109
20291
|
|
|
@@ -23105,99 +22287,22 @@ async function sync(options) {
|
|
|
23105
22287
|
}
|
|
23106
22288
|
let selectedToAdd = toAdd;
|
|
23107
22289
|
let selectedToUpdate = toUpdate;
|
|
23108
|
-
const CUSTOM_GROUPS = {
|
|
23109
|
-
"attachment-preview": "Chat",
|
|
23110
|
-
"audio-media": "Chat",
|
|
23111
|
-
"carousel-media": "Chat",
|
|
23112
|
-
"chat-bubble": "Chat",
|
|
23113
|
-
"chat-composer": "Chat",
|
|
23114
|
-
"contact-list-item": "Chat",
|
|
23115
|
-
"date-divider": "Chat",
|
|
23116
|
-
"doc-media": "Chat",
|
|
23117
|
-
"image-media": "Chat",
|
|
23118
|
-
"reply-quote": "Chat",
|
|
23119
|
-
"system-message": "Chat",
|
|
23120
|
-
"unread-separator": "Chat",
|
|
23121
|
-
"video-media": "Chat",
|
|
23122
|
-
"event-selector": "Webhook",
|
|
23123
|
-
"key-value-input": "Webhook",
|
|
23124
|
-
"api-feature-card": "Webhook",
|
|
23125
|
-
"endpoint-details": "Webhook",
|
|
23126
|
-
"alert-configuration": "Webhook",
|
|
23127
|
-
"auto-pay-setup": "Plan & Payment",
|
|
23128
|
-
"bank-details": "Plan & Payment",
|
|
23129
|
-
"date-range-modal": "Plan & Payment",
|
|
23130
|
-
"payment-option-card": "Plan & Payment",
|
|
23131
|
-
"plan-upgrade-modal": "Plan & Payment",
|
|
23132
|
-
"plan-upgrade-summary-modal": "Plan & Payment",
|
|
23133
|
-
"payment-summary": "Plan & Payment",
|
|
23134
|
-
"let-us-drive-card": "Plan & Payment",
|
|
23135
|
-
"power-up-card": "Plan & Payment",
|
|
23136
|
-
"pricing-card": "Plan & Payment",
|
|
23137
|
-
"pricing-page": "Plan & Payment",
|
|
23138
|
-
"pricing-toggle": "Plan & Payment",
|
|
23139
|
-
"talk-to-us-modal": "Plan & Payment",
|
|
23140
|
-
"wallet-topup": "Plan & Payment",
|
|
23141
|
-
"file-upload-modal": "Plan & Payment",
|
|
23142
|
-
"plan-detail-modal": "Plan & Payment",
|
|
23143
|
-
"bots": "AI Bot",
|
|
23144
|
-
"ivr-bot": "AI Bot"
|
|
23145
|
-
};
|
|
23146
22290
|
if (!options.yes && toAdd.length > 0) {
|
|
23147
|
-
const
|
|
23148
|
-
|
|
23149
|
-
|
|
23150
|
-
|
|
23151
|
-
|
|
23152
|
-
|
|
23153
|
-
|
|
23154
|
-
|
|
23155
|
-
|
|
23156
|
-
|
|
23157
|
-
|
|
23158
|
-
|
|
23159
|
-
|
|
23160
|
-
}))
|
|
23161
|
-
});
|
|
23162
|
-
if (!selected) {
|
|
23163
|
-
console.log(chalk5.yellow("\n Sync cancelled.\n"));
|
|
23164
|
-
process.exit(0);
|
|
23165
|
-
}
|
|
23166
|
-
picked.push(...selected);
|
|
23167
|
-
}
|
|
23168
|
-
if (customToAdd.length > 0) {
|
|
23169
|
-
const grouped = /* @__PURE__ */ new Map();
|
|
23170
|
-
for (const c of customToAdd) {
|
|
23171
|
-
const group = CUSTOM_GROUPS[c] || "Other";
|
|
23172
|
-
if (!grouped.has(group)) grouped.set(group, []);
|
|
23173
|
-
grouped.get(group).push(c);
|
|
23174
|
-
}
|
|
23175
|
-
const sortedGroups = [...grouped.keys()].sort();
|
|
23176
|
-
console.log(chalk5.cyan.bold("\n \u2500\u2500 Custom \u2500\u2500\n"));
|
|
23177
|
-
const { selected } = await prompts3({
|
|
23178
|
-
type: "multiselect",
|
|
23179
|
-
name: "selected",
|
|
23180
|
-
message: "Select custom component folders to add",
|
|
23181
|
-
choices: sortedGroups.map((group) => {
|
|
23182
|
-
const components = grouped.get(group);
|
|
23183
|
-
const count = components.length;
|
|
23184
|
-
return {
|
|
23185
|
-
title: group,
|
|
23186
|
-
value: group,
|
|
23187
|
-
selected: false,
|
|
23188
|
-
description: `${count} component${count === 1 ? "" : "s"}`
|
|
23189
|
-
};
|
|
23190
|
-
})
|
|
23191
|
-
});
|
|
23192
|
-
if (!selected) {
|
|
23193
|
-
console.log(chalk5.yellow("\n Sync cancelled.\n"));
|
|
23194
|
-
process.exit(0);
|
|
23195
|
-
}
|
|
23196
|
-
for (const group of selected) {
|
|
23197
|
-
picked.push(...grouped.get(group));
|
|
23198
|
-
}
|
|
22291
|
+
const { selected } = await prompts3({
|
|
22292
|
+
type: "multiselect",
|
|
22293
|
+
name: "selected",
|
|
22294
|
+
message: "Select new components to add",
|
|
22295
|
+
choices: toAdd.map((c) => {
|
|
22296
|
+
const comp = registry[c];
|
|
22297
|
+
const fileCount = comp.isMultiFile ? ` (${comp.files.length} files)` : "";
|
|
22298
|
+
return { title: `${c}${fileCount}`, value: c, selected: true };
|
|
22299
|
+
})
|
|
22300
|
+
});
|
|
22301
|
+
if (!selected) {
|
|
22302
|
+
console.log(chalk5.yellow("\n Sync cancelled.\n"));
|
|
22303
|
+
process.exit(0);
|
|
23199
22304
|
}
|
|
23200
|
-
selectedToAdd =
|
|
22305
|
+
selectedToAdd = selected;
|
|
23201
22306
|
}
|
|
23202
22307
|
if (!options.yes && toUpdate.length > 0) {
|
|
23203
22308
|
const { selected } = await prompts3({
|