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.
package/dist/index.js CHANGED
@@ -4399,6 +4399,7 @@ function SPortal({
4399
4399
  viewportPadding = 0,
4400
4400
  onOpenAutoFocus,
4401
4401
  onCloseAutoFocus,
4402
+ onPointerDownOutside,
4402
4403
  children,
4403
4404
  className,
4404
4405
  style,
@@ -4427,7 +4428,9 @@ function SPortal({
4427
4428
  onPointerDownOutside: (e) => {
4428
4429
  if (persistent || anchorRef.current?.contains(e.target)) {
4429
4430
  e.preventDefault();
4431
+ return;
4430
4432
  }
4433
+ onPointerDownOutside?.(e);
4431
4434
  },
4432
4435
  onFocusOutside: (e) => {
4433
4436
  if (persistent || anchorRef.current?.contains(e.target)) {
@@ -6331,6 +6334,7 @@ var SSelect = forwardRef(function SSelect2({
6331
6334
  const triggerRef = useRef(null);
6332
6335
  const searchInputRef = useRef(null);
6333
6336
  const listRef = useRef(null);
6337
+ const dismissedByPointerRef = useRef(false);
6334
6338
  const flat = useMemo(() => flattenOptions(options), [options]);
6335
6339
  const selectable = useMemo(() => selectableOptions(flat), [flat]);
6336
6340
  const hasLeaf = useMemo(() => flat.some((o) => !o.isGroup), [flat]);
@@ -6360,7 +6364,9 @@ var SSelect = forwardRef(function SSelect2({
6360
6364
  const commitOpen = (next) => {
6361
6365
  setOpen(next);
6362
6366
  onOpenChange?.(next);
6363
- if (!next) {
6367
+ if (next) {
6368
+ dismissedByPointerRef.current = false;
6369
+ } else {
6364
6370
  setPendingOpen(false);
6365
6371
  setSearch("");
6366
6372
  if (rules && rules.length > 0) {
@@ -6584,8 +6590,12 @@ var SSelect = forwardRef(function SSelect2({
6584
6590
  event.preventDefault();
6585
6591
  requestAnimationFrame(() => searchInputRef.current?.focus());
6586
6592
  },
6593
+ onPointerDownOutside: () => {
6594
+ dismissedByPointerRef.current = true;
6595
+ },
6587
6596
  onCloseAutoFocus: (event) => {
6588
6597
  event.preventDefault();
6598
+ if (dismissedByPointerRef.current) return;
6589
6599
  triggerRef.current?.focus();
6590
6600
  },
6591
6601
  className: "rounded-[var(--cmp-listBox-radius)] bg-[var(--cmp-listBox-bg)] shadow-[2px_2px_12px_2px_rgba(0,0,0,0.1)]",
@@ -9359,14 +9369,14 @@ function SKeyValueTable({
9359
9369
  /* @__PURE__ */ jsx("span", { className: "text-[12px] font-bold leading-[20px] text-[color:var(--sys-color-fg-primary)]", children: f.label }),
9360
9370
  f.required && /* @__PURE__ */ jsx(SIcon, { name: "star", size: 12, color: "var(--sys-color-fg-accent)" })
9361
9371
  ] }),
9362
- f.helpText && /* @__PURE__ */ jsx(
9372
+ f.helpText && f.helpText.length > 0 && /* @__PURE__ */ jsx(
9363
9373
  STooltip,
9364
9374
  {
9365
9375
  trigger: "hover",
9366
9376
  icon: "helpOutline",
9367
9377
  iconSize: 16,
9368
9378
  color: "var(--sys-color-fg-success)",
9369
- message: [f.helpText]
9379
+ message: f.helpText
9370
9380
  }
9371
9381
  )
9372
9382
  ] })