@easyvision/easyvision-ui 1.7.5 → 1.7.6

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.
@@ -233,7 +233,7 @@
233
233
  .ev-checkbox::before {
234
234
  content: "";
235
235
  position: absolute;
236
- inset: -0.5rem;
236
+ inset: -0.75rem;
237
237
  }
238
238
  .ev-checkbox:focus-visible {
239
239
  outline: 2px solid hsl(var(--ring, 215 20% 65%));
@@ -320,16 +320,12 @@
320
320
  overflow: hidden;
321
321
  text-overflow: ellipsis;
322
322
  white-space: nowrap;
323
- /* The trigger is the <button>; children should never swallow the click so
324
- * the entire visible button area always behaves as the hit target. */
325
- pointer-events: none;
326
323
  }
327
324
  .ev-select-trigger-icon {
328
325
  height: 1rem;
329
326
  width: 1rem;
330
327
  opacity: 0.5;
331
328
  flex-shrink: 0;
332
- pointer-events: none;
333
329
  }
334
330
 
335
331
  /* Bare trigger variant used inside chips */
@@ -1181,6 +1177,10 @@
1181
1177
  color: hsl(var(--muted-foreground, 215 16% 47%));
1182
1178
  white-space: nowrap;
1183
1179
  }
1180
+ .ev-mf-chip-label.is-clickable {
1181
+ cursor: pointer;
1182
+ user-select: none;
1183
+ }
1184
1184
  .ev-mf-chip-required {
1185
1185
  margin-left: 0.125rem;
1186
1186
  color: hsl(var(--destructive, 0 84% 60%));
@@ -1217,7 +1217,6 @@
1217
1217
  outline: none;
1218
1218
  }
1219
1219
  .ev-mf-chip-select-trigger {
1220
- position: relative;
1221
1220
  height: auto;
1222
1221
  width: auto;
1223
1222
  min-width: 0;
@@ -1230,13 +1229,6 @@
1230
1229
  line-height: 1rem;
1231
1230
  color: hsl(var(--muted-foreground, 215 16% 47%));
1232
1231
  }
1233
- /* The chip trigger has no padding so the visible click area is just text+icon.
1234
- * Extend the hit target without changing visual size. */
1235
- .ev-mf-chip-select-trigger::before {
1236
- content: "";
1237
- position: absolute;
1238
- inset: -0.375rem -0.25rem;
1239
- }
1240
1232
  .ev-mf-chip-select-trigger:focus {
1241
1233
  outline: none;
1242
1234
  }
package/dist/index.cjs CHANGED
@@ -618,6 +618,7 @@ function TextWidget({ definition, value, onChange, onRemove }) {
618
618
  }
619
619
  var SENTINEL = "__easyvision_undef__";
620
620
  function SelectorWidget({ definition, value, onChange, onRemove }) {
621
+ const [open, setOpen] = React8.useState(false);
621
622
  const [resolved, setResolved] = React8.useState(
622
623
  Array.isArray(definition.options) ? definition.options : null
623
624
  );
@@ -631,14 +632,23 @@ function SelectorWidget({ definition, value, onChange, onRemove }) {
631
632
  const opts = resolved ?? [];
632
633
  const selectValue = value === void 0 || value === "" ? SENTINEL : String(value);
633
634
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ev-mf-chip is-wrap", children: [
634
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ev-mf-chip-label", children: [
635
- definition.label,
636
- definition.mandatory && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ev-mf-chip-required", children: "*" }),
637
- ":"
638
- ] }),
635
+ /* @__PURE__ */ jsxRuntime.jsxs(
636
+ "span",
637
+ {
638
+ className: "ev-mf-chip-label is-clickable",
639
+ onClick: () => setOpen(true),
640
+ children: [
641
+ definition.label,
642
+ definition.mandatory && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ev-mf-chip-required", children: "*" }),
643
+ ":"
644
+ ]
645
+ }
646
+ ),
639
647
  /* @__PURE__ */ jsxRuntime.jsxs(
640
648
  Select,
641
649
  {
650
+ open,
651
+ onOpenChange: setOpen,
642
652
  value: selectValue,
643
653
  onValueChange: (raw) => {
644
654
  if (raw === SENTINEL) onChange(void 0);
@@ -681,6 +691,7 @@ function MultiSelectWidget({
681
691
  onRemove
682
692
  }) {
683
693
  const [search, setSearch] = React8.useState("");
694
+ const [open, setOpen] = React8.useState(false);
684
695
  const searchFn = definition.searchOptions;
685
696
  const hasSearchOptions = typeof searchFn === "function";
686
697
  const [resolved, setResolved] = React8.useState(
@@ -734,11 +745,18 @@ function MultiSelectWidget({
734
745
  const removeOne = (v) => onChange(selected.filter((x) => x !== v));
735
746
  const labelOf = (v) => labelCache.current.get(v) ?? baseOpts.find((o) => o.value === v)?.label ?? String(v);
736
747
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ev-mf-chip is-wrap", children: [
737
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ev-mf-chip-label", children: [
738
- definition.label,
739
- definition.mandatory && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ev-mf-chip-required", children: "*" }),
740
- ":"
741
- ] }),
748
+ /* @__PURE__ */ jsxRuntime.jsxs(
749
+ "span",
750
+ {
751
+ className: "ev-mf-chip-label is-clickable",
752
+ onClick: () => setOpen(true),
753
+ children: [
754
+ definition.label,
755
+ definition.mandatory && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ev-mf-chip-required", children: "*" }),
756
+ ":"
757
+ ]
758
+ }
759
+ ),
742
760
  selected.map((v) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ev-mf-chip-badge", children: [
743
761
  labelOf(v),
744
762
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -751,7 +769,7 @@ function MultiSelectWidget({
751
769
  }
752
770
  )
753
771
  ] }, String(v))),
754
- /* @__PURE__ */ jsxRuntime.jsxs(Popover, { children: [
772
+ /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange: setOpen, children: [
755
773
  /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "ev-mf-chip-caret", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, {}) }) }),
756
774
  /* @__PURE__ */ jsxRuntime.jsxs(PopoverContent, { className: "ev-mf-ms-popover", align: "start", children: [
757
775
  /* @__PURE__ */ jsxRuntime.jsx(