@sikka/hawa 0.7.16-next → 0.7.17-next

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.css CHANGED
@@ -1718,10 +1718,6 @@ input[type="number"]::-webkit-inner-spin-button,
1718
1718
  --tw-bg-opacity: 1;
1719
1719
  background-color: rgb(219 234 254 / var(--tw-bg-opacity));
1720
1720
  }
1721
- .hawa-bg-blue-400 {
1722
- --tw-bg-opacity: 1;
1723
- background-color: rgb(96 165 250 / var(--tw-bg-opacity));
1724
- }
1725
1721
  .hawa-bg-blue-50 {
1726
1722
  --tw-bg-opacity: 1;
1727
1723
  background-color: rgb(239 246 255 / var(--tw-bg-opacity));
package/dist/index.d.mts CHANGED
@@ -323,6 +323,8 @@ interface DropdownMenuProps {
323
323
  width?: "default" | "sm" | "lg" | "parent";
324
324
  size?: "default" | "sm";
325
325
  onItemSelect?: any;
326
+ onOpenChange?: any;
327
+ open?: any;
326
328
  }
327
329
  declare const DropdownMenu: React$1.FC<DropdownMenuProps>;
328
330
 
package/dist/index.d.ts CHANGED
@@ -323,6 +323,8 @@ interface DropdownMenuProps {
323
323
  width?: "default" | "sm" | "lg" | "parent";
324
324
  size?: "default" | "sm";
325
325
  onItemSelect?: any;
326
+ onOpenChange?: any;
327
+ open?: any;
326
328
  }
327
329
  declare const DropdownMenu: React$1.FC<DropdownMenuProps>;
328
330
 
package/dist/index.js CHANGED
@@ -2154,7 +2154,6 @@ var DropdownMenuItem = React24.forwardRef(function(_param, ref) {
2154
2154
  "className",
2155
2155
  "inset"
2156
2156
  ]);
2157
- console.log("sdsdsds", props.children);
2158
2157
  return /* @__PURE__ */ React24.createElement(DropdownMenuPrimitive.Item, _object_spread({
2159
2158
  disabled: props.disabled,
2160
2159
  ref: ref,
@@ -2249,7 +2248,7 @@ var DropdownMenuShortcut = function(_param) {
2249
2248
  };
2250
2249
  DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
2251
2250
  var DropdownMenu = function(param) {
2252
- var trigger = param.trigger, items = param.items, direction = param.direction, sideOffset = param.sideOffset, side = param.side, className = param.className, triggerClassname = param.triggerClassname, align = param.align, alignOffset = param.alignOffset, onItemSelect = param.onItemSelect, _param_size = param.size, size = _param_size === void 0 ? "default" : _param_size, _param_width = param.width, width = _param_width === void 0 ? "default" : _param_width;
2251
+ var trigger = param.trigger, items = param.items, direction = param.direction, sideOffset = param.sideOffset, side = param.side, className = param.className, triggerClassname = param.triggerClassname, align = param.align, alignOffset = param.alignOffset, onItemSelect = param.onItemSelect, _param_size = param.size, size = _param_size === void 0 ? "default" : _param_size, _param_width = param.width, width = _param_width === void 0 ? "default" : _param_width, onOpenChange = param.onOpenChange, open = param.open;
2253
2252
  var widthStyles = {
2254
2253
  default: "hawa-min-w-[8rem]",
2255
2254
  sm: "hawa-w-fit",
@@ -2261,6 +2260,8 @@ var DropdownMenu = function(param) {
2261
2260
  sm: "hawa-text-xs hawa-px-1.5 hawa-py-1.5 "
2262
2261
  };
2263
2262
  return /* @__PURE__ */ React24.createElement(DropdownMenuRoot, {
2263
+ onOpenChange: onOpenChange,
2264
+ open: open,
2264
2265
  modal: false,
2265
2266
  dir: direction
2266
2267
  }, /* @__PURE__ */ React24.createElement(DropdownMenuTrigger, {
@@ -6045,7 +6046,7 @@ var NavigationMenuRoot = React47.forwardRef(function(_param, ref) /* @__PURE__ *
6045
6046
  ]);
6046
6047
  return React47.createElement(NavigationMenuPrimitive.Root, _object_spread({
6047
6048
  ref: ref,
6048
- className: cn("hawa-relative hawa-bg-yellow-400 hawa-p-2 hawa-z-10 hawa-flex hawa-max-w-max hawa-flex-1 hawa-items-center hawa-justify-center", className)
6049
+ className: cn("hawa-relative hawa-z-10 hawa-flex hawa-max-w-max hawa-flex-1 hawa-items-center hawa-justify-center", className)
6049
6050
  }, props), children, /* @__PURE__ */ React47.createElement(NavigationMenuViewport, null));
6050
6051
  });
6051
6052
  NavigationMenuRoot.displayName = NavigationMenuPrimitive.Root.displayName;
@@ -6055,7 +6056,7 @@ var NavigationMenuList = React47.forwardRef(function(_param, ref) /* @__PURE__ *
6055
6056
  ]);
6056
6057
  return React47.createElement(NavigationMenuPrimitive.List, _object_spread({
6057
6058
  ref: ref,
6058
- className: cn("hawa-group hawa-bg-blue-400 hawa-p-2 hawa-flex hawa-flex-1 hawa-list-none hawa-items-center hawa-justify-center hawa-space-x-1", className)
6059
+ className: cn("hawa-group hawa-flex hawa-flex-1 hawa-list-none hawa-items-center hawa-justify-center hawa-space-x-1", className)
6059
6060
  }, props));
6060
6061
  });
6061
6062
  NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;
@@ -6092,7 +6093,8 @@ var NavigationMenuContent = React47.forwardRef(function(_param, ref) /* @__PURE_
6092
6093
  ]);
6093
6094
  return React47.createElement(NavigationMenuPrimitive.Content, _object_spread({
6094
6095
  ref: ref,
6095
- className: cn("hawa-bg-green-400 hawa-p-2 hawa-w-full md:hawa-absolute hawa-left-0 hawa-top-0 md:hawa-w-auto ", // animation
6096
+ className: cn("hawa-absolute hawa-w-auto hawa-left-0 hawa-top-0 ", // "md:hawa-absolute md:hawa-w-auto hawa-left-0 hawa-top-0 ",
6097
+ // animation
6096
6098
  "data-[motion^=from-]:hawa-animate-in data-[motion^=to-]:hawa-animate-out data-[motion^=from-]:hawa-fade-in data-[motion^=to-]:hawa-fade-out data-[motion=from-end]:hawa-slide-in-from-right-52 data-[motion=from-start]:hawa-slide-in-from-left-52 data-[motion=to-end]:hawa-slide-out-to-right-52 data-[motion=to-start]:hawa-slide-out-to-left-52", className)
6097
6099
  }, props));
6098
6100
  });
@@ -6103,9 +6105,10 @@ var NavigationMenuViewport = React47.forwardRef(function(_param, ref) /* @__PURE
6103
6105
  "className"
6104
6106
  ]);
6105
6107
  return React47.createElement("div", {
6106
- className: cn("hawa-absolute hawa-left-0 hawa-top-full hawa-flex hawa-justify-center")
6108
+ className: cn("hawa-absolute hawa-w-full hawa-top-full hawa-flex hawa-justify-center")
6107
6109
  }, /* @__PURE__ */ React47.createElement(NavigationMenuPrimitive.Viewport, _object_spread({
6108
- className: cn("hawa-origin-top-center hawa-relative hawa-mt-1.5 hawa-h-[var(--radix-navigation-menu-viewport-height)] hawa-w-full hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-text-popover-foreground hawa-shadow-lg data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-90 md:hawa-w-[var(--radix-navigation-menu-viewport-width)]", className),
6110
+ className: cn("hawa-origin-top-center hawa-relative hawa-mt-1.5 hawa-h-[var(--radix-navigation-menu-viewport-height)] hawa-w-full hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-text-popover-foreground hawa-shadow-lg data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-90 ", // "md:hawa-w-[var(--radix-navigation-menu-viewport-width)]",
6111
+ className),
6109
6112
  ref: ref
6110
6113
  }, props)));
6111
6114
  });
@@ -6127,7 +6130,7 @@ var NavigationMenu = function(props) {
6127
6130
  return /* @__PURE__ */ React47.createElement(NavigationMenuItem, {
6128
6131
  key: i
6129
6132
  }, item.content ? /* @__PURE__ */ React47.createElement(React47.Fragment, null, /* @__PURE__ */ React47.createElement(NavigationMenuTrigger, null, item.trigger), /* @__PURE__ */ React47.createElement(NavigationMenuContent, null, item.content)) : /* @__PURE__ */ React47.createElement(NavigationMenuLink, {
6130
- className: navigationMenuTriggerStyle()
6133
+ className: cn(navigationMenuTriggerStyle(), "hawa-cursor-pointer hawa-select-none")
6131
6134
  }, item.trigger));
6132
6135
  })));
6133
6136
  };
package/dist/index.mjs CHANGED
@@ -1648,7 +1648,6 @@ var DropdownMenuContent = React24.forwardRef(({ className, sideOffset = 4, ...pr
1648
1648
  )));
1649
1649
  DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
1650
1650
  var DropdownMenuItem = React24.forwardRef(({ className, inset, ...props }, ref) => {
1651
- console.log("sdsdsds", props.children);
1652
1651
  return /* @__PURE__ */ React24.createElement(
1653
1652
  DropdownMenuPrimitive.Item,
1654
1653
  {
@@ -1774,7 +1773,9 @@ var DropdownMenu = ({
1774
1773
  alignOffset,
1775
1774
  onItemSelect,
1776
1775
  size = "default",
1777
- width = "default"
1776
+ width = "default",
1777
+ onOpenChange,
1778
+ open
1778
1779
  }) => {
1779
1780
  const widthStyles = {
1780
1781
  default: "hawa-min-w-[8rem]",
@@ -1786,86 +1787,96 @@ var DropdownMenu = ({
1786
1787
  default: "hawa-px-2 hawa-py-3 ",
1787
1788
  sm: "hawa-text-xs hawa-px-1.5 hawa-py-1.5 "
1788
1789
  };
1789
- return /* @__PURE__ */ React24.createElement(DropdownMenuRoot, { modal: false, dir: direction }, /* @__PURE__ */ React24.createElement(DropdownMenuTrigger, { asChild: true, className: triggerClassname }, trigger), /* @__PURE__ */ React24.createElement(DropdownMenuPortal, null, /* @__PURE__ */ React24.createElement(
1790
- DropdownMenuContent,
1790
+ return /* @__PURE__ */ React24.createElement(
1791
+ DropdownMenuRoot,
1791
1792
  {
1792
- side,
1793
- sideOffset,
1794
- className: cn(
1795
- className,
1796
- widthStyles[width],
1797
- "hawa-flex hawa-flex-col hawa-gap-1"
1798
- ),
1799
- align,
1800
- alignOffset
1793
+ onOpenChange,
1794
+ open,
1795
+ modal: false,
1796
+ dir: direction
1801
1797
  },
1802
- items && items.map((item, index) => {
1803
- if (item.itemType === "separator") {
1804
- return /* @__PURE__ */ React24.createElement(DropdownMenuSeparator, { key: index });
1805
- } else if (item.itemType === "label") {
1806
- return /* @__PURE__ */ React24.createElement(DropdownMenuLabel, { key: index }, item.label);
1807
- } else if (item.itemType === "custom") {
1808
- return /* @__PURE__ */ React24.createElement("div", { key: index }, item.content);
1809
- } else {
1810
- return item.subitems ? /* @__PURE__ */ React24.createElement(DropdownMenuSub, { key: index }, /* @__PURE__ */ React24.createElement(
1811
- DropdownMenuSubTrigger,
1812
- {
1813
- className: cn(sizeStyles[size]),
1814
- dir: direction
1815
- },
1816
- item.icon && item.icon,
1817
- item.label && item.label
1818
- ), /* @__PURE__ */ React24.createElement(DropdownMenuPortal, null, /* @__PURE__ */ React24.createElement(DropdownMenuSubContent, null, item.subitems.map((subitem, subIndex) => /* @__PURE__ */ React24.createElement(
1819
- DropdownMenuItem,
1820
- {
1821
- key: subIndex,
1822
- className: cn(
1823
- sizeStyles[size],
1824
- !item.icon && !item.label ? "hawa-px-0 hawa-py-0 focus:hawa-bg-transparent" : "focus:hawa-bg-accent"
1825
- ),
1826
- disabled: subitem.disabled,
1827
- onSelect: () => {
1828
- subitem.action && subitem.action();
1829
- if (onItemSelect) {
1830
- onItemSelect(subitem.value);
1831
- }
1832
- }
1833
- },
1834
- subitem.icon && subitem.icon,
1835
- subitem.label && subitem.label
1836
- ))))) : /* @__PURE__ */ React24.createElement(
1837
- DropdownMenuItem,
1838
- {
1839
- key: index,
1840
- disabled: item.disabled,
1841
- onSelect: (e) => {
1842
- if (item.presist) {
1843
- e.preventDefault();
1844
- }
1845
- if (item.action) {
1846
- item.action();
1847
- if (onItemSelect) {
1848
- onItemSelect(item.value);
1849
- }
1850
- } else {
1798
+ /* @__PURE__ */ React24.createElement(DropdownMenuTrigger, { asChild: true, className: triggerClassname }, trigger),
1799
+ /* @__PURE__ */ React24.createElement(DropdownMenuPortal, null, /* @__PURE__ */ React24.createElement(
1800
+ DropdownMenuContent,
1801
+ {
1802
+ side,
1803
+ sideOffset,
1804
+ className: cn(
1805
+ className,
1806
+ widthStyles[width],
1807
+ "hawa-flex hawa-flex-col hawa-gap-1"
1808
+ ),
1809
+ align,
1810
+ alignOffset
1811
+ },
1812
+ items && items.map((item, index) => {
1813
+ if (item.itemType === "separator") {
1814
+ return /* @__PURE__ */ React24.createElement(DropdownMenuSeparator, { key: index });
1815
+ } else if (item.itemType === "label") {
1816
+ return /* @__PURE__ */ React24.createElement(DropdownMenuLabel, { key: index }, item.label);
1817
+ } else if (item.itemType === "custom") {
1818
+ return /* @__PURE__ */ React24.createElement("div", { key: index }, item.content);
1819
+ } else {
1820
+ return item.subitems ? /* @__PURE__ */ React24.createElement(DropdownMenuSub, { key: index }, /* @__PURE__ */ React24.createElement(
1821
+ DropdownMenuSubTrigger,
1822
+ {
1823
+ className: cn(sizeStyles[size]),
1824
+ dir: direction
1825
+ },
1826
+ item.icon && item.icon,
1827
+ item.label && item.label
1828
+ ), /* @__PURE__ */ React24.createElement(DropdownMenuPortal, null, /* @__PURE__ */ React24.createElement(DropdownMenuSubContent, null, item.subitems.map((subitem, subIndex) => /* @__PURE__ */ React24.createElement(
1829
+ DropdownMenuItem,
1830
+ {
1831
+ key: subIndex,
1832
+ className: cn(
1833
+ sizeStyles[size],
1834
+ !item.icon && !item.label ? "hawa-px-0 hawa-py-0 focus:hawa-bg-transparent" : "focus:hawa-bg-accent"
1835
+ ),
1836
+ disabled: subitem.disabled,
1837
+ onSelect: () => {
1838
+ subitem.action && subitem.action();
1851
1839
  if (onItemSelect) {
1852
- onItemSelect(item.value);
1840
+ onItemSelect(subitem.value);
1853
1841
  }
1854
1842
  }
1855
1843
  },
1856
- end: item.end,
1857
- className: cn(
1858
- sizeStyles[size],
1859
- !item.icon && !item.label ? "hawa-px-0 hawa-py-0 focus:hawa-bg-transparent " : "focus:hawa-bg-accent ",
1860
- item.presist && "focus:hawa-bg-transparent"
1861
- )
1862
- },
1863
- item.icon && item.icon,
1864
- item.label && item.label
1865
- );
1866
- }
1867
- })
1868
- )));
1844
+ subitem.icon && subitem.icon,
1845
+ subitem.label && subitem.label
1846
+ ))))) : /* @__PURE__ */ React24.createElement(
1847
+ DropdownMenuItem,
1848
+ {
1849
+ key: index,
1850
+ disabled: item.disabled,
1851
+ onSelect: (e) => {
1852
+ if (item.presist) {
1853
+ e.preventDefault();
1854
+ }
1855
+ if (item.action) {
1856
+ item.action();
1857
+ if (onItemSelect) {
1858
+ onItemSelect(item.value);
1859
+ }
1860
+ } else {
1861
+ if (onItemSelect) {
1862
+ onItemSelect(item.value);
1863
+ }
1864
+ }
1865
+ },
1866
+ end: item.end,
1867
+ className: cn(
1868
+ sizeStyles[size],
1869
+ !item.icon && !item.label ? "hawa-px-0 hawa-py-0 focus:hawa-bg-transparent " : "focus:hawa-bg-accent ",
1870
+ item.presist && "focus:hawa-bg-transparent"
1871
+ )
1872
+ },
1873
+ item.icon && item.icon,
1874
+ item.label && item.label
1875
+ );
1876
+ }
1877
+ })
1878
+ ))
1879
+ );
1869
1880
  };
1870
1881
 
1871
1882
  // components/elements/ColorPicker.tsx
@@ -5717,7 +5728,7 @@ var NavigationMenuRoot = React47.forwardRef(({ className, children, ...props },
5717
5728
  {
5718
5729
  ref,
5719
5730
  className: cn(
5720
- "hawa-relative hawa-bg-yellow-400 hawa-p-2 hawa-z-10 hawa-flex hawa-max-w-max hawa-flex-1 hawa-items-center hawa-justify-center",
5731
+ "hawa-relative hawa-z-10 hawa-flex hawa-max-w-max hawa-flex-1 hawa-items-center hawa-justify-center",
5721
5732
  className
5722
5733
  ),
5723
5734
  ...props
@@ -5731,7 +5742,7 @@ var NavigationMenuList = React47.forwardRef(({ className, ...props }, ref) => /*
5731
5742
  {
5732
5743
  ref,
5733
5744
  className: cn(
5734
- "hawa-group hawa-bg-blue-400 hawa-p-2 hawa-flex hawa-flex-1 hawa-list-none hawa-items-center hawa-justify-center hawa-space-x-1",
5745
+ "hawa-group hawa-flex hawa-flex-1 hawa-list-none hawa-items-center hawa-justify-center hawa-space-x-1",
5735
5746
  className
5736
5747
  ),
5737
5748
  ...props
@@ -5775,7 +5786,8 @@ var NavigationMenuContent = React47.forwardRef(({ className, ...props }, ref) =>
5775
5786
  {
5776
5787
  ref,
5777
5788
  className: cn(
5778
- "hawa-bg-green-400 hawa-p-2 hawa-w-full md:hawa-absolute hawa-left-0 hawa-top-0 md:hawa-w-auto ",
5789
+ "hawa-absolute hawa-w-auto hawa-left-0 hawa-top-0 ",
5790
+ // "md:hawa-absolute md:hawa-w-auto hawa-left-0 hawa-top-0 ",
5779
5791
  // animation
5780
5792
  "data-[motion^=from-]:hawa-animate-in data-[motion^=to-]:hawa-animate-out data-[motion^=from-]:hawa-fade-in data-[motion^=to-]:hawa-fade-out data-[motion=from-end]:hawa-slide-in-from-right-52 data-[motion=from-start]:hawa-slide-in-from-left-52 data-[motion=to-end]:hawa-slide-out-to-right-52 data-[motion=to-start]:hawa-slide-out-to-left-52",
5781
5793
  className
@@ -5789,14 +5801,15 @@ var NavigationMenuViewport = React47.forwardRef(({ className, ...props }, ref) =
5789
5801
  "div",
5790
5802
  {
5791
5803
  className: cn(
5792
- "hawa-absolute hawa-left-0 hawa-top-full hawa-flex hawa-justify-center"
5804
+ "hawa-absolute hawa-w-full hawa-top-full hawa-flex hawa-justify-center"
5793
5805
  )
5794
5806
  },
5795
5807
  /* @__PURE__ */ React47.createElement(
5796
5808
  NavigationMenuPrimitive.Viewport,
5797
5809
  {
5798
5810
  className: cn(
5799
- "hawa-origin-top-center hawa-relative hawa-mt-1.5 hawa-h-[var(--radix-navigation-menu-viewport-height)] hawa-w-full hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-text-popover-foreground hawa-shadow-lg data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-90 md:hawa-w-[var(--radix-navigation-menu-viewport-width)]",
5811
+ "hawa-origin-top-center hawa-relative hawa-mt-1.5 hawa-h-[var(--radix-navigation-menu-viewport-height)] hawa-w-full hawa-overflow-hidden hawa-rounded-md hawa-border hawa-bg-popover hawa-text-popover-foreground hawa-shadow-lg data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-90 ",
5812
+ // "md:hawa-w-[var(--radix-navigation-menu-viewport-width)]",
5800
5813
  className
5801
5814
  ),
5802
5815
  ref,
@@ -5819,7 +5832,16 @@ var NavigationMenuIndicator = React47.forwardRef(({ className, ...props }, ref)
5819
5832
  ));
5820
5833
  NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;
5821
5834
  var NavigationMenu = (props) => {
5822
- return /* @__PURE__ */ React47.createElement(NavigationMenuRoot, null, /* @__PURE__ */ React47.createElement(NavigationMenuList, null, props.items.map((item, i) => /* @__PURE__ */ React47.createElement(NavigationMenuItem, { key: i }, item.content ? /* @__PURE__ */ React47.createElement(React47.Fragment, null, /* @__PURE__ */ React47.createElement(NavigationMenuTrigger, null, item.trigger), /* @__PURE__ */ React47.createElement(NavigationMenuContent, null, item.content)) : /* @__PURE__ */ React47.createElement(NavigationMenuLink, { className: navigationMenuTriggerStyle() }, item.trigger)))));
5835
+ return /* @__PURE__ */ React47.createElement(NavigationMenuRoot, null, /* @__PURE__ */ React47.createElement(NavigationMenuList, null, props.items.map((item, i) => /* @__PURE__ */ React47.createElement(NavigationMenuItem, { key: i }, item.content ? /* @__PURE__ */ React47.createElement(React47.Fragment, null, /* @__PURE__ */ React47.createElement(NavigationMenuTrigger, null, item.trigger), /* @__PURE__ */ React47.createElement(NavigationMenuContent, null, item.content)) : /* @__PURE__ */ React47.createElement(
5836
+ NavigationMenuLink,
5837
+ {
5838
+ className: cn(
5839
+ navigationMenuTriggerStyle(),
5840
+ "hawa-cursor-pointer hawa-select-none"
5841
+ )
5842
+ },
5843
+ item.trigger
5844
+ )))));
5823
5845
  };
5824
5846
 
5825
5847
  // components/layout/Stats.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.7.16-next",
3
+ "version": "0.7.17-next",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {