framepexls-ui-lib 0.1.19 → 0.1.21

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.
@@ -100,6 +100,9 @@ function ComboSelect({
100
100
  document.addEventListener("focusin", onFocusIn);
101
101
  return () => document.removeEventListener("focusin", onFocusIn);
102
102
  }, [open]);
103
+ import_react.default.useEffect(() => {
104
+ if (disabled && open) setOpen(false);
105
+ }, [disabled, open]);
103
106
  const isOutside = import_react.default.useCallback((e) => {
104
107
  var _a2;
105
108
  const path = (_a2 = e.composedPath) == null ? void 0 : _a2.call(e);
@@ -421,12 +424,16 @@ function ComboSelect({
421
424
  unstyled: true,
422
425
  type: "button",
423
426
  title: open ? "Cerrar" : "Abrir",
424
- className: "pointer-events-auto inline-flex h-7 w-7 items-center justify-center rounded-lg border border-slate-200 bg-white text-slate-600 hover:bg-slate-50 active:scale-95 dark:border-white/10 dark:bg-white/5",
427
+ disabled,
428
+ className: cx(
429
+ disabled ? "pointer-events-none opacity-60" : "pointer-events-auto inline-flex h-7 w-7 items-center justify-center rounded-lg border border-slate-200 bg-white text-slate-600 hover:bg-slate-50 active:scale-95 dark:border-white/10 dark:bg-white/5"
430
+ ),
425
431
  onMouseDown: (e) => {
426
432
  e.preventDefault();
427
433
  e.stopPropagation();
428
434
  },
429
435
  onClick: () => {
436
+ if (disabled) return;
430
437
  setOpen((o) => !o);
431
438
  if (!open) requestAnimationFrame(() => {
432
439
  var _a2;
@@ -67,6 +67,9 @@ function ComboSelect({
67
67
  document.addEventListener("focusin", onFocusIn);
68
68
  return () => document.removeEventListener("focusin", onFocusIn);
69
69
  }, [open]);
70
+ React.useEffect(() => {
71
+ if (disabled && open) setOpen(false);
72
+ }, [disabled, open]);
70
73
  const isOutside = React.useCallback((e) => {
71
74
  var _a2;
72
75
  const path = (_a2 = e.composedPath) == null ? void 0 : _a2.call(e);
@@ -388,12 +391,16 @@ function ComboSelect({
388
391
  unstyled: true,
389
392
  type: "button",
390
393
  title: open ? "Cerrar" : "Abrir",
391
- className: "pointer-events-auto inline-flex h-7 w-7 items-center justify-center rounded-lg border border-slate-200 bg-white text-slate-600 hover:bg-slate-50 active:scale-95 dark:border-white/10 dark:bg-white/5",
394
+ disabled,
395
+ className: cx(
396
+ disabled ? "pointer-events-none opacity-60" : "pointer-events-auto inline-flex h-7 w-7 items-center justify-center rounded-lg border border-slate-200 bg-white text-slate-600 hover:bg-slate-50 active:scale-95 dark:border-white/10 dark:bg-white/5"
397
+ ),
392
398
  onMouseDown: (e) => {
393
399
  e.preventDefault();
394
400
  e.stopPropagation();
395
401
  },
396
402
  onClick: () => {
403
+ if (disabled) return;
397
404
  setOpen((o) => !o);
398
405
  if (!open) requestAnimationFrame(() => {
399
406
  var _a2;
package/dist/Dialog.js CHANGED
@@ -246,7 +246,7 @@ function DialogField({
246
246
  children,
247
247
  className
248
248
  }) {
249
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: cx("grid gap-1 text-sm content-start justify-start", className), children: [
249
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: cx("grid gap-1 text-sm content-start", className), children: [
250
250
  label && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "font-medium", children: [
251
251
  label,
252
252
  " ",
package/dist/Dialog.mjs CHANGED
@@ -206,7 +206,7 @@ function DialogField({
206
206
  children,
207
207
  className
208
208
  }) {
209
- return /* @__PURE__ */ jsxs("label", { className: cx("grid gap-1 text-sm content-start justify-start", className), children: [
209
+ return /* @__PURE__ */ jsxs("label", { className: cx("grid gap-1 text-sm content-start", className), children: [
210
210
  label && /* @__PURE__ */ jsxs("span", { className: "font-medium", children: [
211
211
  label,
212
212
  " ",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framepexls-ui-lib",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "description": "Componentes UI de Framepexls para React/Next.",