@cnc-ti/layout-basic 8.2.0 → 8.2.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.mjs CHANGED
@@ -8217,35 +8217,48 @@ function getInitials(fullName) {
8217
8217
  const lastNameInitial = nameParts[nameParts.length - 1][0].toUpperCase();
8218
8218
  return `${firstNameInitial}${lastNameInitial}`;
8219
8219
  }
8220
- var Header = ({
8221
- className,
8222
- ...props
8223
- }) => {
8220
+ function Header({ variant = "default", className, ...props }) {
8224
8221
  return /* @__PURE__ */ jsx18(
8225
8222
  "header",
8226
8223
  {
8224
+ "data-header-type": variant,
8227
8225
  className: cn(
8228
- "cnc-h-[60px] cnc-flex cnc-items-center cnc-justify-end cnc-gap-4 cnc-px-4 cnc-w-full cnc-shadow-md cnc-bg-white",
8226
+ "cnc-header cnc-h-[60px] cnc-flex cnc-items-center cnc-justify-end cnc-gap-4 cnc-px-4 lg:cnc-px-0 cnc-w-full cnc-shadow-md",
8227
+ variant === "primary" ? "cnc-bg-primary-800" : "cnc-bg-white",
8229
8228
  className
8230
8229
  ),
8231
8230
  ...props
8232
8231
  }
8233
8232
  );
8234
- };
8233
+ }
8235
8234
  var HeaderContainer = ({
8236
8235
  className,
8237
8236
  isOpen,
8238
8237
  onOpenMenu,
8238
+ hasSidebar = true,
8239
+ container = false,
8240
+ logo,
8241
+ logoLink,
8239
8242
  children,
8240
8243
  ...props
8241
8244
  }) => {
8245
+ const renderLogo = () => {
8246
+ if (!hasSidebar && logo) {
8247
+ return logoLink ? /* @__PURE__ */ jsx18("a", { href: logoLink, children: /* @__PURE__ */ jsx18("img", { src: logo, alt: "Logotipo", className: "cnc-h-8" }) }) : /* @__PURE__ */ jsx18("img", { src: logo, alt: "Logotipo", className: "cnc-h-8" });
8248
+ }
8249
+ return null;
8250
+ };
8242
8251
  return /* @__PURE__ */ jsxs3(
8243
8252
  "div",
8244
8253
  {
8245
- className: cn("cnc-flex cnc-flex-1 cnc-justify-between cnc-items-center"),
8254
+ className: cn(
8255
+ "cnc-flex cnc-flex-1 cnc-justify-between cnc-items-center",
8256
+ container && "cnc-container cnc-mx-auto",
8257
+ className
8258
+ ),
8246
8259
  ...props,
8247
8260
  children: [
8248
- /* @__PURE__ */ jsx18("div", { children: onOpenMenu && !isOpen && /* @__PURE__ */ jsx18("button", { onClick: onOpenMenu, className: "hover:cnc-brightness-75 cnc-sidebar-child-hidden cnc-cursor-pointer", children: /* @__PURE__ */ jsx18("svg", { stroke: "currentColor", fill: "currentColor", strokeWidth: "0", viewBox: "0 0 512 512", className: "cnc-size-6 cnc-text-brand-blue-900", height: "1em", width: "1em", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx18("path", { fill: "none", strokeLinecap: "round", strokeMiterlimit: "10", strokeWidth: "48", d: "M88 152h336M88 256h336M88 360h336" }) }) }) }),
8261
+ /* @__PURE__ */ jsx18("div", { className: "cnc-flex cnc-items-center", children: onOpenMenu && !isOpen && hasSidebar ? /* @__PURE__ */ jsx18("button", { onClick: onOpenMenu, className: "hover:cnc-brightness-75 cnc-sidebar-child-hidden cnc-cursor-pointer", children: /* @__PURE__ */ jsx18("svg", { stroke: "currentColor", fill: "currentColor", strokeWidth: "0", viewBox: "0 0 512 512", className: "cnc-size-6 cnc-text-brand-blue-900 cnc-header-item", height: "1em", width: "1em", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx18("path", { fill: "none", strokeLinecap: "round", strokeMiterlimit: "10", strokeWidth: "48", d: "M88 152h336M88 256h336M88 360h336" }) }) }) : !hasSidebar && renderLogo() }),
8249
8262
  /* @__PURE__ */ jsx18("div", { className: "cnc-flex", children })
8250
8263
  ]
8251
8264
  }
@@ -8262,13 +8275,13 @@ var HeaderProfileHeader = ({
8262
8275
  "div",
8263
8276
  {
8264
8277
  id: "cnc-border-lateral",
8265
- className: "cnc-border-solid cnc-border-l-2 cnc-border-brand-blue-60",
8266
- children: /* @__PURE__ */ jsxs3("div", { className: "cnc-flex cnc-flex-row cnc-gap-2 cnc-items-center cnc-justify-center hover:cnc-bg-gray-100 cnc-transition cnc-duration-300 cnc-ease-in-out cnc-cursor-pointer cnc-px-4 cnc-py-2 cnc-rounded-lg cnc-ml-8", children: [
8278
+ className: "cnc-border-solid cnc-border-l-2 cnc-border-brand-blue-60 cnc-header-item",
8279
+ children: /* @__PURE__ */ jsxs3("div", { className: "cnc-flex cnc-flex-row cnc-gap-2 cnc-items-center cnc-justify-center hover:cnc-bg-gray-100 cnc-transition cnc-duration-300 cnc-ease-in-out cnc-cursor-pointer cnc-px-4 cnc-py-2 cnc-rounded-lg cnc-ml-8 cnc-header-item", children: [
8267
8280
  /* @__PURE__ */ jsxs3("div", { className: "cnc-flex cnc-flex-col cnc-justify-end cnc-text-end", children: [
8268
- /* @__PURE__ */ jsx18("p", { className: "cnc-text-xs cnc-font-extrabold cnc-text-brand-blue-900", children: entityName }),
8269
- /* @__PURE__ */ jsx18("p", { className: "cnc-text-xs cnc-font-normal cnc-text-brand-gray-700", children: userName })
8281
+ /* @__PURE__ */ jsx18("p", { className: "cnc-text-xs cnc-font-extrabold cnc-text-brand-blue-900 cnc-header-item", children: entityName }),
8282
+ /* @__PURE__ */ jsx18("p", { className: "cnc-text-xs cnc-font-normal cnc-text-brand-gray-700 cnc-header-item/50", children: userName })
8270
8283
  ] }),
8271
- /* @__PURE__ */ jsx18("div", { children: /* @__PURE__ */ jsx18("div", { className: "cnc-flex cnc-items-center cnc-justify-center cnc-w-10 cnc-h-10 cnc-rounded-full cnc-bg-brand-white cnc-text-brand-blue-900 cnc-text-sm cnc-font-normal cnc-border-solid cnc-border-2", children: initials }) })
8284
+ /* @__PURE__ */ jsx18("div", { children: /* @__PURE__ */ jsx18("div", { className: "cnc-flex cnc-items-center cnc-justify-center cnc-w-10 cnc-h-10 cnc-rounded-full cnc-bg-brand-white cnc-text-brand-blue-900 cnc-text-sm cnc-font-normal cnc-border-solid cnc-border-2 cnc-header-item", children: initials }) })
8272
8285
  ] })
8273
8286
  }
8274
8287
  ) }),
@@ -8287,19 +8300,18 @@ var HeaderProfileItem = ({
8287
8300
  };
8288
8301
  var AplicationsHeader = ({ children }) => {
8289
8302
  return /* @__PURE__ */ jsx18(Fragment5, { children: /* @__PURE__ */ jsxs3(DropdownMenu2, { children: [
8290
- /* @__PURE__ */ jsx18(DropdownMenuTrigger2, { asChild: true, children: /* @__PURE__ */ jsx18("div", { className: "cnc-flex cnc-flex-row cnc-gap-2 cnc-items-center cnc-justify-center hover:cnc-bg-gray-100 cnc-transition cnc-duration-300 cnc-ease-in-out cnc-cursor-pointer cnc-px-4 cnc-py-2 cnc-rounded-lg", children: /* @__PURE__ */ jsx18(
8303
+ /* @__PURE__ */ jsx18(DropdownMenuTrigger2, { asChild: true, children: /* @__PURE__ */ jsx18("div", { className: "cnc-flex cnc-flex-row cnc-gap-2 cnc-items-center cnc-justify-center hover:cnc-bg-gray-100 cnc-transition cnc-duration-300 cnc-ease-in-out cnc-cursor-pointer cnc-px-4 cnc-py-2 cnc-rounded-lg cnc-header-item", children: /* @__PURE__ */ jsx18(
8291
8304
  "svg",
8292
8305
  {
8293
8306
  width: "18",
8294
8307
  height: "18",
8295
8308
  viewBox: "0 0 16 16",
8296
- fill: "none",
8297
8309
  xmlns: "http://www.w3.org/2000/svg",
8310
+ className: "cnc-header-item",
8298
8311
  children: /* @__PURE__ */ jsx18(
8299
8312
  "path",
8300
8313
  {
8301
- d: "M2 4C3.1 4 4 3.1 4 2C4 0.9 3.1 0 2 0C0.9 0 0 0.9 0 2C0 3.1 0.9 4 2 4ZM8 16C9.1 16 10 15.1 10 14C10 12.9 9.1 12 8 12C6.9 12 6 12.9 6 14C6 15.1 6.9 16 8 16ZM2 16C3.1 16 4 15.1 4 14C4 12.9 3.1 12 2 12C0.9 12 0 12.9 0 14C0 15.1 0.9 16 2 16ZM2 10C3.1 10 4 9.1 4 8C4 6.9 3.1 6 2 6C0.9 6 0 6.9 0 8C0 9.1 0.9 10 2 10ZM8 10C9.1 10 10 9.1 10 8C10 6.9 9.1 6 8 6C6.9 6 6 6.9 6 8C6 9.1 6.9 10 8 10ZM12 2C12 3.1 12.9 4 14 4C15.1 4 16 3.1 16 2C16 0.9 15.1 0 14 0C12.9 0 12 0.9 12 2ZM8 4C9.1 4 10 3.1 10 2C10 0.9 9.1 0 8 0C6.9 0 6 0.9 6 2C6 3.1 6.9 4 8 4ZM14 10C15.1 10 16 9.1 16 8C16 6.9 15.1 6 14 6C12.9 6 12 6.9 12 8C12 9.1 12.9 10 14 10ZM14 16C15.1 16 16 15.1 16 14C16 12.9 15.1 12 14 12C12.9 12 12 12.9 12 14C12 15.1 12.9 16 14 16Z",
8302
- fill: "black"
8314
+ d: "M2 4C3.1 4 4 3.1 4 2C4 0.9 3.1 0 2 0C0.9 0 0 0.9 0 2C0 3.1 0.9 4 2 4ZM8 16C9.1 16 10 15.1 10 14C10 12.9 9.1 12 8 12C6.9 12 6 12.9 6 14C6 15.1 6.9 16 8 16ZM2 16C3.1 16 4 15.1 4 14C4 12.9 3.1 12 2 12C0.9 12 0 12.9 0 14C0 15.1 0.9 16 2 16ZM2 10C3.1 10 4 9.1 4 8C4 6.9 3.1 6 2 6C0.9 6 0 6.9 0 8C0 9.1 0.9 10 2 10ZM8 10C9.1 10 10 9.1 10 8C10 6.9 9.1 6 8 6C6.9 6 6 6.9 6 8C6 9.1 6.9 10 8 10ZM12 2C12 3.1 12.9 4 14 4C15.1 4 16 3.1 16 2C16 0.9 15.1 0 14 0C12.9 0 12 0.9 12 2ZM8 4C9.1 4 10 3.1 10 2C10 0.9 9.1 0 8 0C6.9 0 6 0.9 6 2C6 3.1 6.9 4 8 4ZM14 10C15.1 10 16 9.1 16 8C16 6.9 15.1 6 14 6C12.9 6 12 6.9 12 8C12 9.1 12.9 10 14 10ZM14 16C15.1 16 16 15.1 16 14C16 12.9 15.1 12 14 12C12.9 12 12 12.9 12 14C12 15.1 12.9 16 14 16Z"
8303
8315
  }
8304
8316
  )
8305
8317
  }
@@ -8639,14 +8651,14 @@ var DialogContent2 = React37.forwardRef(({ className, children, ...props }, ref)
8639
8651
  {
8640
8652
  ref,
8641
8653
  className: cn(
8642
- "cnc-fixed cnc-left-[50%] cnc-top-[50%] cnc-z-50 cnc-grid cnc-w-full cnc-max-w-lg cnc-translate-x-[-50%] cnc-translate-y-[-50%] cnc-gap-4 cnc-border cnc-bg-background cnc-p-6 cnc-shadow-lg cnc-duration-200 data-[state=open]:cnc-animate-in data-[state=closed]:cnc-animate-out data-[state=closed]:cnc-fade-out-0 data-[state=open]:cnc-fade-in-0 data-[state=closed]:cnc-zoom-out-95 data-[state=open]:cnc-zoom-in-95 data-[state=closed]:cnc-slide-out-to-left-1/2 data-[state=closed]:cnc-slide-out-to-top-[48%] data-[state=open]:cnc-slide-in-from-left-1/2 data-[state=open]:cnc-slide-in-from-top-[48%] cnc-sm:rounded-lg",
8654
+ "cnc-fixed cnc-left-[50%] cnc-top-[50%] cnc-z-50 cnc-grid cnc-w-full cnc-max-w-[42rem] cnc-translate-x-[-50%] cnc-translate-y-[-50%] cnc-gap-4 cnc-border cnc-bg-background cnc-p-6 cnc-pt-4 cnc-shadow-lg cnc-duration-200 data-[state=open]:cnc-animate-in data-[state=closed]:cnc-animate-out data-[state=closed]:cnc-fade-out-0 data-[state=open]:cnc-fade-in-0 data-[state=closed]:cnc-zoom-out-95 data-[state=open]:cnc-zoom-in-95 data-[state=closed]:cnc-slide-out-to-left-1/2 data-[state=closed]:cnc-slide-out-to-top-[48%] data-[state=open]:cnc-slide-in-from-left-1/2 data-[state=open]:cnc-slide-in-from-top-[48%] cnc-sm:rounded-lg",
8643
8655
  className
8644
8656
  ),
8645
8657
  ...props,
8646
8658
  children: [
8647
8659
  children,
8648
8660
  /* @__PURE__ */ jsxs5(Close, { className: "cnc-absolute cnc-right-4 cnc-top-4 cnc-rounded-sm cnc-opacity-70 cnc-ring-offset-background cnc-transition-opacity hover:cnc-opacity-100 focus:cnc-outline-none focus:cnc-ring-2 focus:cnc-ring-ring focus:cnc-ring-offset-2 disabled:cnc-pointer-events-none data-[state=open]:cnc-bg-accent data-[state=open]:cnc-text-muted-foreground", children: [
8649
- /* @__PURE__ */ jsx20(X, { className: "cnc-h-4 cnc-w-4" }),
8661
+ /* @__PURE__ */ jsx20(X, { className: "cnc-h-4 cnc-w-4 cnc-mt-2" }),
8650
8662
  /* @__PURE__ */ jsx20("span", { className: "cnc-sr-only", children: "Close" })
8651
8663
  ] })
8652
8664
  ]
@@ -8687,7 +8699,7 @@ var DialogTitle2 = React37.forwardRef(({ className, ...props }, ref) => /* @__PU
8687
8699
  {
8688
8700
  ref,
8689
8701
  className: cn(
8690
- "cnc-text-lg cnc-leading-none cnc-tracking-tight cnc-text-red-500",
8702
+ "cnc-text-lg cnc-font-semibold cnc-leading-none cnc-tracking-tight",
8691
8703
  className
8692
8704
  ),
8693
8705
  ...props
@@ -8714,9 +8726,9 @@ var Modal = ({
8714
8726
  }) => {
8715
8727
  return /* @__PURE__ */ jsxs6(Dialog2, { open: visibleModal, onOpenChange: onClose, children: [
8716
8728
  /* @__PURE__ */ jsx21(DialogOverlay2, { className: "cnc-inset-0 cnc-bg-blackA6= data-[state=open]:cnc-animate-overlayShow" }),
8717
- /* @__PURE__ */ jsxs6(DialogContent2, { className: " cnc-max-h-[85vh] cnc-w-[90vw] cnc-max-w-[40.625rem] cnc-p-0 cnc-rounded-sm cnc-bg-white cnc-focus:outline-none data-[state=open]:cnc-animate-contentShow", children: [
8718
- title && /* @__PURE__ */ jsx21(DialogHeader, { className: "cnc-text-sm cnc-h-14 cnc-text-gray-500 cnc-font-thin cnc-border-b cnc-w-full cnc-px-6 cnc-py-3 cnc-leading-10", children: title }),
8719
- /* @__PURE__ */ jsx21("div", { className: "cnc-flex cnc-flex-col cnc-mb-10 cnc-ml-20 cnc-align-middle cnc-items-left cnc-justify-center", children: content })
8729
+ /* @__PURE__ */ jsxs6(DialogContent2, { className: "cnc-max-h-[100vh] cnc-p-0 cnc-rounded-sm cnc-bg-white cnc-focus:outline-none data-[state=open]:cnc-animate-contentShow", children: [
8730
+ title && /* @__PURE__ */ jsx21(DialogHeader, { className: "cnc-text-sm cnc-h-14 cnc-text-black cnc-font- cnc-border-b cnc-w-full cnc-leading-10", children: title }),
8731
+ /* @__PURE__ */ jsx21("div", { className: "cnc-flex cnc-flex-col cnc-mb-16 cnc-mx-20 cnc-align-middle cnc-items-left cnc-justify-center", children: content })
8720
8732
  ] })
8721
8733
  ] });
8722
8734
  };