@sikka/hawa 0.24.3-next → 0.24.5-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/accordion/index.d.mts +1 -2
- package/dist/accordion/index.d.ts +1 -2
- package/dist/accordion/index.mjs +219 -7
- package/dist/alert/index.d.mts +1 -1
- package/dist/alert/index.d.ts +1 -1
- package/dist/appLayout/index.d.mts +126 -0
- package/dist/appLayout/index.d.ts +126 -0
- package/dist/appLayout/index.js +1325 -0
- package/dist/appLayout/index.mjs +1285 -0
- package/dist/appMenubar/index.d.mts +33 -0
- package/dist/appMenubar/index.d.ts +33 -0
- package/dist/appMenubar/index.js +281 -0
- package/dist/appMenubar/index.mjs +224 -0
- package/dist/appTabs/index.d.mts +18 -0
- package/dist/appTabs/index.d.ts +18 -0
- package/dist/appTabs/index.js +92 -0
- package/dist/appTabs/index.mjs +50 -0
- package/dist/appTopbar/index.d.mts +44 -0
- package/dist/appTopbar/index.d.ts +44 -0
- package/dist/appTopbar/index.js +483 -0
- package/dist/appTopbar/index.mjs +441 -0
- package/dist/avatar/index.d.mts +5 -4
- package/dist/avatar/index.d.ts +5 -4
- package/dist/backToTop/index.mjs +353 -3
- package/dist/badge/index.d.mts +2 -2
- package/dist/badge/index.d.ts +2 -2
- package/dist/checkbox/index.d.mts +1 -2
- package/dist/checkbox/index.d.ts +1 -2
- package/dist/chip/index.d.mts +36 -2
- package/dist/chip/index.d.ts +36 -2
- package/dist/chip/index.mjs +83 -3
- package/dist/chunk-62GI5F2P.mjs +442 -0
- package/dist/chunk-7NCNPRCL.mjs +120 -0
- package/dist/{chunk-TNAHW35O.mjs → chunk-C2UYTGUD.mjs} +8 -4
- package/dist/{chunk-26FHSPJI.mjs → chunk-DGWAHQRX.mjs} +1 -101
- package/dist/chunk-LRLLDOQZ.mjs +178 -0
- package/dist/chunk-ND4BWUKH.mjs +34 -0
- package/dist/codeBlock/index.mjs +684 -310
- package/dist/colorPicker/index.d.mts +2 -1
- package/dist/colorPicker/index.d.ts +2 -1
- package/dist/colorPicker/index.mjs +2 -167
- package/dist/combobox/index.d.mts +9 -1
- package/dist/combobox/index.d.ts +9 -1
- package/dist/combobox/index.mjs +61 -393
- package/dist/command/index.mjs +10 -425
- package/dist/commonTypes-3J1E3b61.d.mts +6 -0
- package/dist/commonTypes-3J1E3b61.d.ts +6 -0
- package/dist/commonTypes-GhKAraJw.d.mts +4 -0
- package/dist/commonTypes-GhKAraJw.d.ts +4 -0
- package/dist/commonTypes-LrR8QrYP.d.mts +5 -0
- package/dist/commonTypes-LrR8QrYP.d.ts +5 -0
- package/dist/commonTypes-WPhcN3Vr.d.mts +5 -0
- package/dist/commonTypes-WPhcN3Vr.d.ts +5 -0
- package/dist/commonTypes-ko_NGEoT.d.mts +3 -0
- package/dist/commonTypes-ko_NGEoT.d.ts +3 -0
- package/dist/copyrights/index.d.mts +17 -0
- package/dist/copyrights/index.d.ts +17 -0
- package/dist/copyrights/index.js +45 -0
- package/dist/copyrights/index.mjs +8 -0
- package/dist/count/index.d.mts +11 -0
- package/dist/count/index.d.ts +11 -0
- package/dist/count/index.js +45 -0
- package/dist/count/index.mjs +8 -0
- package/dist/dataTable/index.d.mts +1 -1
- package/dist/dataTable/index.d.ts +1 -1
- package/dist/destroyableCard/index.d.mts +1 -1
- package/dist/destroyableCard/index.d.ts +1 -1
- package/dist/dialog/index.d.mts +1 -1
- package/dist/dialog/index.d.ts +1 -1
- package/dist/docsLayout/index.d.mts +37 -0
- package/dist/docsLayout/index.d.ts +37 -0
- package/dist/docsLayout/index.js +926 -0
- package/dist/docsLayout/index.mjs +886 -0
- package/dist/docsSidebar/index.d.mts +11 -0
- package/dist/docsSidebar/index.d.ts +11 -0
- package/dist/docsSidebar/index.js +111 -0
- package/dist/docsSidebar/index.mjs +69 -0
- package/dist/index.d.mts +11 -4
- package/dist/index.d.ts +11 -4
- package/dist/index.js +44 -35
- package/dist/index.mjs +44 -35
- package/dist/input/index.d.mts +2 -9
- package/dist/input/index.d.ts +2 -9
- package/dist/input/index.mjs +14 -98
- package/dist/interfaceSettings/index.d.mts +1 -1
- package/dist/interfaceSettings/index.d.ts +1 -1
- package/dist/interfaceSettings/index.mjs +24 -110
- package/dist/label/index.d.mts +1 -1
- package/dist/label/index.d.ts +1 -1
- package/dist/label/index.mjs +2 -87
- package/dist/layout/index.d.mts +11 -4
- package/dist/layout/index.d.ts +11 -4
- package/dist/layout/index.js +47 -38
- package/dist/layout/index.mjs +44 -35
- package/dist/navbar/index.d.mts +17 -0
- package/dist/navbar/index.d.ts +17 -0
- package/dist/navbar/index.js +166 -0
- package/dist/navbar/index.mjs +126 -0
- package/dist/pagination/index.d.mts +1 -1
- package/dist/pagination/index.d.ts +1 -1
- package/dist/passwordInput/index.mjs +27 -137
- package/dist/phoneInput/index.mjs +19 -129
- package/dist/radio/index.d.mts +1 -4
- package/dist/radio/index.d.ts +1 -4
- package/dist/scrollArea/index.d.mts +1 -1
- package/dist/scrollArea/index.d.ts +1 -1
- package/dist/select/index.d.mts +1 -1
- package/dist/select/index.d.ts +1 -1
- package/dist/separator/index.d.mts +1 -1
- package/dist/separator/index.d.ts +1 -1
- package/dist/sidebar/index.d.mts +48 -0
- package/dist/sidebar/index.d.ts +48 -0
- package/dist/sidebar/index.js +341 -0
- package/dist/sidebar/index.mjs +298 -0
- package/dist/simpleTable/index.d.mts +4 -3
- package/dist/simpleTable/index.d.ts +4 -3
- package/dist/simpleTable/index.mjs +21 -45
- package/dist/skeleton/index.d.mts +3 -3
- package/dist/skeleton/index.d.ts +3 -3
- package/dist/skeleton/index.mjs +3 -29
- package/dist/sortButton/index.mjs +9 -260
- package/dist/splitButton/index.d.mts +4 -3
- package/dist/splitButton/index.d.ts +4 -3
- package/dist/splitButton/index.mjs +10 -259
- package/dist/stats/index.d.mts +19 -0
- package/dist/stats/index.d.ts +19 -0
- package/dist/stats/index.js +191 -0
- package/dist/stats/index.mjs +154 -0
- package/dist/stopPropagationWrapper/index.d.mts +2 -2
- package/dist/stopPropagationWrapper/index.d.ts +2 -2
- package/dist/switch/index.d.mts +2 -1
- package/dist/switch/index.d.ts +2 -1
- package/dist/tabs/index.d.mts +19 -1
- package/dist/tabs/index.d.ts +19 -1
- package/dist/tabs/index.mjs +94 -14
- package/dist/textarea/index.d.mts +8 -1
- package/dist/textarea/index.d.ts +8 -1
- package/dist/textarea/index.mjs +92 -8
- package/dist/toast/index.d.mts +1 -1
- package/dist/toast/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/Label-fkQ4ebuH.d.mts +0 -12
- package/dist/Label-fkQ4ebuH.d.ts +0 -12
- package/dist/chunk-72HYR6WB.mjs +0 -88
- package/dist/chunk-JYSC6GKM.mjs +0 -229
- package/dist/commonTypes-3k5cNB1s.d.mts +0 -4
- package/dist/commonTypes-3k5cNB1s.d.ts +0 -4
- package/dist/commonTypes-N7XOVCit.d.mts +0 -5
- package/dist/commonTypes-N7XOVCit.d.ts +0 -5
- package/dist/index-DUZFcPRO.d.mts +0 -38
- package/dist/index-DUZFcPRO.d.ts +0 -38
@@ -0,0 +1,48 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { D as DirectionType } from '../commonTypes-ko_NGEoT.mjs';
|
3
|
+
|
4
|
+
type ChipColors = "green" | "blue" | "red" | "yellow" | "orange" | "purple" | "cyan" | "hyper" | "oceanic";
|
5
|
+
|
6
|
+
type AppSidebarItemProps = {
|
7
|
+
value: string;
|
8
|
+
slug?: string;
|
9
|
+
label: string;
|
10
|
+
badge?: {
|
11
|
+
label: string;
|
12
|
+
color: ChipColors;
|
13
|
+
};
|
14
|
+
icon?: any;
|
15
|
+
subitems?: SubItem[];
|
16
|
+
onClick?: (e: React.MouseEvent) => void;
|
17
|
+
onMouseDown?: (e: React.MouseEvent) => void;
|
18
|
+
};
|
19
|
+
type SubItem = {
|
20
|
+
value: string;
|
21
|
+
label: string;
|
22
|
+
slug?: string;
|
23
|
+
icon?: any;
|
24
|
+
onMouseDown?: (e: React.MouseEvent) => void;
|
25
|
+
onClick?: (e: React.MouseEvent) => void;
|
26
|
+
};
|
27
|
+
interface SidebarGroupProps {
|
28
|
+
title?: string;
|
29
|
+
items: AppSidebarItemProps[];
|
30
|
+
openedItem?: any;
|
31
|
+
setOpenedItem?: any;
|
32
|
+
selectedItem?: any;
|
33
|
+
isOpen?: boolean;
|
34
|
+
onItemClick?: (value: string[]) => void;
|
35
|
+
onSubItemClick?: (values: string[]) => void;
|
36
|
+
direction?: DirectionType;
|
37
|
+
}
|
38
|
+
declare const SidebarGroup: React.FC<SidebarGroupProps>;
|
39
|
+
declare const SidebarItem: React.FC<{
|
40
|
+
item: AppSidebarItemProps;
|
41
|
+
selectedItem?: any;
|
42
|
+
direction?: DirectionType;
|
43
|
+
onItemClick?: (value: string[]) => void;
|
44
|
+
onSubItemClick?: (values: string[]) => void;
|
45
|
+
isOpen?: boolean;
|
46
|
+
}>;
|
47
|
+
|
48
|
+
export { type AppSidebarItemProps, SidebarGroup, SidebarItem };
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { D as DirectionType } from '../commonTypes-ko_NGEoT.js';
|
3
|
+
|
4
|
+
type ChipColors = "green" | "blue" | "red" | "yellow" | "orange" | "purple" | "cyan" | "hyper" | "oceanic";
|
5
|
+
|
6
|
+
type AppSidebarItemProps = {
|
7
|
+
value: string;
|
8
|
+
slug?: string;
|
9
|
+
label: string;
|
10
|
+
badge?: {
|
11
|
+
label: string;
|
12
|
+
color: ChipColors;
|
13
|
+
};
|
14
|
+
icon?: any;
|
15
|
+
subitems?: SubItem[];
|
16
|
+
onClick?: (e: React.MouseEvent) => void;
|
17
|
+
onMouseDown?: (e: React.MouseEvent) => void;
|
18
|
+
};
|
19
|
+
type SubItem = {
|
20
|
+
value: string;
|
21
|
+
label: string;
|
22
|
+
slug?: string;
|
23
|
+
icon?: any;
|
24
|
+
onMouseDown?: (e: React.MouseEvent) => void;
|
25
|
+
onClick?: (e: React.MouseEvent) => void;
|
26
|
+
};
|
27
|
+
interface SidebarGroupProps {
|
28
|
+
title?: string;
|
29
|
+
items: AppSidebarItemProps[];
|
30
|
+
openedItem?: any;
|
31
|
+
setOpenedItem?: any;
|
32
|
+
selectedItem?: any;
|
33
|
+
isOpen?: boolean;
|
34
|
+
onItemClick?: (value: string[]) => void;
|
35
|
+
onSubItemClick?: (values: string[]) => void;
|
36
|
+
direction?: DirectionType;
|
37
|
+
}
|
38
|
+
declare const SidebarGroup: React.FC<SidebarGroupProps>;
|
39
|
+
declare const SidebarItem: React.FC<{
|
40
|
+
item: AppSidebarItemProps;
|
41
|
+
selectedItem?: any;
|
42
|
+
direction?: DirectionType;
|
43
|
+
onItemClick?: (value: string[]) => void;
|
44
|
+
onSubItemClick?: (values: string[]) => void;
|
45
|
+
isOpen?: boolean;
|
46
|
+
}>;
|
47
|
+
|
48
|
+
export { type AppSidebarItemProps, SidebarGroup, SidebarItem };
|
@@ -0,0 +1,341 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __create = Object.create;
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
+
var __export = (target, all) => {
|
9
|
+
for (var name in all)
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
11
|
+
};
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
14
|
+
for (let key of __getOwnPropNames(from))
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
+
}
|
18
|
+
return to;
|
19
|
+
};
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
+
mod
|
27
|
+
));
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
+
|
30
|
+
// components/layout/sidebar/index.ts
|
31
|
+
var sidebar_exports = {};
|
32
|
+
__export(sidebar_exports, {
|
33
|
+
SidebarGroup: () => SidebarGroup,
|
34
|
+
SidebarItem: () => SidebarItem
|
35
|
+
});
|
36
|
+
module.exports = __toCommonJS(sidebar_exports);
|
37
|
+
|
38
|
+
// components/layout/sidebar/Sidebar.tsx
|
39
|
+
var React2 = __toESM(require("react"));
|
40
|
+
var AccordionPrimitive = __toESM(require("@radix-ui/react-accordion"));
|
41
|
+
|
42
|
+
// components/elements/chip/Chip.tsx
|
43
|
+
var import_react = __toESM(require("react"));
|
44
|
+
|
45
|
+
// components/util.ts
|
46
|
+
var import_clsx = require("clsx");
|
47
|
+
var import_tailwind_merge = require("tailwind-merge");
|
48
|
+
function cn(...inputs) {
|
49
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
50
|
+
}
|
51
|
+
|
52
|
+
// components/elements/chip/Chip.tsx
|
53
|
+
var Chip = import_react.default.forwardRef(
|
54
|
+
({
|
55
|
+
label,
|
56
|
+
size = "normal",
|
57
|
+
icon,
|
58
|
+
color,
|
59
|
+
radius = "inherit",
|
60
|
+
dotType,
|
61
|
+
...rest
|
62
|
+
}, ref) => {
|
63
|
+
let defaultStyles = "hawa-flex hawa-flex-row hawa-w-fit hawa-gap-1 hawa-items-center hawa-px-2.5 hawa-py-1 hawa-font-bold ";
|
64
|
+
let radiusStyles = {
|
65
|
+
inherit: " hawa-rounded",
|
66
|
+
full: "hawa-rounded-full",
|
67
|
+
none: "hawa-rounded-none"
|
68
|
+
};
|
69
|
+
let sizeStyles = {
|
70
|
+
small: "hawa-h-[15px] hawa-leading-4 hawa-px-0 hawa-py-0 hawa-text-[9px] hawa-gap-0.5 ",
|
71
|
+
normal: "hawa-h-fit hawa-text-xs",
|
72
|
+
large: "hawa-text-base"
|
73
|
+
};
|
74
|
+
let dotStyles = {
|
75
|
+
small: "hawa-flex hawa-h-1 hawa-w-1 hawa-rounded-full",
|
76
|
+
normal: "hawa-flex hawa-h-2 hawa-w-2 hawa-rounded-full",
|
77
|
+
large: "hawa-flex hawa-h-3 hawa-w-3 hawa-rounded-full"
|
78
|
+
};
|
79
|
+
let dotTypeStyles = {
|
80
|
+
available: "hawa-bg-green-500",
|
81
|
+
unavailable: "hawa-bg-red-500"
|
82
|
+
};
|
83
|
+
let colorStyles = {
|
84
|
+
green: "hawa-bg-green-100 hawa-text-green-500 dark:hawa-bg-green-400 dark:hawa-text-green-800",
|
85
|
+
blue: "hawa-bg-blue-100 hawa-text-blue-500 dark:hawa-bg-blue-400 dark:hawa-text-blue-100",
|
86
|
+
red: "hawa-bg-red-100 hawa-text-red-500 dark:hawa-bg-red-400 dark:hawa-text-red-100",
|
87
|
+
yellow: "hawa-bg-yellow-100 hawa-text-yellow-600 dark:hawa-bg-yellow-400 dark:hawa-text-yellow-800",
|
88
|
+
orange: "hawa-bg-orange-100 hawa-text-orange-500 dark:hawa-bg-orange-400 dark:hawa-text-orange-100",
|
89
|
+
purple: "hawa-bg-purple-100 hawa-text-purple-500 dark:hawa-bg-purple-400 dark:hawa-text-purple-100",
|
90
|
+
cyan: "hawa-bg-cyan-100 hawa-text-cyan-800 dark:hawa-bg-cyan-400 dark:hawa-text-cyan-800",
|
91
|
+
hyper: "hawa-text-white hawa-bg-gradient-to-tl hawa-from-pink-500 hawa-via-red-500 hawa-to-yellow-500 ",
|
92
|
+
oceanic: "hawa-text-white hawa-bg-gradient-to-bl hawa-from-green-300 hawa-via-blue-500 hawa-to-purple-600"
|
93
|
+
};
|
94
|
+
if (label) {
|
95
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
96
|
+
"span",
|
97
|
+
{
|
98
|
+
...rest,
|
99
|
+
ref,
|
100
|
+
className: cn(
|
101
|
+
defaultStyles,
|
102
|
+
sizeStyles[size],
|
103
|
+
radiusStyles[radius],
|
104
|
+
color ? colorStyles[color] : "hawa-border hawa-bg-none"
|
105
|
+
)
|
106
|
+
},
|
107
|
+
dotType && /* @__PURE__ */ import_react.default.createElement(
|
108
|
+
"span",
|
109
|
+
{
|
110
|
+
className: cn(dotStyles[size], dotTypeStyles[dotType])
|
111
|
+
}
|
112
|
+
),
|
113
|
+
icon && icon,
|
114
|
+
label
|
115
|
+
);
|
116
|
+
} else {
|
117
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
118
|
+
"span",
|
119
|
+
{
|
120
|
+
...rest,
|
121
|
+
ref,
|
122
|
+
className: cn(
|
123
|
+
"hawa-h-2 hawa-w-2 hawa-rounded-full",
|
124
|
+
color ? colorStyles[color] : "hawa-border hawa-bg-none"
|
125
|
+
)
|
126
|
+
}
|
127
|
+
);
|
128
|
+
}
|
129
|
+
}
|
130
|
+
);
|
131
|
+
|
132
|
+
// components/layout/sidebar/Sidebar.tsx
|
133
|
+
var Accordion = AccordionPrimitive.Root;
|
134
|
+
var triggerStyles = "hawa-flex hawa-flex-1 hawa-items-center hawa-duration-75 hawa-select-none hawa-cursor-pointer hawa-rounded hawa-justify-between hawa-p-2 hawa-px-3 hawa-font-medium hawa-transition-all [&[data-state=open]>svg]:hawa--rotate-90";
|
135
|
+
var AccordionItem = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React2.createElement(AccordionPrimitive.Item, { ref, className: cn(className), ...props }));
|
136
|
+
AccordionItem.displayName = "AccordionItem";
|
137
|
+
var AccordionTrigger = React2.forwardRef(({ className, showArrow, children, ...props }, ref) => /* @__PURE__ */ React2.createElement(AccordionPrimitive.Header, { className: "flex" }, /* @__PURE__ */ React2.createElement(
|
138
|
+
AccordionPrimitive.Trigger,
|
139
|
+
{
|
140
|
+
ref,
|
141
|
+
className: cn(triggerStyles, className),
|
142
|
+
...props
|
143
|
+
},
|
144
|
+
children,
|
145
|
+
showArrow && /* @__PURE__ */ React2.createElement(
|
146
|
+
"svg",
|
147
|
+
{
|
148
|
+
"aria-label": "Chevron Right Icon",
|
149
|
+
stroke: "currentColor",
|
150
|
+
fill: "currentColor",
|
151
|
+
viewBox: "0 0 16 16",
|
152
|
+
height: "1em",
|
153
|
+
width: "1em",
|
154
|
+
className: "hawa-icon hawa-shrink-0 hawa-rotate-90 hawa-transition-transform hawa-duration-200"
|
155
|
+
},
|
156
|
+
/* @__PURE__ */ React2.createElement("path", { d: "M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z" })
|
157
|
+
)
|
158
|
+
)));
|
159
|
+
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
160
|
+
var AccordionContent = React2.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ React2.createElement(
|
161
|
+
AccordionPrimitive.Content,
|
162
|
+
{
|
163
|
+
ref,
|
164
|
+
className: cn(
|
165
|
+
"hawa-overflow-hidden hawa-text-sm hawa-transition-all data-[state=closed]:hawa-animate-accordion-up data-[state=open]:hawa-animate-accordion-down",
|
166
|
+
className
|
167
|
+
),
|
168
|
+
...props
|
169
|
+
},
|
170
|
+
/* @__PURE__ */ React2.createElement("div", null, children)
|
171
|
+
));
|
172
|
+
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
173
|
+
var SidebarGroup = ({
|
174
|
+
title,
|
175
|
+
items,
|
176
|
+
selectedItem,
|
177
|
+
openedItem,
|
178
|
+
setOpenedItem,
|
179
|
+
onItemClick,
|
180
|
+
onSubItemClick,
|
181
|
+
direction,
|
182
|
+
isOpen
|
183
|
+
}) => {
|
184
|
+
return /* @__PURE__ */ React2.createElement("div", { className: "hawa-m-2" }, title && /* @__PURE__ */ React2.createElement("h3", { className: "hawa-mb-1 hawa-font-bold" }, title), /* @__PURE__ */ React2.createElement("ul", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React2.createElement(
|
185
|
+
Accordion,
|
186
|
+
{
|
187
|
+
value: openedItem,
|
188
|
+
type: "single",
|
189
|
+
onValueChange: (e) => {
|
190
|
+
setOpenedItem(e);
|
191
|
+
},
|
192
|
+
collapsible: true,
|
193
|
+
className: "hawa-flex hawa-flex-col hawa-gap-1"
|
194
|
+
},
|
195
|
+
items.map((item, idx) => /* @__PURE__ */ React2.createElement(
|
196
|
+
SidebarItem,
|
197
|
+
{
|
198
|
+
isOpen,
|
199
|
+
selectedItem,
|
200
|
+
key: idx,
|
201
|
+
direction,
|
202
|
+
item,
|
203
|
+
onItemClick,
|
204
|
+
onSubItemClick
|
205
|
+
}
|
206
|
+
))
|
207
|
+
)));
|
208
|
+
};
|
209
|
+
var SidebarItem = ({
|
210
|
+
item,
|
211
|
+
onItemClick,
|
212
|
+
onSubItemClick,
|
213
|
+
direction,
|
214
|
+
isOpen = true,
|
215
|
+
...props
|
216
|
+
}) => {
|
217
|
+
const getSelectedStyle = (value) => {
|
218
|
+
return props.selectedItem === value ? "hawa-bg-primary/90 hawa-text-primary-foreground hawa-cursor-default" : "hover:hawa-bg-primary/10";
|
219
|
+
};
|
220
|
+
if (item.subitems) {
|
221
|
+
return /* @__PURE__ */ React2.createElement(
|
222
|
+
AccordionItem,
|
223
|
+
{
|
224
|
+
value: item.value,
|
225
|
+
className: "hawa-overflow-x-clip ",
|
226
|
+
dir: direction
|
227
|
+
},
|
228
|
+
/* @__PURE__ */ React2.createElement(
|
229
|
+
AccordionTrigger,
|
230
|
+
{
|
231
|
+
className: cn(
|
232
|
+
"hawa-w-full hawa-overflow-x-clip",
|
233
|
+
props.selectedItem === item.value ? "hawa-cursor-default hawa-bg-primary hawa-text-primary-foreground" : "hawa-h-10 hover:hawa-bg-primary/10",
|
234
|
+
item.subitems && item.subitems.some(
|
235
|
+
(subitem) => props.selectedItem === subitem.value
|
236
|
+
) ? "hawa-bg-primary/80 hawa-text-primary-foreground hover:hawa-bg-primary/80" : ""
|
237
|
+
),
|
238
|
+
showArrow: isOpen
|
239
|
+
},
|
240
|
+
/* @__PURE__ */ React2.createElement(
|
241
|
+
"div",
|
242
|
+
{
|
243
|
+
className: cn(
|
244
|
+
"hawa-flex hawa-h-fit hawa-w-fit hawa-flex-row hawa-items-center hawa-gap-2"
|
245
|
+
)
|
246
|
+
},
|
247
|
+
item.icon && item.icon,
|
248
|
+
/* @__PURE__ */ React2.createElement(
|
249
|
+
"span",
|
250
|
+
{
|
251
|
+
className: cn(
|
252
|
+
"hawa-transition-all ",
|
253
|
+
isOpen ? "hawa-opacity-100" : "hawa-opacity-0"
|
254
|
+
)
|
255
|
+
},
|
256
|
+
item.label
|
257
|
+
)
|
258
|
+
)
|
259
|
+
),
|
260
|
+
item.subitems && /* @__PURE__ */ React2.createElement(AccordionContent, { className: "hawa-mt-1 hawa-h-full hawa-rounded" }, /* @__PURE__ */ React2.createElement(
|
261
|
+
"div",
|
262
|
+
{
|
263
|
+
className: cn(
|
264
|
+
"hawa-flex hawa-h-full hawa-flex-col hawa-gap-2 hawa-bg-foreground/5 hawa-p-1"
|
265
|
+
)
|
266
|
+
},
|
267
|
+
item.subitems.map((subitem, idx) => /* @__PURE__ */ React2.createElement(
|
268
|
+
"a",
|
269
|
+
{
|
270
|
+
href: subitem.slug,
|
271
|
+
key: idx,
|
272
|
+
onMouseDown: (e) => {
|
273
|
+
if (subitem.onMouseDown) {
|
274
|
+
subitem.onMouseDown(e);
|
275
|
+
}
|
276
|
+
},
|
277
|
+
onClick: (e) => {
|
278
|
+
e.stopPropagation();
|
279
|
+
if (subitem.onClick) {
|
280
|
+
subitem.onClick(e);
|
281
|
+
}
|
282
|
+
if (onSubItemClick) {
|
283
|
+
onSubItemClick([item.value, subitem.value]);
|
284
|
+
}
|
285
|
+
},
|
286
|
+
className: cn(
|
287
|
+
"hawa-flex hawa-h-full hawa-cursor-pointer hawa-flex-row hawa-items-center hawa-gap-2 hawa-overflow-x-clip hawa-whitespace-nowrap hawa-rounded hawa-p-2 hawa-transition-all",
|
288
|
+
// bg-foreground/10
|
289
|
+
getSelectedStyle(subitem.value)
|
290
|
+
)
|
291
|
+
},
|
292
|
+
subitem.icon && subitem.icon,
|
293
|
+
subitem.label
|
294
|
+
))
|
295
|
+
))
|
296
|
+
);
|
297
|
+
} else {
|
298
|
+
return /* @__PURE__ */ React2.createElement(
|
299
|
+
"a",
|
300
|
+
{
|
301
|
+
href: item.slug,
|
302
|
+
dir: direction,
|
303
|
+
onMouseDown: (e) => {
|
304
|
+
if (item.onMouseDown) {
|
305
|
+
item.onMouseDown(e);
|
306
|
+
}
|
307
|
+
},
|
308
|
+
onClick: (e) => {
|
309
|
+
if (item.onClick) {
|
310
|
+
item.onClick(e);
|
311
|
+
}
|
312
|
+
if (onItemClick) {
|
313
|
+
onItemClick([item.value]);
|
314
|
+
}
|
315
|
+
},
|
316
|
+
className: cn(
|
317
|
+
triggerStyles,
|
318
|
+
getSelectedStyle(item.value),
|
319
|
+
"hawa-overflow-x-clip "
|
320
|
+
)
|
321
|
+
},
|
322
|
+
/* @__PURE__ */ React2.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2" }, item.icon && item.icon, /* @__PURE__ */ React2.createElement(
|
323
|
+
"span",
|
324
|
+
{
|
325
|
+
className: cn(
|
326
|
+
"hawa-flex hawa-flex-row hawa-items-center hawa-gap-2 hawa-whitespace-nowrap hawa-transition-all",
|
327
|
+
isOpen ? "hawa-opacity-100" : "hawa-opacity-0"
|
328
|
+
)
|
329
|
+
},
|
330
|
+
item.label,
|
331
|
+
" ",
|
332
|
+
item.badge && /* @__PURE__ */ React2.createElement(Chip, { label: item.badge.label, color: "hyper", size: "small" })
|
333
|
+
))
|
334
|
+
);
|
335
|
+
}
|
336
|
+
};
|
337
|
+
// Annotate the CommonJS export names for ESM import in node:
|
338
|
+
0 && (module.exports = {
|
339
|
+
SidebarGroup,
|
340
|
+
SidebarItem
|
341
|
+
});
|