@wallavi/widget 1.5.0 → 1.5.3
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 +53 -26
- package/dist/index.mjs +53 -26
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -501,6 +501,44 @@ function ReasoningBlock({ text }) {
|
|
|
501
501
|
open && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-xs text-muted-foreground/80 whitespace-pre-wrap border-l-2 border-muted pl-2 leading-relaxed", children: text })
|
|
502
502
|
] });
|
|
503
503
|
}
|
|
504
|
+
function PickerOption({
|
|
505
|
+
opt,
|
|
506
|
+
isSelected,
|
|
507
|
+
isConsumed,
|
|
508
|
+
actionDisabled,
|
|
509
|
+
pickerId,
|
|
510
|
+
paramName,
|
|
511
|
+
onSelect
|
|
512
|
+
}) {
|
|
513
|
+
const [hovered, setHovered] = react.useState(false);
|
|
514
|
+
const inactive = actionDisabled || isConsumed;
|
|
515
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
516
|
+
"button",
|
|
517
|
+
{
|
|
518
|
+
disabled: inactive,
|
|
519
|
+
onMouseEnter: () => setHovered(true),
|
|
520
|
+
onMouseLeave: () => setHovered(false),
|
|
521
|
+
onClick: () => {
|
|
522
|
+
if (!inactive) onSelect(pickerId, paramName, opt.value, opt.label);
|
|
523
|
+
},
|
|
524
|
+
style: {
|
|
525
|
+
fontSize: 13,
|
|
526
|
+
lineHeight: "1.4",
|
|
527
|
+
borderRadius: 100,
|
|
528
|
+
padding: "6px 14px",
|
|
529
|
+
border: "none",
|
|
530
|
+
backgroundColor: isSelected ? "var(--primary, #19191c)" : hovered && !inactive ? "rgba(0,0,0,0.14)" : "rgba(0,0,0,0.08)",
|
|
531
|
+
color: isSelected ? "var(--primary-foreground, #fff)" : "var(--foreground, #09090b)",
|
|
532
|
+
cursor: inactive ? "default" : "pointer",
|
|
533
|
+
opacity: isConsumed ? 0.3 : 1,
|
|
534
|
+
transition: "background-color 0.12s ease, opacity 0.12s ease",
|
|
535
|
+
fontWeight: isSelected ? 600 : 500,
|
|
536
|
+
boxShadow: "none"
|
|
537
|
+
},
|
|
538
|
+
children: opt.label
|
|
539
|
+
}
|
|
540
|
+
);
|
|
541
|
+
}
|
|
504
542
|
function PickerSelector({
|
|
505
543
|
part,
|
|
506
544
|
disabled,
|
|
@@ -512,38 +550,27 @@ function PickerSelector({
|
|
|
512
550
|
style: {
|
|
513
551
|
display: "flex",
|
|
514
552
|
flexDirection: "column",
|
|
515
|
-
gap:
|
|
516
|
-
padding: "12px
|
|
517
|
-
borderRadius: "0
|
|
518
|
-
backgroundColor: "var(--muted, #f4f4f5)"
|
|
553
|
+
gap: 10,
|
|
554
|
+
padding: "12px 14px",
|
|
555
|
+
borderRadius: "0 14px 14px 14px",
|
|
556
|
+
backgroundColor: "var(--muted, #f4f4f5)",
|
|
557
|
+
border: "1px solid rgba(0,0,0,0.06)"
|
|
519
558
|
},
|
|
520
559
|
children: [
|
|
521
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: 0, fontSize:
|
|
522
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexWrap: "wrap", gap:
|
|
560
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: 0, fontSize: 11.5, color: "var(--muted-foreground, #71717a)", fontWeight: 600, letterSpacing: "0.04em", textTransform: "uppercase" }, children: part.label }),
|
|
561
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: 7 }, children: part.options.map((opt) => {
|
|
523
562
|
const isSelected = part.selectedValue === opt.value;
|
|
524
563
|
const isConsumed = !!part.selectedValue && !isSelected;
|
|
525
564
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
526
|
-
|
|
565
|
+
PickerOption,
|
|
527
566
|
{
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
fontSize: 13,
|
|
536
|
-
borderRadius: 20,
|
|
537
|
-
padding: "6px 14px",
|
|
538
|
-
border: isSelected ? "1.5px solid var(--primary, #19191c)" : "1.5px solid var(--border, #e4e4e7)",
|
|
539
|
-
backgroundColor: isSelected ? "var(--primary, #19191c)" : "transparent",
|
|
540
|
-
color: isSelected ? "var(--primary-foreground, #fff)" : "var(--foreground, #09090b)",
|
|
541
|
-
cursor: disabled || !!part.selectedValue ? "default" : "pointer",
|
|
542
|
-
opacity: isConsumed ? 0.35 : 1,
|
|
543
|
-
transition: "all 0.15s ease",
|
|
544
|
-
fontWeight: isSelected ? 500 : 400
|
|
545
|
-
},
|
|
546
|
-
children: opt.label
|
|
567
|
+
opt,
|
|
568
|
+
isSelected,
|
|
569
|
+
isConsumed,
|
|
570
|
+
actionDisabled: disabled,
|
|
571
|
+
pickerId: part.pickerId,
|
|
572
|
+
paramName: part.paramName,
|
|
573
|
+
onSelect
|
|
547
574
|
},
|
|
548
575
|
opt.value
|
|
549
576
|
);
|
package/dist/index.mjs
CHANGED
|
@@ -475,6 +475,44 @@ function ReasoningBlock({ text }) {
|
|
|
475
475
|
open && /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground/80 whitespace-pre-wrap border-l-2 border-muted pl-2 leading-relaxed", children: text })
|
|
476
476
|
] });
|
|
477
477
|
}
|
|
478
|
+
function PickerOption({
|
|
479
|
+
opt,
|
|
480
|
+
isSelected,
|
|
481
|
+
isConsumed,
|
|
482
|
+
actionDisabled,
|
|
483
|
+
pickerId,
|
|
484
|
+
paramName,
|
|
485
|
+
onSelect
|
|
486
|
+
}) {
|
|
487
|
+
const [hovered, setHovered] = useState(false);
|
|
488
|
+
const inactive = actionDisabled || isConsumed;
|
|
489
|
+
return /* @__PURE__ */ jsx(
|
|
490
|
+
"button",
|
|
491
|
+
{
|
|
492
|
+
disabled: inactive,
|
|
493
|
+
onMouseEnter: () => setHovered(true),
|
|
494
|
+
onMouseLeave: () => setHovered(false),
|
|
495
|
+
onClick: () => {
|
|
496
|
+
if (!inactive) onSelect(pickerId, paramName, opt.value, opt.label);
|
|
497
|
+
},
|
|
498
|
+
style: {
|
|
499
|
+
fontSize: 13,
|
|
500
|
+
lineHeight: "1.4",
|
|
501
|
+
borderRadius: 100,
|
|
502
|
+
padding: "6px 14px",
|
|
503
|
+
border: "none",
|
|
504
|
+
backgroundColor: isSelected ? "var(--primary, #19191c)" : hovered && !inactive ? "rgba(0,0,0,0.14)" : "rgba(0,0,0,0.08)",
|
|
505
|
+
color: isSelected ? "var(--primary-foreground, #fff)" : "var(--foreground, #09090b)",
|
|
506
|
+
cursor: inactive ? "default" : "pointer",
|
|
507
|
+
opacity: isConsumed ? 0.3 : 1,
|
|
508
|
+
transition: "background-color 0.12s ease, opacity 0.12s ease",
|
|
509
|
+
fontWeight: isSelected ? 600 : 500,
|
|
510
|
+
boxShadow: "none"
|
|
511
|
+
},
|
|
512
|
+
children: opt.label
|
|
513
|
+
}
|
|
514
|
+
);
|
|
515
|
+
}
|
|
478
516
|
function PickerSelector({
|
|
479
517
|
part,
|
|
480
518
|
disabled,
|
|
@@ -486,38 +524,27 @@ function PickerSelector({
|
|
|
486
524
|
style: {
|
|
487
525
|
display: "flex",
|
|
488
526
|
flexDirection: "column",
|
|
489
|
-
gap:
|
|
490
|
-
padding: "12px
|
|
491
|
-
borderRadius: "0
|
|
492
|
-
backgroundColor: "var(--muted, #f4f4f5)"
|
|
527
|
+
gap: 10,
|
|
528
|
+
padding: "12px 14px",
|
|
529
|
+
borderRadius: "0 14px 14px 14px",
|
|
530
|
+
backgroundColor: "var(--muted, #f4f4f5)",
|
|
531
|
+
border: "1px solid rgba(0,0,0,0.06)"
|
|
493
532
|
},
|
|
494
533
|
children: [
|
|
495
|
-
/* @__PURE__ */ jsx("p", { style: { margin: 0, fontSize:
|
|
496
|
-
/* @__PURE__ */ jsx("div", { style: { display: "flex", flexWrap: "wrap", gap:
|
|
534
|
+
/* @__PURE__ */ jsx("p", { style: { margin: 0, fontSize: 11.5, color: "var(--muted-foreground, #71717a)", fontWeight: 600, letterSpacing: "0.04em", textTransform: "uppercase" }, children: part.label }),
|
|
535
|
+
/* @__PURE__ */ jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: 7 }, children: part.options.map((opt) => {
|
|
497
536
|
const isSelected = part.selectedValue === opt.value;
|
|
498
537
|
const isConsumed = !!part.selectedValue && !isSelected;
|
|
499
538
|
return /* @__PURE__ */ jsx(
|
|
500
|
-
|
|
539
|
+
PickerOption,
|
|
501
540
|
{
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
fontSize: 13,
|
|
510
|
-
borderRadius: 20,
|
|
511
|
-
padding: "6px 14px",
|
|
512
|
-
border: isSelected ? "1.5px solid var(--primary, #19191c)" : "1.5px solid var(--border, #e4e4e7)",
|
|
513
|
-
backgroundColor: isSelected ? "var(--primary, #19191c)" : "transparent",
|
|
514
|
-
color: isSelected ? "var(--primary-foreground, #fff)" : "var(--foreground, #09090b)",
|
|
515
|
-
cursor: disabled || !!part.selectedValue ? "default" : "pointer",
|
|
516
|
-
opacity: isConsumed ? 0.35 : 1,
|
|
517
|
-
transition: "all 0.15s ease",
|
|
518
|
-
fontWeight: isSelected ? 500 : 400
|
|
519
|
-
},
|
|
520
|
-
children: opt.label
|
|
541
|
+
opt,
|
|
542
|
+
isSelected,
|
|
543
|
+
isConsumed,
|
|
544
|
+
actionDisabled: disabled,
|
|
545
|
+
pickerId: part.pickerId,
|
|
546
|
+
paramName: part.paramName,
|
|
547
|
+
onSelect
|
|
521
548
|
},
|
|
522
549
|
opt.value
|
|
523
550
|
);
|