@kreativa/ui 0.1.6 → 0.1.8

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
@@ -236,7 +236,7 @@ function Modal({ isOpen, onClose, title, children, maxWidth = "xl" }) {
236
236
  const modalContent = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
237
237
  "div",
238
238
  {
239
- className: "fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4",
239
+ className: "fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-4",
240
240
  onClick: (e) => {
241
241
  if (e.target === e.currentTarget) {
242
242
  onClose();
@@ -245,10 +245,11 @@ function Modal({ isOpen, onClose, title, children, maxWidth = "xl" }) {
245
245
  children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
246
246
  "div",
247
247
  {
248
- className: `bg-white rounded-2xl shadow-2xl w-full ${maxWidthClasses[maxWidth]} p-6 max-h-[90vh] overflow-y-auto`,
248
+ className: `bg-white rounded-2xl shadow-2xl w-full ${maxWidthClasses[maxWidth]} max-h-[95vh] flex flex-col`,
249
+ onClick: (e) => e.stopPropagation(),
249
250
  children: [
250
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h2", { className: "text-xl font-bold text-gray-800 mb-6", children: title }),
251
- children
251
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex-shrink-0 px-6 pt-6 pb-4 border-b", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h2", { className: "text-xl font-bold text-gray-800", children: title }) }),
252
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex-1 overflow-y-auto px-6 py-4", children })
252
253
  ]
253
254
  }
254
255
  )
@@ -617,14 +618,14 @@ function Select({
617
618
  return values.includes(option.value);
618
619
  };
619
620
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { ref: containerRef, className: `relative ${className}`, children: [
620
- label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: label }),
621
+ label && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: label }),
621
622
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
622
623
  "div",
623
624
  {
624
625
  className: `
625
- relative w-full px-4 py-3 rounded-xl border bg-white
626
+ relative w-full px-3 py-2 rounded-lg border bg-white
626
627
  ${disabled ? "bg-gray-100 cursor-not-allowed" : "cursor-pointer"}
627
- ${error ? "border-red-300" : isOpen ? "border-primary-500 ring-2 ring-primary-100" : "border-gray-200"}
628
+ ${error ? "border-red-500" : isOpen ? "border-primary-500 ring-2 ring-primary-500" : "border-gray-300"}
628
629
  transition-all
629
630
  `,
630
631
  onClick: () => {
@@ -664,11 +665,11 @@ function Select({
664
665
  }
665
666
  ),
666
667
  error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "mt-1 text-xs text-red-600", children: error }),
667
- isOpen && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "absolute z-50 w-full mt-1 bg-white border border-gray-200 rounded-xl shadow-lg max-h-60 overflow-auto", children: filteredOptions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "px-4 py-3 text-sm text-gray-500", children: "No options found" }) : filteredOptions.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
668
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "absolute z-50 w-full mt-1 bg-white border border-gray-300 rounded-lg shadow-lg max-h-60 overflow-auto", children: filteredOptions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "px-3 py-2 text-sm text-gray-500", children: "Inga alternativ hittades" }) : filteredOptions.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
668
669
  "div",
669
670
  {
670
671
  className: `
671
- px-4 py-3 text-sm cursor-pointer flex items-center gap-2
672
+ px-3 py-2 text-sm cursor-pointer flex items-center gap-2
672
673
  ${option.disabled ? "text-gray-400 cursor-not-allowed" : "text-gray-800"}
673
674
  ${highlightedIndex === index ? "bg-primary-50" : "hover:bg-gray-50"}
674
675
  ${isSelected(option) ? "bg-primary-50 font-medium" : ""}