@cnc-ti/layout-basic 8.1.10 → 8.1.12

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
@@ -1,4 +1,8 @@
1
- "use client";
1
+
2
+ if (typeof window !== 'undefined') {
3
+ "use client";
4
+ }
5
+
2
6
 
3
7
  // src/components/Button/index.tsx
4
8
  import { Slot } from "@radix-ui/react-slot";
@@ -7803,6 +7807,7 @@ var RadioItem = MenuRadioItem;
7803
7807
  var ItemIndicator = MenuItemIndicator;
7804
7808
  var Separator = MenuSeparator;
7805
7809
  var Arrow22 = MenuArrow;
7810
+ var Sub = MenuSub;
7806
7811
  var SubTrigger = MenuSubTrigger;
7807
7812
  var SubContent = MenuSubContent;
7808
7813
 
@@ -8004,6 +8009,16 @@ var DropdownMenuArrow = React34.forwardRef(
8004
8009
  }
8005
8010
  );
8006
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
+ };
8007
8022
  var SUB_TRIGGER_NAME2 = "DropdownMenuSubTrigger";
8008
8023
  var DropdownMenuSubTrigger = React34.forwardRef((props, forwardedRef) => {
8009
8024
  const { __scopeDropdownMenu, ...subTriggerProps } = props;
@@ -8040,12 +8055,15 @@ var Root22 = DropdownMenu;
8040
8055
  var Trigger = DropdownMenuTrigger;
8041
8056
  var Portal22 = DropdownMenuPortal;
8042
8057
  var Content22 = DropdownMenuContent;
8058
+ var Group2 = DropdownMenuGroup;
8043
8059
  var Label2 = DropdownMenuLabel;
8044
8060
  var Item22 = DropdownMenuItem;
8045
8061
  var CheckboxItem2 = DropdownMenuCheckboxItem;
8062
+ var RadioGroup2 = DropdownMenuRadioGroup;
8046
8063
  var RadioItem2 = DropdownMenuRadioItem;
8047
8064
  var ItemIndicator2 = DropdownMenuItemIndicator;
8048
8065
  var Separator2 = DropdownMenuSeparator;
8066
+ var Sub2 = DropdownMenuSub;
8049
8067
  var SubTrigger2 = DropdownMenuSubTrigger;
8050
8068
  var SubContent2 = DropdownMenuSubContent;
8051
8069
 
@@ -8054,6 +8072,10 @@ import * as React35 from "react";
8054
8072
  import { jsx as jsx17, jsxs as jsxs2 } from "react/jsx-runtime";
8055
8073
  var DropdownMenu2 = Root22;
8056
8074
  var DropdownMenuTrigger2 = Trigger;
8075
+ var DropdownMenuGroup2 = Group2;
8076
+ var DropdownMenuPortal2 = Portal22;
8077
+ var DropdownMenuSub2 = Sub2;
8078
+ var DropdownMenuRadioGroup2 = RadioGroup2;
8057
8079
  var DropdownMenuSubTrigger2 = React35.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs2(
8058
8080
  SubTrigger2,
8059
8081
  {
@@ -8212,13 +8234,20 @@ var Header = ({
8212
8234
  };
8213
8235
  var HeaderContainer = ({
8214
8236
  className,
8237
+ isOpen,
8238
+ onOpenMenu,
8239
+ children,
8215
8240
  ...props
8216
8241
  }) => {
8217
- return /* @__PURE__ */ jsx18(
8242
+ return /* @__PURE__ */ jsxs3(
8218
8243
  "div",
8219
8244
  {
8220
- className: cn("cnc-flex lg:cnc-flex-1 lg:cnc-justify-end"),
8221
- ...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
+ ]
8222
8251
  }
8223
8252
  );
8224
8253
  };
@@ -9275,6 +9304,21 @@ export {
9275
9304
  DialogPortal2 as DialogPortal,
9276
9305
  DialogTitle2 as DialogTitle,
9277
9306
  DialogTrigger2 as DialogTrigger,
9307
+ DropdownMenu2 as DropdownMenu,
9308
+ DropdownMenuCheckboxItem2 as DropdownMenuCheckboxItem,
9309
+ DropdownMenuContent2 as DropdownMenuContent,
9310
+ DropdownMenuGroup2 as DropdownMenuGroup,
9311
+ DropdownMenuItem2 as DropdownMenuItem,
9312
+ DropdownMenuLabel2 as DropdownMenuLabel,
9313
+ DropdownMenuPortal2 as DropdownMenuPortal,
9314
+ DropdownMenuRadioGroup2 as DropdownMenuRadioGroup,
9315
+ DropdownMenuRadioItem2 as DropdownMenuRadioItem,
9316
+ DropdownMenuSeparator2 as DropdownMenuSeparator,
9317
+ DropdownMenuShortcut,
9318
+ DropdownMenuSub2 as DropdownMenuSub,
9319
+ DropdownMenuSubContent2 as DropdownMenuSubContent,
9320
+ DropdownMenuSubTrigger2 as DropdownMenuSubTrigger,
9321
+ DropdownMenuTrigger2 as DropdownMenuTrigger,
9278
9322
  Header,
9279
9323
  HeaderContainer,
9280
9324
  HeaderProfileHeader,