@sikka/hawa 0.30.23-next → 0.30.25-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/{DropdownMenu-sSnQc6fT.d.ts → DropdownMenu-o_-MnT5h.d.mts} +6 -6
- package/dist/{DropdownMenu-arqV1gRt.d.mts → DropdownMenu-p-Ha-y2R.d.ts} +6 -6
- package/dist/appLayout/index.d.mts +8 -1
- package/dist/appLayout/index.d.ts +8 -1
- package/dist/appLayout/index.js +31 -0
- package/dist/appLayout/index.js.map +1 -1
- package/dist/appLayout/index.mjs +35 -4
- package/dist/appLayout/index.mjs.map +1 -1
- package/dist/appTopbar/index.d.mts +5 -2
- package/dist/appTopbar/index.d.ts +5 -2
- package/dist/appTopbar/index.js +31 -0
- package/dist/appTopbar/index.js.map +1 -1
- package/dist/appTopbar/index.mjs +31 -0
- package/dist/appTopbar/index.mjs.map +1 -1
- package/dist/blocks/index.d.mts +1 -1
- package/dist/blocks/index.d.ts +1 -1
- package/dist/blocks/index.js +31 -0
- package/dist/blocks/index.mjs +2 -2
- package/dist/blocks/pricing/index.mjs +3 -3
- package/dist/breadcrumb/index.d.mts +7 -5
- package/dist/breadcrumb/index.d.ts +7 -5
- package/dist/breadcrumb/index.js +36 -12
- package/dist/breadcrumb/index.js.map +1 -1
- package/dist/breadcrumb/index.mjs +36 -12
- package/dist/breadcrumb/index.mjs.map +1 -1
- package/dist/{chunk-CXBN42TF.mjs → chunk-7LAUVLVZ.mjs} +1 -1
- package/dist/{chunk-HOE4FCIF.mjs → chunk-DGOT2FVH.mjs} +30 -0
- package/dist/{chunk-MH5K6NEO.mjs → chunk-TKSAYWDH.mjs} +1 -1
- package/dist/combobox/index.js +44 -35
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs +44 -35
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/commonTypes-52DloiYq.d.mts +7 -0
- package/dist/commonTypes-52DloiYq.d.ts +7 -0
- package/dist/dataTable/index.js +31 -0
- package/dist/dataTable/index.js.map +1 -1
- package/dist/dataTable/index.mjs +31 -0
- package/dist/dataTable/index.mjs.map +1 -1
- package/dist/docsLayout/index.d.mts +1 -1
- package/dist/docsLayout/index.d.ts +1 -1
- package/dist/dropdownMenu/index.d.mts +9 -5
- package/dist/dropdownMenu/index.d.ts +9 -5
- package/dist/dropdownMenu/index.js +30 -0
- package/dist/dropdownMenu/index.js.map +1 -1
- package/dist/dropdownMenu/index.mjs +30 -0
- package/dist/dropdownMenu/index.mjs.map +1 -1
- package/dist/elements/index.d.mts +8 -6
- package/dist/elements/index.d.ts +8 -6
- package/dist/elements/index.js +101 -47
- package/dist/elements/index.mjs +74 -50
- package/dist/index.d.mts +12 -10
- package/dist/index.d.ts +12 -10
- package/dist/index.js +101 -47
- package/dist/index.mjs +206 -152
- package/dist/layout/index.d.mts +1 -1
- package/dist/layout/index.d.ts +1 -1
- package/dist/layout/index.js +31 -0
- package/dist/layout/index.mjs +2 -2
- package/dist/splitButton/index.d.mts +8 -1
- package/dist/splitButton/index.d.ts +8 -1
- package/dist/splitButton/index.js +31 -0
- package/dist/splitButton/index.js.map +1 -1
- package/dist/splitButton/index.mjs +31 -0
- package/dist/splitButton/index.mjs.map +1 -1
- package/package.json +1 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
3
|
-
import { D as DirectionType } from './commonTypes-CKtkuNFH.
|
3
|
+
import { a as RadioOptionType, D as DirectionType } from './commonTypes-CKtkuNFH.mjs';
|
4
4
|
|
5
5
|
declare const DropdownMenuRoot: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
6
6
|
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
@@ -53,10 +53,13 @@ type MenuItemType = {
|
|
53
53
|
slug?: string;
|
54
54
|
end?: any;
|
55
55
|
presist?: boolean;
|
56
|
-
itemType?: "separator" | "label" | "custom";
|
56
|
+
itemType?: "separator" | "label" | "custom" | "radio";
|
57
57
|
action?: () => void;
|
58
58
|
highlighted?: boolean;
|
59
59
|
subitems?: SubItem[];
|
60
|
+
options?: RadioOptionType[];
|
61
|
+
currentOption?: string;
|
62
|
+
onOptionChange?: (value: string) => void;
|
60
63
|
disabled?: boolean;
|
61
64
|
onMiddleClick?: (e: any) => void;
|
62
65
|
onClick?: any;
|
@@ -84,10 +87,7 @@ interface DropdownMenuRadioProps {
|
|
84
87
|
trigger?: React.ReactNode;
|
85
88
|
side?: ExtendedDropdownMenuContentProps["side"];
|
86
89
|
align?: ExtendedDropdownMenuContentProps["align"];
|
87
|
-
options:
|
88
|
-
label?: any;
|
89
|
-
value: string;
|
90
|
-
}[];
|
90
|
+
options: RadioOptionType[];
|
91
91
|
value: string;
|
92
92
|
onValueChange: any;
|
93
93
|
label?: string;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
3
|
-
import { D as DirectionType } from './commonTypes-CKtkuNFH.
|
3
|
+
import { a as RadioOptionType, D as DirectionType } from './commonTypes-CKtkuNFH.js';
|
4
4
|
|
5
5
|
declare const DropdownMenuRoot: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
6
6
|
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
@@ -53,10 +53,13 @@ type MenuItemType = {
|
|
53
53
|
slug?: string;
|
54
54
|
end?: any;
|
55
55
|
presist?: boolean;
|
56
|
-
itemType?: "separator" | "label" | "custom";
|
56
|
+
itemType?: "separator" | "label" | "custom" | "radio";
|
57
57
|
action?: () => void;
|
58
58
|
highlighted?: boolean;
|
59
59
|
subitems?: SubItem[];
|
60
|
+
options?: RadioOptionType[];
|
61
|
+
currentOption?: string;
|
62
|
+
onOptionChange?: (value: string) => void;
|
60
63
|
disabled?: boolean;
|
61
64
|
onMiddleClick?: (e: any) => void;
|
62
65
|
onClick?: any;
|
@@ -84,10 +87,7 @@ interface DropdownMenuRadioProps {
|
|
84
87
|
trigger?: React.ReactNode;
|
85
88
|
side?: ExtendedDropdownMenuContentProps["side"];
|
86
89
|
align?: ExtendedDropdownMenuContentProps["align"];
|
87
|
-
options:
|
88
|
-
label?: any;
|
89
|
-
value: string;
|
90
|
-
}[];
|
90
|
+
options: RadioOptionType[];
|
91
91
|
value: string;
|
92
92
|
onValueChange: any;
|
93
93
|
label?: string;
|
@@ -2,6 +2,10 @@ import * as React from 'react';
|
|
2
2
|
import React__default from 'react';
|
3
3
|
|
4
4
|
type DirectionType = "rtl" | "ltr";
|
5
|
+
type RadioOptionType = {
|
6
|
+
label: string;
|
7
|
+
value: string;
|
8
|
+
};
|
5
9
|
|
6
10
|
type SubItem$1 = {
|
7
11
|
label?: string;
|
@@ -23,10 +27,13 @@ type MenuItemType = {
|
|
23
27
|
slug?: string;
|
24
28
|
end?: any;
|
25
29
|
presist?: boolean;
|
26
|
-
itemType?: "separator" | "label" | "custom";
|
30
|
+
itemType?: "separator" | "label" | "custom" | "radio";
|
27
31
|
action?: () => void;
|
28
32
|
highlighted?: boolean;
|
29
33
|
subitems?: SubItem$1[];
|
34
|
+
options?: RadioOptionType[];
|
35
|
+
currentOption?: string;
|
36
|
+
onOptionChange?: (value: string) => void;
|
30
37
|
disabled?: boolean;
|
31
38
|
onMiddleClick?: (e: any) => void;
|
32
39
|
onClick?: any;
|
@@ -2,6 +2,10 @@ import * as React from 'react';
|
|
2
2
|
import React__default from 'react';
|
3
3
|
|
4
4
|
type DirectionType = "rtl" | "ltr";
|
5
|
+
type RadioOptionType = {
|
6
|
+
label: string;
|
7
|
+
value: string;
|
8
|
+
};
|
5
9
|
|
6
10
|
type SubItem$1 = {
|
7
11
|
label?: string;
|
@@ -23,10 +27,13 @@ type MenuItemType = {
|
|
23
27
|
slug?: string;
|
24
28
|
end?: any;
|
25
29
|
presist?: boolean;
|
26
|
-
itemType?: "separator" | "label" | "custom";
|
30
|
+
itemType?: "separator" | "label" | "custom" | "radio";
|
27
31
|
action?: () => void;
|
28
32
|
highlighted?: boolean;
|
29
33
|
subitems?: SubItem$1[];
|
34
|
+
options?: RadioOptionType[];
|
35
|
+
currentOption?: string;
|
36
|
+
onOptionChange?: (value: string) => void;
|
30
37
|
disabled?: boolean;
|
31
38
|
onMiddleClick?: (e: any) => void;
|
32
39
|
onClick?: any;
|
package/dist/appLayout/index.js
CHANGED
@@ -346,6 +346,7 @@ var DropdownMenuRoot = DropdownMenuPrimitive.Root;
|
|
346
346
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
347
347
|
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
348
348
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
349
|
+
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
349
350
|
var DropdownMenuSubTrigger = React3.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ React3.createElement(
|
350
351
|
DropdownMenuPrimitive.SubTrigger,
|
351
352
|
{
|
@@ -550,6 +551,9 @@ var DropdownMenu = ({
|
|
550
551
|
default: "hawa-px-2 hawa-py-3 ",
|
551
552
|
sm: "hawa-text-xs hawa-px-1.5 hawa-py-1.5 "
|
552
553
|
};
|
554
|
+
let [values, setValues] = React3.useState(
|
555
|
+
items.map((item) => item.currentOption)
|
556
|
+
);
|
553
557
|
return /* @__PURE__ */ React3.createElement(
|
554
558
|
DropdownMenuRoot,
|
555
559
|
{
|
@@ -577,11 +581,38 @@ var DropdownMenu = ({
|
|
577
581
|
},
|
578
582
|
header && header,
|
579
583
|
items && items.map((item, index) => {
|
584
|
+
var _a;
|
580
585
|
const ItemLinkComponent = item.slug ? LinkComponent : "a";
|
581
586
|
if (item.itemType === "separator") {
|
582
587
|
return /* @__PURE__ */ React3.createElement(DropdownMenuSeparator, { key: index });
|
583
588
|
} else if (item.itemType === "label") {
|
584
589
|
return /* @__PURE__ */ React3.createElement(DropdownMenuLabel, { key: index }, item.label);
|
590
|
+
} else if (item.itemType === "radio") {
|
591
|
+
let dd = item.currentOption;
|
592
|
+
return /* @__PURE__ */ React3.createElement(DropdownMenuSub, { key: index }, /* @__PURE__ */ React3.createElement(
|
593
|
+
DropdownMenuSubTrigger,
|
594
|
+
{
|
595
|
+
dir: direction,
|
596
|
+
className: cn(sizeStyles[size])
|
597
|
+
},
|
598
|
+
item.icon && item.icon,
|
599
|
+
item.label && item.label
|
600
|
+
), /* @__PURE__ */ React3.createElement(DropdownMenuSubContent, null, /* @__PURE__ */ React3.createElement(
|
601
|
+
DropdownMenuRadioGroup,
|
602
|
+
{
|
603
|
+
value: values[index],
|
604
|
+
onValueChange: (e) => {
|
605
|
+
let newValues = [...values];
|
606
|
+
newValues[index] = e;
|
607
|
+
setValues(newValues);
|
608
|
+
console.log("changing to ", e);
|
609
|
+
if (item.onOptionChange) {
|
610
|
+
item.onOptionChange(e);
|
611
|
+
}
|
612
|
+
}
|
613
|
+
},
|
614
|
+
(_a = item.options) == null ? void 0 : _a.map((opt, i) => /* @__PURE__ */ React3.createElement(DropdownMenuRadioItem, { key: i, value: opt.value }, opt.label))
|
615
|
+
)));
|
585
616
|
} else if (item.itemType === "custom") {
|
586
617
|
return /* @__PURE__ */ React3.createElement("div", { key: index }, item.content);
|
587
618
|
} else {
|