sellmate-design-system-react 0.8.0 → 0.8.2

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.
@@ -4272,6 +4272,7 @@ function SPortal({
4272
4272
  viewportPadding = 0,
4273
4273
  onOpenAutoFocus,
4274
4274
  onCloseAutoFocus,
4275
+ onPointerDownOutside,
4275
4276
  children,
4276
4277
  className,
4277
4278
  style,
@@ -4300,7 +4301,9 @@ function SPortal({
4300
4301
  onPointerDownOutside: (e) => {
4301
4302
  if (persistent || anchorRef.current?.contains(e.target)) {
4302
4303
  e.preventDefault();
4304
+ return;
4303
4305
  }
4306
+ onPointerDownOutside?.(e);
4304
4307
  },
4305
4308
  onFocusOutside: (e) => {
4306
4309
  if (persistent || anchorRef.current?.contains(e.target)) {
@@ -4405,6 +4408,7 @@ var SSelect = react.forwardRef(function SSelect2({
4405
4408
  const triggerRef = react.useRef(null);
4406
4409
  const searchInputRef = react.useRef(null);
4407
4410
  const listRef = react.useRef(null);
4411
+ const dismissedByPointerRef = react.useRef(false);
4408
4412
  const flat = react.useMemo(() => flattenOptions(options), [options]);
4409
4413
  const selectable = react.useMemo(() => selectableOptions(flat), [flat]);
4410
4414
  const hasLeaf = react.useMemo(() => flat.some((o) => !o.isGroup), [flat]);
@@ -4434,7 +4438,9 @@ var SSelect = react.forwardRef(function SSelect2({
4434
4438
  const commitOpen = (next) => {
4435
4439
  setOpen(next);
4436
4440
  onOpenChange?.(next);
4437
- if (!next) {
4441
+ if (next) {
4442
+ dismissedByPointerRef.current = false;
4443
+ } else {
4438
4444
  setPendingOpen(false);
4439
4445
  setSearch("");
4440
4446
  if (rules && rules.length > 0) {
@@ -4658,8 +4664,12 @@ var SSelect = react.forwardRef(function SSelect2({
4658
4664
  event.preventDefault();
4659
4665
  requestAnimationFrame(() => searchInputRef.current?.focus());
4660
4666
  },
4667
+ onPointerDownOutside: () => {
4668
+ dismissedByPointerRef.current = true;
4669
+ },
4661
4670
  onCloseAutoFocus: (event) => {
4662
4671
  event.preventDefault();
4672
+ if (dismissedByPointerRef.current) return;
4663
4673
  triggerRef.current?.focus();
4664
4674
  },
4665
4675
  className: "rounded-[var(--cmp-listBox-radius)] bg-[var(--cmp-listBox-bg)] shadow-[2px_2px_12px_2px_rgba(0,0,0,0.1)]",
@@ -6409,14 +6419,14 @@ function SKeyValueTable({
6409
6419
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[12px] font-bold leading-[20px] text-[color:var(--sys-color-fg-primary)]", children: f.label }),
6410
6420
  f.required && /* @__PURE__ */ jsxRuntime.jsx(SIcon, { name: "star", size: 12, color: "var(--sys-color-fg-accent)" })
6411
6421
  ] }),
6412
- f.helpText && /* @__PURE__ */ jsxRuntime.jsx(
6422
+ f.helpText && f.helpText.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
6413
6423
  STooltip,
6414
6424
  {
6415
6425
  trigger: "hover",
6416
6426
  icon: "helpOutline",
6417
6427
  iconSize: 16,
6418
6428
  color: "var(--sys-color-fg-success)",
6419
- message: [f.helpText]
6429
+ message: f.helpText
6420
6430
  }
6421
6431
  )
6422
6432
  ] })