@sikka/hawa 0.30.23-next → 0.30.24-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.
Files changed (59) hide show
  1. package/dist/{DropdownMenu-sSnQc6fT.d.ts → DropdownMenu-o_-MnT5h.d.mts} +6 -6
  2. package/dist/{DropdownMenu-arqV1gRt.d.mts → DropdownMenu-p-Ha-y2R.d.ts} +6 -6
  3. package/dist/appLayout/index.d.mts +8 -1
  4. package/dist/appLayout/index.d.ts +8 -1
  5. package/dist/appLayout/index.js +31 -0
  6. package/dist/appLayout/index.js.map +1 -1
  7. package/dist/appLayout/index.mjs +35 -4
  8. package/dist/appLayout/index.mjs.map +1 -1
  9. package/dist/appTopbar/index.d.mts +5 -2
  10. package/dist/appTopbar/index.d.ts +5 -2
  11. package/dist/appTopbar/index.js +31 -0
  12. package/dist/appTopbar/index.js.map +1 -1
  13. package/dist/appTopbar/index.mjs +31 -0
  14. package/dist/appTopbar/index.mjs.map +1 -1
  15. package/dist/blocks/index.d.mts +1 -1
  16. package/dist/blocks/index.d.ts +1 -1
  17. package/dist/blocks/index.js +31 -0
  18. package/dist/blocks/index.mjs +2 -2
  19. package/dist/blocks/pricing/index.mjs +3 -3
  20. package/dist/{chunk-CXBN42TF.mjs → chunk-7LAUVLVZ.mjs} +1 -1
  21. package/dist/{chunk-HOE4FCIF.mjs → chunk-DGOT2FVH.mjs} +30 -0
  22. package/dist/{chunk-MH5K6NEO.mjs → chunk-TKSAYWDH.mjs} +1 -1
  23. package/dist/combobox/index.js +44 -35
  24. package/dist/combobox/index.js.map +1 -1
  25. package/dist/combobox/index.mjs +44 -35
  26. package/dist/combobox/index.mjs.map +1 -1
  27. package/dist/commonTypes-52DloiYq.d.mts +7 -0
  28. package/dist/commonTypes-52DloiYq.d.ts +7 -0
  29. package/dist/dataTable/index.js +31 -0
  30. package/dist/dataTable/index.js.map +1 -1
  31. package/dist/dataTable/index.mjs +31 -0
  32. package/dist/dataTable/index.mjs.map +1 -1
  33. package/dist/docsLayout/index.d.mts +1 -1
  34. package/dist/docsLayout/index.d.ts +1 -1
  35. package/dist/dropdownMenu/index.d.mts +9 -5
  36. package/dist/dropdownMenu/index.d.ts +9 -5
  37. package/dist/dropdownMenu/index.js +30 -0
  38. package/dist/dropdownMenu/index.js.map +1 -1
  39. package/dist/dropdownMenu/index.mjs +30 -0
  40. package/dist/dropdownMenu/index.mjs.map +1 -1
  41. package/dist/elements/index.d.mts +1 -1
  42. package/dist/elements/index.d.ts +1 -1
  43. package/dist/elements/index.js +74 -35
  44. package/dist/elements/index.mjs +47 -38
  45. package/dist/index.d.mts +5 -5
  46. package/dist/index.d.ts +5 -5
  47. package/dist/index.js +74 -35
  48. package/dist/index.mjs +179 -140
  49. package/dist/layout/index.d.mts +1 -1
  50. package/dist/layout/index.d.ts +1 -1
  51. package/dist/layout/index.js +31 -0
  52. package/dist/layout/index.mjs +2 -2
  53. package/dist/splitButton/index.d.mts +8 -1
  54. package/dist/splitButton/index.d.ts +8 -1
  55. package/dist/splitButton/index.js +31 -0
  56. package/dist/splitButton/index.js.map +1 -1
  57. package/dist/splitButton/index.mjs +31 -0
  58. package/dist/splitButton/index.mjs.map +1 -1
  59. package/package.json +1 -1
