@lax-wp/design-system 0.8.18 → 0.8.19

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.es.js CHANGED
@@ -12067,8 +12067,12 @@ const FM = ({
12067
12067
  disabled: i = !1,
12068
12068
  errorMessage: s
12069
12069
  }) => {
12070
- const [o, a] = R(!1), c = ce(!1), d = (u) => {
12071
- u.stopPropagation(), e?.("");
12070
+ const [o, a] = R(!1), c = ce(!1), d = ce(null), u = ce(!1);
12071
+ ee(() => {
12072
+ u.current && !o && d.current?.focus(), u.current = o;
12073
+ }, [o]);
12074
+ const h = (f) => {
12075
+ f.stopPropagation(), e?.("");
12072
12076
  };
12073
12077
  return /* @__PURE__ */ l(
12074
12078
  aa,
@@ -12076,10 +12080,10 @@ const FM = ({
12076
12080
  arrow: !1,
12077
12081
  placement: "bottom",
12078
12082
  trigger: "click",
12079
- getPopupContainer: (u) => u?.parentElement || document.body,
12083
+ getPopupContainer: (f) => f?.parentElement || document.body,
12080
12084
  open: o,
12081
- onOpenChange: (u) => {
12082
- u ? (c.current && a(!0), c.current = !1) : a(!1);
12085
+ onOpenChange: (f) => {
12086
+ f ? (c.current && a(!0), c.current = !1) : a(!1);
12083
12087
  },
12084
12088
  content: /* @__PURE__ */ l(j7, { onChange: e, selectedIcon: A, setOpen: a }),
12085
12089
  children: /* @__PURE__ */ k("div", { className: "flex flex-col gap-1", children: [
@@ -12087,19 +12091,20 @@ const FM = ({
12087
12091
  /* @__PURE__ */ k(
12088
12092
  "button",
12089
12093
  {
12094
+ ref: d,
12090
12095
  type: "button",
12091
12096
  id: `btn-icon-picker-icon-${A ? "selected" : "unselected"}`,
12092
12097
  className: `min-w-[83px] py-1.5 px-3 rounded-md border ${i ? "cursor-not-allowed opacity-60 bg-neutral-50 dark:bg-black-800" : "bg-white dark:bg-black-800"} ${s ? "border-red-500" : "focus:border-primary-200 "} flex items-center justify-between gap-2`,
12093
12098
  disabled: i,
12094
- onClick: (u) => {
12099
+ onClick: (f) => {
12095
12100
  if (i) {
12096
- u.preventDefault(), u.stopPropagation();
12101
+ f.preventDefault(), f.stopPropagation();
12097
12102
  return;
12098
12103
  }
12099
- u.detail > 0 && (c.current = !0);
12104
+ f.detail > 0 && (c.current = !0);
12100
12105
  },
12101
- onKeyDown: (u) => {
12102
- u.key === "Enter" && (u.preventDefault(), o || u.currentTarget.closest("form")?.querySelector('button[type="submit"]')?.click());
12106
+ onKeyDown: (f) => {
12107
+ f.key === "Enter" && (f.preventDefault(), o || f.currentTarget.closest("form")?.querySelector('button[type="submit"]')?.click());
12103
12108
  },
12104
12109
  children: [
12105
12110
  A ? /* @__PURE__ */ l(V0, { iconName: A, sx: { width: 20, height: 20 }, className: "text-neutral-900 dark:text-white" }) : /* @__PURE__ */ l(
@@ -12116,7 +12121,7 @@ const FM = ({
12116
12121
  {
12117
12122
  sx: { width: 20, height: 20 },
12118
12123
  className: "hover:bg-neutral-100 dark:hover:bg-black-800 rounded-full transition-colors cursor-pointer text-neutral-400 dark:text-neutral-500",
12119
- onClick: d
12124
+ onClick: h
12120
12125
  }
12121
12126
  ) : null
12122
12127
  ]