@cnc-ti/layout-basic 8.1.11 → 8.1.13

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
@@ -7807,6 +7807,7 @@ var RadioItem = MenuRadioItem;
7807
7807
  var ItemIndicator = MenuItemIndicator;
7808
7808
  var Separator = MenuSeparator;
7809
7809
  var Arrow22 = MenuArrow;
7810
+ var Sub = MenuSub;
7810
7811
  var SubTrigger = MenuSubTrigger;
7811
7812
  var SubContent = MenuSubContent;
7812
7813
 
@@ -8008,6 +8009,16 @@ var DropdownMenuArrow = React34.forwardRef(
8008
8009
  }
8009
8010
  );
8010
8011
  DropdownMenuArrow.displayName = ARROW_NAME3;
8012
+ var DropdownMenuSub = (props) => {
8013
+ const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;
8014
+ const menuScope = useMenuScope(__scopeDropdownMenu);
8015
+ const [open = false, setOpen] = useControllableState({
8016
+ prop: openProp,
8017
+ defaultProp: defaultOpen,
8018
+ onChange: onOpenChange
8019
+ });
8020
+ return /* @__PURE__ */ jsx16(Sub, { ...menuScope, open, onOpenChange: setOpen, children });
8021
+ };
8011
8022
  var SUB_TRIGGER_NAME2 = "DropdownMenuSubTrigger";
8012
8023
  var DropdownMenuSubTrigger = React34.forwardRef((props, forwardedRef) => {
8013
8024
  const { __scopeDropdownMenu, ...subTriggerProps } = props;
@@ -8044,12 +8055,15 @@ var Root22 = DropdownMenu;
8044
8055
  var Trigger = DropdownMenuTrigger;
8045
8056
  var Portal22 = DropdownMenuPortal;
8046
8057
  var Content22 = DropdownMenuContent;
8058
+ var Group2 = DropdownMenuGroup;
8047
8059
  var Label2 = DropdownMenuLabel;
8048
8060
  var Item22 = DropdownMenuItem;
8049
8061
  var CheckboxItem2 = DropdownMenuCheckboxItem;
8062
+ var RadioGroup2 = DropdownMenuRadioGroup;
8050
8063
  var RadioItem2 = DropdownMenuRadioItem;
8051
8064
  var ItemIndicator2 = DropdownMenuItemIndicator;
8052
8065
  var Separator2 = DropdownMenuSeparator;
8066
+ var Sub2 = DropdownMenuSub;
8053
8067
  var SubTrigger2 = DropdownMenuSubTrigger;
8054
8068
  var SubContent2 = DropdownMenuSubContent;
8055
8069
 
@@ -8058,6 +8072,10 @@ import * as React35 from "react";
8058
8072
  import { jsx as jsx17, jsxs as jsxs2 } from "react/jsx-runtime";
8059
8073
  var DropdownMenu2 = Root22;
8060
8074
  var DropdownMenuTrigger2 = Trigger;
8075
+ var DropdownMenuGroup2 = Group2;
8076
+ var DropdownMenuPortal2 = Portal22;
8077
+ var DropdownMenuSub2 = Sub2;
8078
+ var DropdownMenuRadioGroup2 = RadioGroup2;
8061
8079
  var DropdownMenuSubTrigger2 = React35.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs2(
8062
8080
  SubTrigger2,
8063
8081
  {
@@ -8216,13 +8234,20 @@ var Header = ({
8216
8234
  };
8217
8235
  var HeaderContainer = ({
8218
8236
  className,
8237
+ isOpen,
8238
+ onOpenMenu,
8239
+ children,
8219
8240
  ...props
8220
8241
  }) => {
8221
- return /* @__PURE__ */ jsx18(
8242
+ return /* @__PURE__ */ jsxs3(
8222
8243
  "div",
8223
8244
  {
8224
- className: cn("cnc-flex lg:cnc-flex-1 lg:cnc-justify-end"),
8225
- ...props
8245
+ className: cn("cnc-flex cnc-flex-1 cnc-justify-between cnc-items-center"),
8246
+ ...props,
8247
+ 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" }) }) }) }),
8249
+ /* @__PURE__ */ jsx18("div", { className: "cnc-flex", children })
8250
+ ]
8226
8251
  }
8227
8252
  );
8228
8253
  };
@@ -8723,9 +8748,12 @@ var ModalMudancaEntidade = ({
8723
8748
  };
8724
8749
 
8725
8750
  // src/components/Sidebar/index.tsx
8726
- import { cloneElement as cloneElement3, isValidElement } from "react";
8727
- import { Slot as Slot6 } from "@radix-ui/react-slot";
8728
8751
  import * as Accordion from "@radix-ui/react-accordion";
8752
+ import { Slot as Slot6 } from "@radix-ui/react-slot";
8753
+ import {
8754
+ cloneElement as cloneElement3,
8755
+ isValidElement
8756
+ } from "react";
8729
8757
 
8730
8758
  // src/components/assets/logotipo-default.tsx
8731
8759
  import { jsx as jsx23, jsxs as jsxs8 } from "react/jsx-runtime";
@@ -8895,22 +8923,64 @@ function LogotipoDefault() {
8895
8923
 
8896
8924
  // src/components/Sidebar/index.tsx
8897
8925
  import { jsx as jsx24, jsxs as jsxs9 } from "react/jsx-runtime";
8898
- function SidebarContainer({ isOpen = true, ...rest }) {
8899
- const sidebarWidth = "295px";
8926
+ function SidebarContainer({
8927
+ isOpen = true,
8928
+ ...rest
8929
+ }) {
8900
8930
  return /* @__PURE__ */ jsx24(
8901
8931
  "div",
8902
8932
  {
8903
8933
  "data-is-open": isOpen,
8904
- style: { width: isOpen ? sidebarWidth : "0" },
8905
- className: `cnc-w-full cnc-max-w-[295px] cnc-transition-all cnc-duration-300 cnc-ease-in-out cnc-sidebar-container cnc-bg-brand-blue-400`,
8934
+ className: `cnc-w-full cnc-max-w-full cnc-transition-all cnc-duration-300 cnc-ease-in-out cnc-sidebar-container cnc-bg-brand-blue-400`,
8906
8935
  ...rest
8907
8936
  }
8908
8937
  );
8909
8938
  }
8910
- function SidebarImageBrand({ asChild = false, onChangeToggle, img, children }) {
8939
+ function SidebarImageBrand({
8940
+ asChild = false,
8941
+ onChangeToggle,
8942
+ img,
8943
+ children
8944
+ }) {
8911
8945
  return /* @__PURE__ */ jsxs9("div", { className: "cnc-flex cnc-items-center cnc-justify-between cnc-bg-brand-blue-500 cnc-w-full cnc-h-full cnc-max-h-[70px] cnc-py-5 cnc-px-6 cnc-transition-all cnc-duration-300 cnc-ease-in-out cnc-sidebar-child-w-0", children: [
8912
- /* @__PURE__ */ jsx24("span", { className: "cnc-sidebar-child-hidden", children: asChild && !img ? children : img && img.src ? /* @__PURE__ */ jsx24("img", { src: img.src, alt: img?.alt, className: "cnc-w-[159px] cnc-h-[28px] cnc-object-contain" }) : /* @__PURE__ */ jsx24(LogotipoDefault, {}) }),
8913
- onChangeToggle && /* @__PURE__ */ jsx24("button", { onClick: onChangeToggle, className: "hover:cnc-brightness-75 cnc-sidebar-child-hidden", children: /* @__PURE__ */ jsx24("svg", { stroke: "currentColor", fill: "currentColor", strokeWidth: "0", viewBox: "0 0 512 512", className: "cnc-size-6 cnc-text-white", height: "1em", width: "1em", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx24("path", { fill: "none", strokeLinecap: "round", strokeMiterlimit: "10", strokeWidth: "48", d: "M88 152h336M88 256h336M88 360h336" }) }) })
8946
+ /* @__PURE__ */ jsx24("span", { className: "cnc-sidebar-child-hidden", children: asChild && !img ? children : img && img.src ? /* @__PURE__ */ jsx24(
8947
+ "img",
8948
+ {
8949
+ src: img.src,
8950
+ alt: img?.alt,
8951
+ className: "cnc-w-[159px] cnc-h-[28px] cnc-object-contain"
8952
+ }
8953
+ ) : /* @__PURE__ */ jsx24(LogotipoDefault, {}) }),
8954
+ onChangeToggle && /* @__PURE__ */ jsx24(
8955
+ "button",
8956
+ {
8957
+ onClick: onChangeToggle,
8958
+ className: "hover:cnc-brightness-75 cnc-sidebar-child-hidden",
8959
+ children: /* @__PURE__ */ jsx24(
8960
+ "svg",
8961
+ {
8962
+ stroke: "currentColor",
8963
+ fill: "currentColor",
8964
+ strokeWidth: "0",
8965
+ viewBox: "0 0 512 512",
8966
+ className: "cnc-size-6 cnc-text-white",
8967
+ height: "1em",
8968
+ width: "1em",
8969
+ xmlns: "http://www.w3.org/2000/svg",
8970
+ children: /* @__PURE__ */ jsx24(
8971
+ "path",
8972
+ {
8973
+ fill: "none",
8974
+ strokeLinecap: "round",
8975
+ strokeMiterlimit: "10",
8976
+ strokeWidth: "48",
8977
+ d: "M88 152h336M88 256h336M88 360h336"
8978
+ }
8979
+ )
8980
+ }
8981
+ )
8982
+ }
8983
+ )
8914
8984
  ] });
8915
8985
  }
8916
8986
  function Sidebar({ children, ...rest }) {
@@ -8922,7 +8992,11 @@ function Sidebar({ children, ...rest }) {
8922
8992
  }
8923
8993
  ) });
8924
8994
  }
8925
- function SidebarNavLink({ asChild = false, type = "primary", ...rest }) {
8995
+ function SidebarNavLink({
8996
+ asChild = false,
8997
+ type = "primary",
8998
+ ...rest
8999
+ }) {
8926
9000
  const Component = asChild ? Slot6 : "a";
8927
9001
  return /* @__PURE__ */ jsx24(
8928
9002
  Component,
@@ -8933,21 +9007,35 @@ function SidebarNavLink({ asChild = false, type = "primary", ...rest }) {
8933
9007
  }
8934
9008
  );
8935
9009
  }
8936
- function SidebarNavCollapse({ children, title, icon, ...rest }) {
9010
+ function SidebarNavCollapse({
9011
+ children,
9012
+ title,
9013
+ icon,
9014
+ ...rest
9015
+ }) {
8937
9016
  return /* @__PURE__ */ jsxs9(Accordion.Item, { ...rest, children: [
8938
- /* @__PURE__ */ jsxs9(
8939
- Accordion.Trigger,
8940
- {
8941
- className: "group cnc-w-full cnc-py-4 cnc-text-base cnc-text-white cnc-flex cnc-gap-2 cnc-items-center cnc-justify-between hover:cnc-text-blue-600 cnc-sidebar-child-hidden",
8942
- children: [
8943
- /* @__PURE__ */ jsxs9("div", { className: "cnc-flex cnc-items-center cnc-gap-2", children: [
8944
- icon && renderIconItem(icon),
8945
- title
8946
- ] }),
8947
- /* @__PURE__ */ jsx24("div", { className: "cnc-w-4 cnc-h-4", children: /* @__PURE__ */ jsx24("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "cnc-w-full cnc-h-full cnc-text-violet10 cnc-transition-transform cnc-duration-300 cnc-ease-[cubic-bezier(0.87,_0,_0.13,_1)] group-data-[state=open]:cnc-rotate-90", children: /* @__PURE__ */ jsx24("path", { d: "m9 18 6-6-6-6" }) }) })
8948
- ]
8949
- }
8950
- ),
9017
+ /* @__PURE__ */ jsxs9(Accordion.Trigger, { className: "group cnc-w-full cnc-py-4 cnc-text-base cnc-text-white cnc-flex cnc-gap-2 cnc-items-center cnc-justify-between hover:cnc-text-blue-600 cnc-sidebar-child-hidden", children: [
9018
+ /* @__PURE__ */ jsxs9("div", { className: "cnc-flex cnc-items-center cnc-gap-2", children: [
9019
+ icon && renderIconItem(icon),
9020
+ title
9021
+ ] }),
9022
+ /* @__PURE__ */ jsx24("div", { className: "cnc-w-4 cnc-h-4", children: /* @__PURE__ */ jsx24(
9023
+ "svg",
9024
+ {
9025
+ xmlns: "http://www.w3.org/2000/svg",
9026
+ width: "24",
9027
+ height: "24",
9028
+ viewBox: "0 0 24 24",
9029
+ fill: "none",
9030
+ stroke: "currentColor",
9031
+ strokeWidth: "2",
9032
+ strokeLinecap: "round",
9033
+ strokeLinejoin: "round",
9034
+ className: "cnc-w-full cnc-h-full cnc-text-violet10 cnc-transition-transform cnc-duration-300 cnc-ease-[cubic-bezier(0.87,_0,_0.13,_1)] group-data-[state=open]:cnc-rotate-90",
9035
+ children: /* @__PURE__ */ jsx24("path", { d: "m9 18 6-6-6-6" })
9036
+ }
9037
+ ) })
9038
+ ] }),
8951
9039
  /* @__PURE__ */ jsx24(Accordion.Content, { className: "cnc-overflow-hidden data-[state=closed]:cnc-animate-slideUp data-[state=open]:cnc-animate-slideDown cnc-py-2", children: /* @__PURE__ */ jsx24("div", { className: "cnc-bg-white/10 cnc-rounded-md cnc-font-normal cnc-px-5 cnc-py-3", children }) })
8952
9040
  ] });
8953
9041
  }
@@ -9279,6 +9367,21 @@ export {
9279
9367
  DialogPortal2 as DialogPortal,
9280
9368
  DialogTitle2 as DialogTitle,
9281
9369
  DialogTrigger2 as DialogTrigger,
9370
+ DropdownMenu2 as DropdownMenu,
9371
+ DropdownMenuCheckboxItem2 as DropdownMenuCheckboxItem,
9372
+ DropdownMenuContent2 as DropdownMenuContent,
9373
+ DropdownMenuGroup2 as DropdownMenuGroup,
9374
+ DropdownMenuItem2 as DropdownMenuItem,
9375
+ DropdownMenuLabel2 as DropdownMenuLabel,
9376
+ DropdownMenuPortal2 as DropdownMenuPortal,
9377
+ DropdownMenuRadioGroup2 as DropdownMenuRadioGroup,
9378
+ DropdownMenuRadioItem2 as DropdownMenuRadioItem,
9379
+ DropdownMenuSeparator2 as DropdownMenuSeparator,
9380
+ DropdownMenuShortcut,
9381
+ DropdownMenuSub2 as DropdownMenuSub,
9382
+ DropdownMenuSubContent2 as DropdownMenuSubContent,
9383
+ DropdownMenuSubTrigger2 as DropdownMenuSubTrigger,
9384
+ DropdownMenuTrigger2 as DropdownMenuTrigger,
9282
9385
  Header,
9283
9386
  HeaderContainer,
9284
9387
  HeaderProfileHeader,