@@ -28,7 +28,7 @@ import {
28
28
  TabsTrigger,
29
29
  Textarea,
30
30
  UncheckMark
31
- } from "../chunk-CXBN42TF.mjs";
31
+ } from "../chunk-7LAUVLVZ.mjs";
32
32
  import {
33
33
  Sheet,
34
34
  SheetClose,
@@ -40,7 +40,7 @@ import {
40
40
  SheetPortal,
41
41
  SheetTitle,
42
42
  SheetTrigger
43
- } from "../chunk-MH5K6NEO.mjs";
43
+ } from "../chunk-TKSAYWDH.mjs";
44
44
  import {
45
45
  Button,
46
46
  Card,
@@ -74,7 +74,7 @@ import {
74
74
  buttonVariants,
75
75
  calculateLuminance,
76
76
  cn
77
- } from "../chunk-HOE4FCIF.mjs";
77
+ } from "../chunk-DGOT2FVH.mjs";
78
78
  import {
79
79
  __require
80
80
  } from "../chunk-4OOSUQZG.mjs";
@@ -1577,46 +1577,55 @@ var Combobox = React13.forwardRef(
1577
1577
  }
1578
1578
  ),
1579
1579
  /* @__PURE__ */ React13.createElement(CommandEmpty, null, ((_c = props.texts) == null ? void 0 : _c.noItems) || "No items found."),
1580
- /* @__PURE__ */ React13.createElement(CommandList, null, /* @__PURE__ */ React13.createElement(CommandGroup, { className: "hawa-max-h-[200px] hawa-overflow-y-scroll" }, data.map((item, i) => /* @__PURE__ */ React13.createElement(
1581
- CommandItem,
1580
+ /* @__PURE__ */ React13.createElement(CommandList, null, /* @__PURE__ */ React13.createElement(
1581
+ CommandGroup,
1582
1582
  {
1583
- key: i,
1584
- onSelect: () => {
1585
- const newValue = getProperty(item, valueKey);
1586
- setValue(
1587
- newValue === value ? "" : newValue
1588
- );
1589
- if (props.onChange) {
1590
- props.onChange(
1583
+ className: cn(
1584
+ "hawa-max-h-[200px]",
1585
+ data.length > 0 && "hawa-overflow-y-scroll"
1586
+ )
1587
+ },
1588
+ data.map((item, i) => /* @__PURE__ */ React13.createElement(
1589
+ CommandItem,
1590
+ {
1591
+ key: i,
1592
+ onSelect: () => {
1593
+ const newValue = getProperty(item, valueKey);
1594
+ setValue(
1591
1595
  newValue === value ? "" : newValue
1592
1596
  );
1597
+ if (props.onChange) {
1598
+ props.onChange(
1599
+ newValue === value ? "" : newValue
1600
+ );
1601
+ }
1602
+ setOpen(false);
1593
1603
  }
1594
- setOpen(false);
1595
- }
1596
- },
1597
- /* @__PURE__ */ React13.createElement(
1598
- "svg",
1599
- {
1600
- "aria-label": "Check Icon",
1601
- xmlns: "http://www.w3.org/2000/svg",
1602
- width: "24",
1603
- height: "24",
1604
- viewBox: "0 0 24 24",
1605
- fill: "none",
1606
- stroke: "currentColor",
1607
- strokeWidth: "2",
1608
- strokeLinecap: "round",
1609
- strokeLinejoin: "round",
1610
- className: cn(
1611
- "hawa-icon",
1612
- value === getProperty(item, valueKey) ? "hawa-opacity-100" : "hawa-opacity-0"
1613
- ),
1614
- style: { marginInlineEnd: "0.5rem" }
1615
1604
  },
1616
- /* @__PURE__ */ React13.createElement("polyline", { points: "20 6 9 17 4 12" })
1617
- ),
1618
- renderOption ? renderOption(item) : getProperty(item, labelKey)
1619
- ))))
1605
+ /* @__PURE__ */ React13.createElement(
1606
+ "svg",
1607
+ {
1608
+ "aria-label": "Check Icon",
1609
+ xmlns: "http://www.w3.org/2000/svg",
1610
+ width: "24",
1611
+ height: "24",
1612
+ viewBox: "0 0 24 24",
1613
+ fill: "none",
1614
+ stroke: "currentColor",
1615
+ strokeWidth: "2",
1616
+ strokeLinecap: "round",
1617
+ strokeLinejoin: "round",
1618
+ className: cn(
1619
+ "hawa-icon",
1620
+ value === getProperty(item, valueKey) ? "hawa-opacity-100" : "hawa-opacity-0"
1621
+ ),
1622
+ style: { marginInlineEnd: "0.5rem" }
1623
+ },
1624
+ /* @__PURE__ */ React13.createElement("polyline", { points: "20 6 9 17 4 12" })
1625
+ ),
1626
+ renderOption ? renderOption(item) : getProperty(item, labelKey)
1627
+ ))
1628
+ ))
1620
1629
  )
1621
1630
  ))
1622
1631
  );
package/dist/index.d.mts CHANGED
@@ -149,10 +149,13 @@ type MenuItemType = {
149
149
  slug?: string;
150
150
  end?: any;
151
151
  presist?: boolean;
152
- itemType?: "separator" | "label" | "custom";
152
+ itemType?: "separator" | "label" | "custom" | "radio";
153
153
  action?: () => void;
154
154
  highlighted?: boolean;
155
155
  subitems?: SubItem$1[];
156
+ options?: RadioOptionType[];
157
+ currentOption?: string;
158
+ onOptionChange?: (value: string) => void;
156
159
  disabled?: boolean;
157
160
  onMiddleClick?: (e: any) => void;
158
161
  onClick?: any;
@@ -180,10 +183,7 @@ interface DropdownMenuRadioProps {
180
183
  trigger?: React$1.ReactNode;
181
184
  side?: ExtendedDropdownMenuContentProps["side"];
182
185
  align?: ExtendedDropdownMenuContentProps["align"];
183
- options: {
184
- label?: any;
185
- value: string;
186
- }[];
186
+ options: RadioOptionType[];
187
187
  value: string;
188
188
  onValueChange: any;
189
189
  label?: string;
package/dist/index.d.ts CHANGED
@@ -149,10 +149,13 @@ type MenuItemType = {
149
149
  slug?: string;
150
150
  end?: any;
151
151
  presist?: boolean;
152
- itemType?: "separator" | "label" | "custom";
152
+ itemType?: "separator" | "label" | "custom" | "radio";
153
153
  action?: () => void;
154
154
  highlighted?: boolean;
155
155
  subitems?: SubItem$1[];
156
+ options?: RadioOptionType[];
157
+ currentOption?: string;
158
+ onOptionChange?: (value: string) => void;
156
159
  disabled?: boolean;
157
160
  onMiddleClick?: (e: any) => void;
158
161
  onClick?: any;
@@ -180,10 +183,7 @@ interface DropdownMenuRadioProps {
180
183
  trigger?: React$1.ReactNode;
181
184
  side?: ExtendedDropdownMenuContentProps["side"];
182
185
  align?: ExtendedDropdownMenuContentProps["align"];
183
- options: {
184
- label?: any;
185
- value: string;
186
- }[];
186
+ options: RadioOptionType[];
187
187
  value: string;
188
188
  onValueChange: any;
189
189
  label?: string;
package/dist/index.js CHANGED
@@ -892,6 +892,9 @@ var DropdownMenu = ({
892
892
  default: "hawa-px-2 hawa-py-3 ",
893
893
  sm: "hawa-text-xs hawa-px-1.5 hawa-py-1.5 "
894
894
  };
895
+ let [values, setValues] = React5.useState(
896
+ items.map((item) => item.currentOption)
897
+ );
895
898
  return /* @__PURE__ */ React5.createElement(
896
899
  DropdownMenuRoot,
897
900
  {
@@ -919,11 +922,38 @@ var DropdownMenu = ({
919
922
  },
920
923
  header && header,
921
924
  items && items.map((item, index) => {
925
+ var _a;
922
926
  const ItemLinkComponent = item.slug ? LinkComponent : "a";
923
927
  if (item.itemType === "separator") {
924
928
  return /* @__PURE__ */ React5.createElement(DropdownMenuSeparator, { key: index });
925
929
  } else if (item.itemType === "label") {
926
930
  return /* @__PURE__ */ React5.createElement(DropdownMenuLabel, { key: index }, item.label);
931
+ } else if (item.itemType === "radio") {
932
+ let dd = item.currentOption;
933
+ return /* @__PURE__ */ React5.createElement(DropdownMenuSub, { key: index }, /* @__PURE__ */ React5.createElement(
934
+ DropdownMenuSubTrigger,
935
+ {
936
+ dir: direction,
937
+ className: cn(sizeStyles2[size])
938
+ },
939
+ item.icon && item.icon,
940
+ item.label && item.label
941
+ ), /* @__PURE__ */ React5.createElement(DropdownMenuSubContent, null, /* @__PURE__ */ React5.createElement(
942
+ DropdownMenuRadioGroup,
943
+ {
944
+ value: values[index],
945
+ onValueChange: (e) => {
946
+ let newValues = [...values];
947
+ newValues[index] = e;
948
+ setValues(newValues);
949
+ console.log("changing to ", e);
950
+ if (item.onOptionChange) {
951
+ item.onOptionChange(e);
952
+ }
953
+ }
954
+ },
955
+ (_a = item.options) == null ? void 0 : _a.map((opt, i) => /* @__PURE__ */ React5.createElement(DropdownMenuRadioItem, { key: i, value: opt.value }, opt.label))
956
+ )));
927
957
  } else if (item.itemType === "custom") {
928
958
  return /* @__PURE__ */ React5.createElement("div", { key: index }, item.content);
929
959
  } else {
@@ -3771,46 +3801,55 @@ var Combobox = React27.forwardRef(
3771
3801
  }
3772
3802
  ),
3773
3803
  /* @__PURE__ */ React27.createElement(CommandEmpty, null, ((_c = props.texts) == null ? void 0 : _c.noItems) || "No items found."),
3774
- /* @__PURE__ */ React27.createElement(CommandList, null, /* @__PURE__ */ React27.createElement(CommandGroup, { className: "hawa-max-h-[200px] hawa-overflow-y-scroll" }, data.map((item, i) => /* @__PURE__ */ React27.createElement(
3775
- CommandItem,
3804
+ /* @__PURE__ */ React27.createElement(CommandList, null, /* @__PURE__ */ React27.createElement(
3805
+ CommandGroup,
3776
3806
  {
3777
- key: i,
3778
- onSelect: () => {
3779
- const newValue = getProperty(item, valueKey);
3780
- setValue(
3781
- newValue === value ? "" : newValue
3782
- );
3783
- if (props.onChange) {
3784
- props.onChange(
3807
+ className: cn(
3808
+ "hawa-max-h-[200px]",
3809
+ data.length > 0 && "hawa-overflow-y-scroll"
3810
+ )
3811
+ },
3812
+ data.map((item, i) => /* @__PURE__ */ React27.createElement(
3813
+ CommandItem,
3814
+ {
3815
+ key: i,
3816
+ onSelect: () => {
3817
+ const newValue = getProperty(item, valueKey);
3818
+ setValue(
3785
3819
  newValue === value ? "" : newValue
3786
3820
  );
3821
+ if (props.onChange) {
3822
+ props.onChange(
3823
+ newValue === value ? "" : newValue
3824
+ );
3825
+ }
3826
+ setOpen(false);
3787
3827
  }
3788
- setOpen(false);
3789
- }
3790
- },
3791
- /* @__PURE__ */ React27.createElement(
3792
- "svg",
3793
- {
3794
- "aria-label": "Check Icon",
3795
- xmlns: "http://www.w3.org/2000/svg",
3796
- width: "24",
3797
- height: "24",
3798
- viewBox: "0 0 24 24",
3799
- fill: "none",
3800
- stroke: "currentColor",
3801
- strokeWidth: "2",
3802
- strokeLinecap: "round",
3803
- strokeLinejoin: "round",
3804
- className: cn(
3805
- "hawa-icon",
3806
- value === getProperty(item, valueKey) ? "hawa-opacity-100" : "hawa-opacity-0"
3807
- ),
3808
- style: { marginInlineEnd: "0.5rem" }
3809
3828
  },
3810
- /* @__PURE__ */ React27.createElement("polyline", { points: "20 6 9 17 4 12" })
3811
- ),
3812
- renderOption ? renderOption(item) : getProperty(item, labelKey)
3813
- ))))
3829
+ /* @__PURE__ */ React27.createElement(
3830
+ "svg",
3831
+ {
3832
+ "aria-label": "Check Icon",
3833
+ xmlns: "http://www.w3.org/2000/svg",
3834
+ width: "24",
3835
+ height: "24",
3836
+ viewBox: "0 0 24 24",
3837
+ fill: "none",
3838
+ stroke: "currentColor",
3839
+ strokeWidth: "2",
3840
+ strokeLinecap: "round",
3841
+ strokeLinejoin: "round",
3842
+ className: cn(
3843
+ "hawa-icon",
3844
+ value === getProperty(item, valueKey) ? "hawa-opacity-100" : "hawa-opacity-0"
3845
+ ),
3846
+ style: { marginInlineEnd: "0.5rem" }
3847
+ },
3848
+ /* @__PURE__ */ React27.createElement("polyline", { points: "20 6 9 17 4 12" })
3849
+ ),
3850
+ renderOption ? renderOption(item) : getProperty(item, labelKey)
3851
+ ))
3852
+ ))
3814
3853
  )
3815
3854
  ))
3816
3855
  );