takeat-design-system-ui-kit 1.1.10 → 1.1.11
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/components/CollapsableMenu/index.cjs +280 -318
- package/dist/components/CollapsableMenu/index.cjs.map +1 -1
- package/dist/components/CollapsableMenu/index.css +3 -4
- package/dist/components/CollapsableMenu/index.css.map +1 -1
- package/dist/components/CollapsableMenu/index.d.cts +3 -4
- package/dist/components/CollapsableMenu/index.d.ts +3 -4
- package/dist/components/CollapsableMenu/index.js +272 -304
- package/dist/components/CollapsableMenu/index.js.map +1 -1
- package/dist/components/Image/index.cjs.map +1 -1
- package/dist/components/Image/index.css +2 -2
- package/dist/components/Image/index.css.map +1 -1
- package/dist/components/Image/index.js.map +1 -1
- package/dist/index.cjs +611 -651
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +3 -4
- package/dist/index.css.map +1 -1
- package/dist/index.js +542 -576
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -34,8 +34,8 @@ __export(CollapsableMenu_exports, {
|
|
|
34
34
|
CollapsableMenu: () => CollapsableMenu
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(CollapsableMenu_exports);
|
|
37
|
-
var
|
|
38
|
-
var
|
|
37
|
+
var import_navigation_menu4 = require("@base-ui/react/navigation-menu");
|
|
38
|
+
var import_react10 = require("react");
|
|
39
39
|
|
|
40
40
|
// src/utils/functions.ts
|
|
41
41
|
var import_axios = __toESM(require("axios"), 1);
|
|
@@ -903,7 +903,7 @@ var MenuContent = ({
|
|
|
903
903
|
};
|
|
904
904
|
|
|
905
905
|
// src/components/CollapsableMenu/MenuHeader/index.tsx
|
|
906
|
-
var
|
|
906
|
+
var import_navigation_menu = require("@base-ui/react/navigation-menu");
|
|
907
907
|
|
|
908
908
|
// src/components/Image/index.tsx
|
|
909
909
|
var import_react4 = require("react");
|
|
@@ -942,96 +942,80 @@ var Image = (0, import_react4.forwardRef)(function Image2({ as: Component = "img
|
|
|
942
942
|
});
|
|
943
943
|
Image.displayName = "Image";
|
|
944
944
|
|
|
945
|
-
// src/components/CollapsableMenu/MenuModal/index.tsx
|
|
946
|
-
var import_popover = require("@base-ui/react/popover");
|
|
947
|
-
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
948
|
-
var MenuModal = ({ item }) => {
|
|
949
|
-
var _a;
|
|
950
|
-
const anchor = document.getElementById(`menu-item${item.path}`);
|
|
951
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_popover.Popover.Root, { open: true, modal: false, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_popover.Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
952
|
-
import_popover.Popover.Positioner,
|
|
953
|
-
{
|
|
954
|
-
anchor,
|
|
955
|
-
side: "right",
|
|
956
|
-
align: "start",
|
|
957
|
-
sideOffset: 4,
|
|
958
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
959
|
-
import_popover.Popover.Popup,
|
|
960
|
-
{
|
|
961
|
-
className: menuPopupWrapperClass,
|
|
962
|
-
initialFocus: false,
|
|
963
|
-
finalFocus: false,
|
|
964
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
965
|
-
"div",
|
|
966
|
-
{
|
|
967
|
-
className: menuModalStyleClass,
|
|
968
|
-
onClick: (e) => e.stopPropagation(),
|
|
969
|
-
children: [
|
|
970
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: modalHeaderClass, children: item.text }),
|
|
971
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ScrollArea, { maxHeight: "calc(100vh - 48px)", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: itemsListClass, children: (_a = item.subitems) == null ? void 0 : _a.map((subitem) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
972
|
-
MenuSubitem,
|
|
973
|
-
{
|
|
974
|
-
subitem,
|
|
975
|
-
parentPath: item.path
|
|
976
|
-
},
|
|
977
|
-
`menu-subitem-${item.text}-${subitem.text}`
|
|
978
|
-
)) }) })
|
|
979
|
-
]
|
|
980
|
-
}
|
|
981
|
-
)
|
|
982
|
-
}
|
|
983
|
-
)
|
|
984
|
-
}
|
|
985
|
-
) }) });
|
|
986
|
-
};
|
|
987
|
-
|
|
988
945
|
// src/components/CollapsableMenu/MenuHeader/index.tsx
|
|
989
|
-
var
|
|
946
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
990
947
|
var MenuHeader = ({
|
|
991
948
|
sideBarOpen,
|
|
992
949
|
profile,
|
|
993
950
|
onToggleSidebar
|
|
994
951
|
}) => {
|
|
995
|
-
|
|
996
|
-
const
|
|
997
|
-
(0,
|
|
998
|
-
if (sideBarOpen) {
|
|
999
|
-
setDeactivateProfilePicture(true);
|
|
1000
|
-
setTimeout(() => {
|
|
1001
|
-
setDeactivateProfilePicture(false);
|
|
1002
|
-
}, 500);
|
|
1003
|
-
}
|
|
1004
|
-
}, [sideBarOpen]);
|
|
1005
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
952
|
+
var _a;
|
|
953
|
+
const hasSubitems = profile.subitems && profile.subitems.length > 0;
|
|
954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1006
955
|
"div",
|
|
1007
956
|
{
|
|
1008
957
|
className: `${menuHeaderClass} ${sideBarOpen ? menuHeaderOpenClass : ""}`,
|
|
1009
958
|
children: [
|
|
1010
|
-
/* @__PURE__ */ (0,
|
|
959
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1011
960
|
"button",
|
|
1012
961
|
{
|
|
1013
962
|
onClick: onToggleSidebar,
|
|
1014
963
|
className: menuHeaderIconContainerClass,
|
|
1015
964
|
"aria-label": sideBarOpen ? "Fechar menu" : "Abrir menu",
|
|
1016
965
|
style: { border: "none", background: "none" },
|
|
1017
|
-
children: sideBarOpen ? /* @__PURE__ */ (0,
|
|
966
|
+
children: sideBarOpen ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconCloseMenu, { id: "icon-menu" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconMenu, { id: "icon-menu" })
|
|
1018
967
|
}
|
|
1019
968
|
),
|
|
1020
|
-
sideBarOpen && /* @__PURE__ */ (0,
|
|
1021
|
-
/* @__PURE__ */ (0,
|
|
1022
|
-
/* @__PURE__ */ (0,
|
|
1023
|
-
|
|
969
|
+
sideBarOpen && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: profile.name }),
|
|
970
|
+
hasSubitems ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_navigation_menu.NavigationMenu.Root, { delay: 0, closeDelay: 100, orientation: "vertical", children: [
|
|
971
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_navigation_menu.NavigationMenu.List, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_navigation_menu.NavigationMenu.Item, { children: [
|
|
972
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
973
|
+
import_navigation_menu.NavigationMenu.Trigger,
|
|
974
|
+
{
|
|
975
|
+
nativeButton: false,
|
|
976
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
977
|
+
Image,
|
|
978
|
+
{
|
|
979
|
+
id: "menu-item/profile",
|
|
980
|
+
src: profile.image ?? void 0,
|
|
981
|
+
alt: "Foto do perfil",
|
|
982
|
+
className: profileImageClass
|
|
983
|
+
}
|
|
984
|
+
)
|
|
985
|
+
}
|
|
986
|
+
),
|
|
987
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_navigation_menu.NavigationMenu.Content, { className: menuModalStyleClass, children: [
|
|
988
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: modalHeaderClass, children: profile.name }),
|
|
989
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ScrollArea, { maxHeight: "calc(100vh - 48px)", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: (_a = profile.subitems) == null ? void 0 : _a.map((subitem) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
990
|
+
MenuSubitem,
|
|
991
|
+
{
|
|
992
|
+
subitem,
|
|
993
|
+
parentPath: profile.path
|
|
994
|
+
},
|
|
995
|
+
`profile-subitem-${subitem.text}`
|
|
996
|
+
)) }) })
|
|
997
|
+
] })
|
|
998
|
+
] }) }),
|
|
999
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_navigation_menu.NavigationMenu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1000
|
+
import_navigation_menu.NavigationMenu.Positioner,
|
|
1024
1001
|
{
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1002
|
+
sideOffset: 4,
|
|
1003
|
+
side: "right",
|
|
1004
|
+
align: "start",
|
|
1005
|
+
collisionAvoidance: { align: "none" },
|
|
1006
|
+
style: { zIndex: 10 },
|
|
1007
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_navigation_menu.NavigationMenu.Popup, { className: menuPopupWrapperClass, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_navigation_menu.NavigationMenu.Viewport, { className: menuViewportClass }) })
|
|
1031
1008
|
}
|
|
1032
|
-
)
|
|
1033
|
-
|
|
1034
|
-
|
|
1009
|
+
) })
|
|
1010
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1011
|
+
Image,
|
|
1012
|
+
{
|
|
1013
|
+
id: "menu-item/profile",
|
|
1014
|
+
src: profile.image ?? void 0,
|
|
1015
|
+
alt: "Foto do perfil",
|
|
1016
|
+
className: profileImageClass
|
|
1017
|
+
}
|
|
1018
|
+
)
|
|
1035
1019
|
]
|
|
1036
1020
|
}
|
|
1037
1021
|
);
|
|
@@ -1039,13 +1023,13 @@ var MenuHeader = ({
|
|
|
1039
1023
|
|
|
1040
1024
|
// src/components/CollapsableMenu/MenuItem/index.tsx
|
|
1041
1025
|
var import_collapsible = require("@base-ui/react/collapsible");
|
|
1042
|
-
var
|
|
1043
|
-
var
|
|
1044
|
-
var
|
|
1026
|
+
var import_navigation_menu2 = require("@base-ui/react/navigation-menu");
|
|
1027
|
+
var import_react5 = require("react");
|
|
1028
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1045
1029
|
var SubitemsKeyboardList = ({
|
|
1046
1030
|
children
|
|
1047
1031
|
}) => {
|
|
1048
|
-
const ref = (0,
|
|
1032
|
+
const ref = (0, import_react5.useRef)(null);
|
|
1049
1033
|
const handleKeyDown = (e) => {
|
|
1050
1034
|
var _a, _b;
|
|
1051
1035
|
const navKeys = ["ArrowDown", "ArrowUp", "Home", "End"];
|
|
@@ -1066,7 +1050,7 @@ var SubitemsKeyboardList = ({
|
|
|
1066
1050
|
e.preventDefault();
|
|
1067
1051
|
e.stopPropagation();
|
|
1068
1052
|
};
|
|
1069
|
-
return /* @__PURE__ */ (0,
|
|
1053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1070
1054
|
"div",
|
|
1071
1055
|
{
|
|
1072
1056
|
ref,
|
|
@@ -1102,30 +1086,30 @@ var MenuItem = ({
|
|
|
1102
1086
|
};
|
|
1103
1087
|
if (sideBarOpen) {
|
|
1104
1088
|
if (hasSubitems) {
|
|
1105
|
-
return /* @__PURE__ */ (0,
|
|
1089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: menuItemWrapperClass, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1106
1090
|
import_collapsible.Collapsible.Root,
|
|
1107
1091
|
{
|
|
1108
1092
|
open: categoryOpen === item.text,
|
|
1109
1093
|
onOpenChange: () => toggleCategoryOpen(item.text),
|
|
1110
1094
|
children: [
|
|
1111
|
-
/* @__PURE__ */ (0,
|
|
1095
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1112
1096
|
import_collapsible.Collapsible.Trigger,
|
|
1113
1097
|
{
|
|
1114
1098
|
nativeButton: false,
|
|
1115
|
-
render: /* @__PURE__ */ (0,
|
|
1099
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LinkComponent, { ...linkProps }),
|
|
1116
1100
|
children: [
|
|
1117
1101
|
item.icon,
|
|
1118
|
-
/* @__PURE__ */ (0,
|
|
1119
|
-
/* @__PURE__ */ (0,
|
|
1102
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: item.text }),
|
|
1103
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(IconChevronDown, { className: "chevron" })
|
|
1120
1104
|
]
|
|
1121
1105
|
}
|
|
1122
1106
|
),
|
|
1123
|
-
/* @__PURE__ */ (0,
|
|
1107
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1124
1108
|
import_collapsible.Collapsible.Panel,
|
|
1125
1109
|
{
|
|
1126
1110
|
className: styledCollapsiblePanelClass,
|
|
1127
1111
|
keepMounted: true,
|
|
1128
|
-
children: /* @__PURE__ */ (0,
|
|
1112
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: subitesInnerClass, children: (_b = item.subitems) == null ? void 0 : _b.map((subitem) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1129
1113
|
MenuSubitem,
|
|
1130
1114
|
{
|
|
1131
1115
|
subitem,
|
|
@@ -1140,26 +1124,26 @@ var MenuItem = ({
|
|
|
1140
1124
|
}
|
|
1141
1125
|
) });
|
|
1142
1126
|
}
|
|
1143
|
-
return /* @__PURE__ */ (0,
|
|
1127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: menuItemWrapperClass, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(LinkComponent, { ...linkProps, children: [
|
|
1144
1128
|
item.icon,
|
|
1145
|
-
/* @__PURE__ */ (0,
|
|
1129
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: item.text })
|
|
1146
1130
|
] }) });
|
|
1147
1131
|
}
|
|
1148
|
-
return /* @__PURE__ */ (0,
|
|
1149
|
-
/* @__PURE__ */ (0,
|
|
1150
|
-
|
|
1132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_navigation_menu2.NavigationMenu.Item, { className: menuItemWrapperClass, children: hasSubitems ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
1133
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1134
|
+
import_navigation_menu2.NavigationMenu.Trigger,
|
|
1151
1135
|
{
|
|
1152
1136
|
nativeButton: false,
|
|
1153
|
-
render: /* @__PURE__ */ (0,
|
|
1137
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LinkComponent, { ...linkProps }),
|
|
1154
1138
|
children: [
|
|
1155
1139
|
item.icon,
|
|
1156
|
-
/* @__PURE__ */ (0,
|
|
1140
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: item.text })
|
|
1157
1141
|
]
|
|
1158
1142
|
}
|
|
1159
1143
|
),
|
|
1160
|
-
/* @__PURE__ */ (0,
|
|
1161
|
-
/* @__PURE__ */ (0,
|
|
1162
|
-
/* @__PURE__ */ (0,
|
|
1144
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_navigation_menu2.NavigationMenu.Content, { className: menuModalStyleClass, children: [
|
|
1145
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: modalHeaderClass, children: item.text }),
|
|
1146
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ScrollArea, { maxHeight: "calc(100vh - 48px)", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SubitemsKeyboardList, { children: (_c = item.subitems) == null ? void 0 : _c.map((subitem) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1163
1147
|
MenuSubitem,
|
|
1164
1148
|
{
|
|
1165
1149
|
subitem,
|
|
@@ -1169,36 +1153,36 @@ var MenuItem = ({
|
|
|
1169
1153
|
`menu-subitem-${item.text}-${subitem.text}`
|
|
1170
1154
|
)) }) })
|
|
1171
1155
|
] })
|
|
1172
|
-
] }) : /* @__PURE__ */ (0,
|
|
1156
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_navigation_menu2.NavigationMenu.Link, { render: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LinkComponent, { ...linkProps }), children: [
|
|
1173
1157
|
item.icon,
|
|
1174
|
-
/* @__PURE__ */ (0,
|
|
1158
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: item.text })
|
|
1175
1159
|
] }) });
|
|
1176
1160
|
};
|
|
1177
1161
|
|
|
1178
1162
|
// src/components/CollapsableMenu/MenuSearch/index.tsx
|
|
1179
|
-
var
|
|
1180
|
-
var
|
|
1163
|
+
var import_navigation_menu3 = require("@base-ui/react/navigation-menu");
|
|
1164
|
+
var import_react9 = require("react");
|
|
1181
1165
|
|
|
1182
1166
|
// src/components/Input/index.tsx
|
|
1183
1167
|
var import_field = require("@base-ui/react/field");
|
|
1184
1168
|
var import_input = require("@base-ui/react/input");
|
|
1185
|
-
var
|
|
1169
|
+
var import_react8 = require("react");
|
|
1186
1170
|
var import_react_number_format = require("react-number-format");
|
|
1187
1171
|
|
|
1188
1172
|
// src/theme/theme.css.ts
|
|
1189
1173
|
var vars = { colors: { primary: { lightest: "var(--colors-primary-lightest__14bhs4v0)", lighter: "var(--colors-primary-lighter__14bhs4v1)", light: "var(--colors-primary-light__14bhs4v2)", "default": "var(--colors-primary-default__14bhs4v3)", dark: "var(--colors-primary-dark__14bhs4v4)", darker: "var(--colors-primary-darker__14bhs4v5)" }, red: { lightest: "var(--colors-red-lightest__14bhs4v6)", lighter: "var(--colors-red-lighter__14bhs4v7)", light: "var(--colors-red-light__14bhs4v8)", "default": "var(--colors-red-default__14bhs4v9)", dark: "var(--colors-red-dark__14bhs4va)", darker: "var(--colors-red-darker__14bhs4vb)" }, yellow: { lightest: "var(--colors-yellow-lightest__14bhs4vc)", lighter: "var(--colors-yellow-lighter__14bhs4vd)", light: "var(--colors-yellow-light__14bhs4ve)", "default": "var(--colors-yellow-default__14bhs4vf)", dark: "var(--colors-yellow-dark__14bhs4vg)", darker: "var(--colors-yellow-darker__14bhs4vh)" }, green: { lightest: "var(--colors-green-lightest__14bhs4vi)", lighter: "var(--colors-green-lighter__14bhs4vj)", light: "var(--colors-green-light__14bhs4vk)", "default": "var(--colors-green-default__14bhs4vl)", dark: "var(--colors-green-dark__14bhs4vm)", darker: "var(--colors-green-darker__14bhs4vn)" }, blue: { lightest: "var(--colors-blue-lightest__14bhs4vo)", lighter: "var(--colors-blue-lighter__14bhs4vp)", light: "var(--colors-blue-light__14bhs4vq)", "default": "var(--colors-blue-default__14bhs4vr)", dark: "var(--colors-blue-dark__14bhs4vs)", darker: "var(--colors-blue-darker__14bhs4vt)" }, orange: { lightest: "var(--colors-orange-lightest__14bhs4vu)", lighter: "var(--colors-orange-lighter__14bhs4vv)", light: "var(--colors-orange-light__14bhs4vw)", "default": "var(--colors-orange-default__14bhs4vx)", dark: "var(--colors-orange-dark__14bhs4vy)", darker: "var(--colors-orange-darker__14bhs4vz)" }, second_green: { lightest: "var(--colors-second_green-lightest__14bhs4v10)", lighter: "var(--colors-second_green-lighter__14bhs4v11)", light: "var(--colors-second_green-light__14bhs4v12)", "default": "var(--colors-second_green-default__14bhs4v13)", dark: "var(--colors-second_green-dark__14bhs4v14)", darker: "var(--colors-second_green-darker__14bhs4v15)" }, neutral: { white: "var(--colors-neutral-white__14bhs4v16)", lightest: "var(--colors-neutral-lightest__14bhs4v17)", lighter: "var(--colors-neutral-lighter__14bhs4v18)", light: "var(--colors-neutral-light__14bhs4v19)", "default": "var(--colors-neutral-default__14bhs4v1a)", dark: "var(--colors-neutral-dark__14bhs4v1b)", darker: "var(--colors-neutral-darker__14bhs4v1c)", black: "var(--colors-neutral-black__14bhs4v1d)" }, fixed: { white: "var(--colors-fixed-white__14bhs4v1e)", black: "var(--colors-fixed-black__14bhs4v1f)" } }, shadows: { lighter: "var(--shadows-lighter__14bhs4v1g)", light: "var(--shadows-light__14bhs4v1h)", "default": "var(--shadows-default__14bhs4v1i)", dark: "var(--shadows-dark__14bhs4v1j)", darker: "var(--shadows-darker__14bhs4v1k)" }, typography: { family: { "default": "var(--typography-family-default__14bhs4v1l)" }, weights: { regular: "var(--typography-weights-regular__14bhs4v1m)", medium: "var(--typography-weights-medium__14bhs4v1n)", semibold: "var(--typography-weights-semibold__14bhs4v1o)", bold: "var(--typography-weights-bold__14bhs4v1p)" }, scale: { display: { fontSize: "var(--typography-scale-display-fontSize__14bhs4v1q)", lineHeight: "var(--typography-scale-display-lineHeight__14bhs4v1r)", fontWeight: "var(--typography-scale-display-fontWeight__14bhs4v1s)" }, heading: { fontSize: "var(--typography-scale-heading-fontSize__14bhs4v1t)", lineHeight: "var(--typography-scale-heading-lineHeight__14bhs4v1u)", fontWeight: "var(--typography-scale-heading-fontWeight__14bhs4v1v)" }, body: { fontSize: "var(--typography-scale-body-fontSize__14bhs4v1w)", lineHeight: "var(--typography-scale-body-lineHeight__14bhs4v1x)", fontWeight: "var(--typography-scale-body-fontWeight__14bhs4v1y)" }, caption: { fontSize: "var(--typography-scale-caption-fontSize__14bhs4v1z)", lineHeight: "var(--typography-scale-caption-lineHeight__14bhs4v20)", fontWeight: "var(--typography-scale-caption-fontWeight__14bhs4v21)" }, small: { fontSize: "var(--typography-scale-small-fontSize__14bhs4v22)", lineHeight: "var(--typography-scale-small-lineHeight__14bhs4v23)", fontWeight: "var(--typography-scale-small-fontWeight__14bhs4v24)" } } }, spacing: { xxs: "var(--spacing-xxs__14bhs4v25)", xs: "var(--spacing-xs__14bhs4v26)", s: "var(--spacing-s__14bhs4v27)", m: "var(--spacing-m__14bhs4v28)", l: "var(--spacing-l__14bhs4v29)", xl: "var(--spacing-xl__14bhs4v2a)", xxl: "var(--spacing-xxl__14bhs4v2b)" }, radius: { s: "var(--radius-s__14bhs4v2c)", m: "var(--radius-m__14bhs4v2d)", l: "var(--radius-l__14bhs4v2e)", xl: "var(--radius-xl__14bhs4v2f)", xxl: "var(--radius-xxl__14bhs4v2g)" }, semantic: { error: "var(--semantic-error__14bhs4v2h)", success: "var(--semantic-success__14bhs4v2i)", info: "var(--semantic-info__14bhs4v2j)", warning: "var(--semantic-warning__14bhs4v2k)" }, zIndex: { dropdown: "var(--zIndex-dropdown__14bhs4v2l)", modal: "var(--zIndex-modal__14bhs4v2m)", tooltip: "var(--zIndex-tooltip__14bhs4v2n)", toast: "var(--zIndex-toast__14bhs4v2o)" }, motion: { fast: "var(--motion-fast__14bhs4v2p)", normal: "var(--motion-normal__14bhs4v2q)", slow: "var(--motion-slow__14bhs4v2r)" }, components: { fieldInfo: { fontSize: { desktop: "var(--components-fieldInfo-fontSize-desktop__14bhs4v2s)", tablet: "var(--components-fieldInfo-fontSize-tablet__14bhs4v2t)", totem: "var(--components-fieldInfo-fontSize-totem__14bhs4v2u)" } }, input: { label: { fontSize: { desktop: "var(--components-input-label-fontSize-desktop__14bhs4v2v)", large: "var(--components-input-label-fontSize-large__14bhs4v2w)", medium: "var(--components-input-label-fontSize-medium__14bhs4v2x)", small: "var(--components-input-label-fontSize-small__14bhs4v2y)", tablet: "var(--components-input-label-fontSize-tablet__14bhs4v2z)", "tablet-medium": "var(--components-input-label-fontSize-tablet-medium__14bhs4v30)", "tablet-small": "var(--components-input-label-fontSize-tablet-small__14bhs4v31)", totem: "var(--components-input-label-fontSize-totem__14bhs4v32)", "totem-medium": "var(--components-input-label-fontSize-totem-medium__14bhs4v33)", "totem-small": "var(--components-input-label-fontSize-totem-small__14bhs4v34)" } }, input: { fontSize: { desktop: "var(--components-input-input-fontSize-desktop__14bhs4v35)", large: "var(--components-input-input-fontSize-large__14bhs4v36)", medium: "var(--components-input-input-fontSize-medium__14bhs4v37)", small: "var(--components-input-input-fontSize-small__14bhs4v38)", tablet: "var(--components-input-input-fontSize-tablet__14bhs4v39)", "tablet-medium": "var(--components-input-input-fontSize-tablet-medium__14bhs4v3a)", "tablet-small": "var(--components-input-input-fontSize-tablet-small__14bhs4v3b)", totem: "var(--components-input-input-fontSize-totem__14bhs4v3c)", "totem-medium": "var(--components-input-input-fontSize-totem-medium__14bhs4v3d)", "totem-small": "var(--components-input-input-fontSize-totem-small__14bhs4v3e)" }, height: { desktop: "var(--components-input-input-height-desktop__14bhs4v3f)", large: "var(--components-input-input-height-large__14bhs4v3g)", medium: "var(--components-input-input-height-medium__14bhs4v3h)", small: "var(--components-input-input-height-small__14bhs4v3i)", tablet: "var(--components-input-input-height-tablet__14bhs4v3j)", "tablet-medium": "var(--components-input-input-height-tablet-medium__14bhs4v3k)", "tablet-small": "var(--components-input-input-height-tablet-small__14bhs4v3l)", totem: "var(--components-input-input-height-totem__14bhs4v3m)", "totem-medium": "var(--components-input-input-height-totem-medium__14bhs4v3n)", "totem-small": "var(--components-input-input-height-totem-small__14bhs4v3o)" }, borderRadius: { desktop: "var(--components-input-input-borderRadius-desktop__14bhs4v3p)", large: "var(--components-input-input-borderRadius-large__14bhs4v3q)", medium: "var(--components-input-input-borderRadius-medium__14bhs4v3r)", small: "var(--components-input-input-borderRadius-small__14bhs4v3s)", tablet: "var(--components-input-input-borderRadius-tablet__14bhs4v3t)", "tablet-medium": "var(--components-input-input-borderRadius-tablet-medium__14bhs4v3u)", "tablet-small": "var(--components-input-input-borderRadius-tablet-small__14bhs4v3v)", totem: "var(--components-input-input-borderRadius-totem__14bhs4v3w)", "totem-medium": "var(--components-input-input-borderRadius-totem-medium__14bhs4v3x)", "totem-small": "var(--components-input-input-borderRadius-totem-small__14bhs4v3y)" }, padding: { desktop: "var(--components-input-input-padding-desktop__14bhs4v3z)", large: "var(--components-input-input-padding-large__14bhs4v40)", medium: "var(--components-input-input-padding-medium__14bhs4v41)", small: "var(--components-input-input-padding-small__14bhs4v42)", tablet: "var(--components-input-input-padding-tablet__14bhs4v43)", "tablet-medium": "var(--components-input-input-padding-tablet-medium__14bhs4v44)", "tablet-small": "var(--components-input-input-padding-tablet-small__14bhs4v45)", totem: "var(--components-input-input-padding-totem__14bhs4v46)", "totem-medium": "var(--components-input-input-padding-totem-medium__14bhs4v47)", "totem-small": "var(--components-input-input-padding-totem-small__14bhs4v48)" } } }, select: { padding: { desktop: "var(--components-select-padding-desktop__14bhs4v49)", tablet: "var(--components-select-padding-tablet__14bhs4v4a)", totem: "var(--components-select-padding-totem__14bhs4v4b)" } }, button: { fontSize: { medium: "var(--components-button-fontSize-medium__14bhs4v4c)", small: "var(--components-button-fontSize-small__14bhs4v4d)", large: "var(--components-button-fontSize-large__14bhs4v4e)", tablet: "var(--components-button-fontSize-tablet__14bhs4v4f)", "tablet-medium": "var(--components-button-fontSize-tablet-medium__14bhs4v4g)", "tablet-small": "var(--components-button-fontSize-tablet-small__14bhs4v4h)", totem: "var(--components-button-fontSize-totem__14bhs4v4i)", "totem-medium": "var(--components-button-fontSize-totem-medium__14bhs4v4j)", "totem-small": "var(--components-button-fontSize-totem-small__14bhs4v4k)" }, height: { large: "var(--components-button-height-large__14bhs4v4l)", medium: "var(--components-button-height-medium__14bhs4v4m)", small: "var(--components-button-height-small__14bhs4v4n)", tablet: "var(--components-button-height-tablet__14bhs4v4o)", "tablet-medium": "var(--components-button-height-tablet-medium__14bhs4v4p)", "tablet-small": "var(--components-button-height-tablet-small__14bhs4v4q)", totem: "var(--components-button-height-totem__14bhs4v4r)", "totem-medium": "var(--components-button-height-totem-medium__14bhs4v4s)", "totem-small": "var(--components-button-height-totem-small__14bhs4v4t)" }, padding: { large: { text: "var(--components-button-padding-large-text__14bhs4v4u)", icon: "var(--components-button-padding-large-icon__14bhs4v4v)", textAndIcon: "var(--components-button-padding-large-textAndIcon__14bhs4v4w)" }, medium: { text: "var(--components-button-padding-medium-text__14bhs4v4x)", icon: "var(--components-button-padding-medium-icon__14bhs4v4y)", textAndIcon: "var(--components-button-padding-medium-textAndIcon__14bhs4v4z)" }, small: { text: "var(--components-button-padding-small-text__14bhs4v50)", icon: "var(--components-button-padding-small-icon__14bhs4v51)", textAndIcon: "var(--components-button-padding-small-textAndIcon__14bhs4v52)" }, tablet: { text: "var(--components-button-padding-tablet-text__14bhs4v53)", icon: "var(--components-button-padding-tablet-icon__14bhs4v54)", textAndIcon: "var(--components-button-padding-tablet-textAndIcon__14bhs4v55)" }, "tablet-medium": { text: "var(--components-button-padding-tablet-medium-text__14bhs4v56)", icon: "var(--components-button-padding-tablet-medium-icon__14bhs4v57)", textAndIcon: "var(--components-button-padding-tablet-medium-textAndIcon__14bhs4v58)" }, "tablet-small": { text: "var(--components-button-padding-tablet-small-text__14bhs4v59)", icon: "var(--components-button-padding-tablet-small-icon__14bhs4v5a)", textAndIcon: "var(--components-button-padding-tablet-small-textAndIcon__14bhs4v5b)" }, totem: { text: "var(--components-button-padding-totem-text__14bhs4v5c)", icon: "var(--components-button-padding-totem-icon__14bhs4v5d)", textAndIcon: "var(--components-button-padding-totem-textAndIcon__14bhs4v5e)" }, "totem-medium": { text: "var(--components-button-padding-totem-medium-text__14bhs4v5f)", icon: "var(--components-button-padding-totem-medium-icon__14bhs4v5g)", textAndIcon: "var(--components-button-padding-totem-medium-textAndIcon__14bhs4v5h)" }, "totem-small": { text: "var(--components-button-padding-totem-small-text__14bhs4v5i)", icon: "var(--components-button-padding-totem-small-icon__14bhs4v5j)", textAndIcon: "var(--components-button-padding-totem-small-textAndIcon__14bhs4v5k)" } }, borderRadius: { large: "var(--components-button-borderRadius-large__14bhs4v5l)", medium: "var(--components-button-borderRadius-medium__14bhs4v5m)", small: "var(--components-button-borderRadius-small__14bhs4v5n)", tablet: "var(--components-button-borderRadius-tablet__14bhs4v5o)", "tablet-medium": "var(--components-button-borderRadius-tablet-medium__14bhs4v5p)", "tablet-small": "var(--components-button-borderRadius-tablet-small__14bhs4v5q)", totem: "var(--components-button-borderRadius-totem__14bhs4v5r)", "totem-medium": "var(--components-button-borderRadius-totem-medium__14bhs4v5s)", "totem-small": "var(--components-button-borderRadius-totem-small__14bhs4v5t)" }, iconSize: { large: "var(--components-button-iconSize-large__14bhs4v5u)", medium: "var(--components-button-iconSize-medium__14bhs4v5v)", small: "var(--components-button-iconSize-small__14bhs4v5w)", tablet: "var(--components-button-iconSize-tablet__14bhs4v5x)", "tablet-medium": "var(--components-button-iconSize-tablet-medium__14bhs4v5y)", "tablet-small": "var(--components-button-iconSize-tablet-small__14bhs4v5z)", totem: "var(--components-button-iconSize-totem__14bhs4v60)", "totem-medium": "var(--components-button-iconSize-totem-medium__14bhs4v61)", "totem-small": "var(--components-button-iconSize-totem-small__14bhs4v62)" } } } };
|
|
1190
1174
|
|
|
1191
1175
|
// src/components/FieldInfo/FieldMessage.tsx
|
|
1192
|
-
var
|
|
1176
|
+
var import_react6 = require("react");
|
|
1193
1177
|
|
|
1194
1178
|
// src/components/FieldInfo/styles.css.ts
|
|
1195
1179
|
var fieldInfoContainerClass = "styles_fieldInfoContainerClass__1v4k68v1 sprinkles_display_flex_desktop__1hu819u5 sprinkles_alignItems_center__1hu819ucx sprinkles_gap_xxs_desktop__1hu819u6b";
|
|
1196
1180
|
|
|
1197
1181
|
// src/components/FieldInfo/FieldMessage.tsx
|
|
1198
|
-
var
|
|
1182
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1199
1183
|
function useDelayedUnmount(visible, delay) {
|
|
1200
|
-
const [mounted, setMounted] = (0,
|
|
1201
|
-
(0,
|
|
1184
|
+
const [mounted, setMounted] = (0, import_react6.useState)(visible);
|
|
1185
|
+
(0, import_react6.useEffect)(() => {
|
|
1202
1186
|
if (visible) {
|
|
1203
1187
|
setMounted(true);
|
|
1204
1188
|
return;
|
|
@@ -1214,7 +1198,7 @@ function FieldMessage({ error, info, isDisabled }) {
|
|
|
1214
1198
|
const mounted = useDelayedUnmount(visible, 200);
|
|
1215
1199
|
if (!mounted) return null;
|
|
1216
1200
|
const color = error ? vars.colors.red.default : isDisabled ? vars.colors.neutral.light : vars.colors.neutral.dark;
|
|
1217
|
-
return /* @__PURE__ */ (0,
|
|
1201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1218
1202
|
"p",
|
|
1219
1203
|
{
|
|
1220
1204
|
className: fieldInfoContainerClass,
|
|
@@ -1228,18 +1212,18 @@ function FieldMessage({ error, info, isDisabled }) {
|
|
|
1228
1212
|
// src/components/Spinner/index.tsx
|
|
1229
1213
|
var import_progress = require("@base-ui/react/progress");
|
|
1230
1214
|
var import_clsx = __toESM(require("clsx"), 1);
|
|
1231
|
-
var
|
|
1215
|
+
var import_react7 = require("react");
|
|
1232
1216
|
|
|
1233
1217
|
// src/components/Spinner/styles.css.ts
|
|
1234
1218
|
var spinnerStyles = "styles_spinnerStyles__15ydgey1";
|
|
1235
1219
|
|
|
1236
1220
|
// src/components/Spinner/index.tsx
|
|
1237
|
-
var
|
|
1221
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1238
1222
|
var SVG_MASK = `url("data:image/svg+xml, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'><path d='M9.249 0.645999C9.63764 0.588245 10.0334 0.685283 10.3513 0.916254C10.6691 1.14722 10.8837 1.49369 10.9488 1.88116C11.0139 2.26864 10.9243 2.66619 10.6994 2.98835C10.4745 3.31051 10.1322 3.53157 9.746 3.604C7.99897 3.90027 6.41326 4.80555 5.26996 6.15934C4.12666 7.51314 3.49963 9.22802 3.5 11C3.5 12.9891 4.29018 14.8968 5.6967 16.3033C7.10322 17.7098 9.01088 18.5 11 18.5V21.5C5.201 21.5 0.5 16.8 0.5 11C0.5 5.855 4.226 1.49 9.249 0.645999ZM15.892 3.29799C16.0235 3.15124 16.1827 3.03185 16.3604 2.94664C16.5381 2.86143 16.7309 2.81208 16.9277 2.8014C17.1245 2.79072 17.3214 2.81892 17.5073 2.8844C17.6932 2.94987 17.8643 3.05134 18.011 3.18299C19.11 4.16702 19.9888 5.37197 20.59 6.71901C21.1913 8.06606 21.5013 9.52486 21.5 11C21.5 16.8 16.799 21.5 11 21.5V18.5C12.5182 18.5 14.0006 18.0393 15.2513 17.1788C16.502 16.3182 17.4621 15.0984 18.0047 13.6805C18.5473 12.2626 18.6469 10.7135 18.2902 9.23782C17.9335 7.76216 17.1373 6.42949 16.007 5.41599C15.7109 5.15036 15.5325 4.778 15.5109 4.38081C15.4893 3.98361 15.6264 3.59412 15.892 3.29799Z'/></svg>")`;
|
|
1239
|
-
var Spinner = (0,
|
|
1223
|
+
var Spinner = (0, import_react7.forwardRef)(function Spinner2({ color, size, value, max = 100, className, ...props }, ref) {
|
|
1240
1224
|
const resolvedColor = color || vars.colors.primary.default;
|
|
1241
1225
|
const resolvedSize = size || 22;
|
|
1242
|
-
const spinnerDiv = /* @__PURE__ */ (0,
|
|
1226
|
+
const spinnerDiv = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1243
1227
|
"div",
|
|
1244
1228
|
{
|
|
1245
1229
|
ref,
|
|
@@ -1258,7 +1242,7 @@ var Spinner = (0, import_react8.forwardRef)(function Spinner2({ color, size, val
|
|
|
1258
1242
|
}
|
|
1259
1243
|
);
|
|
1260
1244
|
if (value !== void 0) {
|
|
1261
|
-
return /* @__PURE__ */ (0,
|
|
1245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_progress.Progress.Root, { value, max, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_progress.Progress.Track, { style: { display: "contents" }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_progress.Progress.Indicator, { style: { display: "contents" }, children: spinnerDiv }) }) });
|
|
1262
1246
|
}
|
|
1263
1247
|
return spinnerDiv;
|
|
1264
1248
|
});
|
|
@@ -1272,7 +1256,7 @@ var inputContainerSizeVariants = { large: "styles_inputContainerSizeVariants_lar
|
|
|
1272
1256
|
var inputWrapperClass = "styles_inputWrapperClass__vsoa470";
|
|
1273
1257
|
|
|
1274
1258
|
// src/components/Input/index.tsx
|
|
1275
|
-
var
|
|
1259
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1276
1260
|
var maskValue = (value, mask) => {
|
|
1277
1261
|
if (!value || value.length === 0) return "";
|
|
1278
1262
|
let maskedValue = "";
|
|
@@ -1308,7 +1292,7 @@ var maskValue = (value, mask) => {
|
|
|
1308
1292
|
}
|
|
1309
1293
|
return maskedValue;
|
|
1310
1294
|
};
|
|
1311
|
-
var Input = (0,
|
|
1295
|
+
var Input = (0, import_react8.forwardRef)(
|
|
1312
1296
|
({
|
|
1313
1297
|
label,
|
|
1314
1298
|
info,
|
|
@@ -1328,14 +1312,14 @@ var Input = (0, import_react9.forwardRef)(
|
|
|
1328
1312
|
}, ref) => {
|
|
1329
1313
|
var _a;
|
|
1330
1314
|
const spinnerSize = size === "large" ? 18 : 16;
|
|
1331
|
-
const [passwordShowing, setPasswordShowing] = (0,
|
|
1332
|
-
const innerInputRef = (0,
|
|
1315
|
+
const [passwordShowing, setPasswordShowing] = (0, import_react8.useState)(false);
|
|
1316
|
+
const innerInputRef = (0, import_react8.useRef)(null);
|
|
1333
1317
|
const togglePasswordVisibility = () => {
|
|
1334
1318
|
setPasswordShowing((prev) => !prev);
|
|
1335
1319
|
};
|
|
1336
1320
|
const isPasswordField = props.type === "password";
|
|
1337
1321
|
const inputType = isPasswordField && passwordShowing ? "text" : props.type;
|
|
1338
|
-
const passwordIcon = isPasswordField ? /* @__PURE__ */ (0,
|
|
1322
|
+
const passwordIcon = isPasswordField ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1339
1323
|
"button",
|
|
1340
1324
|
{
|
|
1341
1325
|
type: "button",
|
|
@@ -1350,7 +1334,7 @@ var Input = (0, import_react9.forwardRef)(
|
|
|
1350
1334
|
alignItems: "center",
|
|
1351
1335
|
justifyContent: "center"
|
|
1352
1336
|
},
|
|
1353
|
-
children: passwordShowing ? /* @__PURE__ */ (0,
|
|
1337
|
+
children: passwordShowing ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(IconEyeSlash, {}) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(IconEye, {})
|
|
1354
1338
|
}
|
|
1355
1339
|
) : iconRight;
|
|
1356
1340
|
const valueFormatted = props.value !== void 0 ? mask ? maskValue(props.value.toString(), mask) : props.value : void 0;
|
|
@@ -1368,7 +1352,7 @@ var Input = (0, import_react9.forwardRef)(
|
|
|
1368
1352
|
innerInputRef.current.focus();
|
|
1369
1353
|
}
|
|
1370
1354
|
};
|
|
1371
|
-
return /* @__PURE__ */ (0,
|
|
1355
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1372
1356
|
import_field.Field.Root,
|
|
1373
1357
|
{
|
|
1374
1358
|
className: `${inputWrapperClass} ${props.className || ""}`,
|
|
@@ -1376,8 +1360,8 @@ var Input = (0, import_react9.forwardRef)(
|
|
|
1376
1360
|
invalid: !!error,
|
|
1377
1361
|
"data-slot": "input-root",
|
|
1378
1362
|
children: [
|
|
1379
|
-
label && /* @__PURE__ */ (0,
|
|
1380
|
-
/* @__PURE__ */ (0,
|
|
1363
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_field.Field.Label, { "data-size": size, "data-slot": "input-label", children: label }),
|
|
1364
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1381
1365
|
"div",
|
|
1382
1366
|
{
|
|
1383
1367
|
className: `${inputContainerClass} ${inputContainerSizeVariants[size]} ${inputClassName || ""}`,
|
|
@@ -1386,8 +1370,8 @@ var Input = (0, import_react9.forwardRef)(
|
|
|
1386
1370
|
"data-invalid": error ? "true" : void 0,
|
|
1387
1371
|
onMouseDown: handleContainerMouseDown,
|
|
1388
1372
|
children: [
|
|
1389
|
-
iconLeft && /* @__PURE__ */ (0,
|
|
1390
|
-
isCurrency ? /* @__PURE__ */ (0,
|
|
1373
|
+
iconLeft && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: `icon-left ${iconSizeVariants[size]}`, children: iconLeft }),
|
|
1374
|
+
isCurrency ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1391
1375
|
CurrencyInput,
|
|
1392
1376
|
{
|
|
1393
1377
|
hasPrefix,
|
|
@@ -1397,7 +1381,7 @@ var Input = (0, import_react9.forwardRef)(
|
|
|
1397
1381
|
type: inputType,
|
|
1398
1382
|
ref: assignInputRef
|
|
1399
1383
|
}
|
|
1400
|
-
) : /* @__PURE__ */ (0,
|
|
1384
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1401
1385
|
NormalInput,
|
|
1402
1386
|
{
|
|
1403
1387
|
isLoading,
|
|
@@ -1416,16 +1400,16 @@ var Input = (0, import_react9.forwardRef)(
|
|
|
1416
1400
|
}
|
|
1417
1401
|
}
|
|
1418
1402
|
),
|
|
1419
|
-
isLoading ? /* @__PURE__ */ (0,
|
|
1403
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Spinner, { size: spinnerSize, color: vars.colors.neutral.light }) : error ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1420
1404
|
IconExclamation,
|
|
1421
1405
|
{
|
|
1422
1406
|
className: `error-icon ${iconSizeVariants[size]}`
|
|
1423
1407
|
}
|
|
1424
|
-
) : passwordIcon && /* @__PURE__ */ (0,
|
|
1408
|
+
) : passwordIcon && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: `icon-right ${iconSizeVariants[size]}`, children: passwordIcon })
|
|
1425
1409
|
]
|
|
1426
1410
|
}
|
|
1427
1411
|
),
|
|
1428
|
-
/* @__PURE__ */ (0,
|
|
1412
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1429
1413
|
FieldMessage,
|
|
1430
1414
|
{
|
|
1431
1415
|
error,
|
|
@@ -1439,9 +1423,9 @@ var Input = (0, import_react9.forwardRef)(
|
|
|
1439
1423
|
}
|
|
1440
1424
|
);
|
|
1441
1425
|
Input.displayName = "Input";
|
|
1442
|
-
var NormalInput = (0,
|
|
1426
|
+
var NormalInput = (0, import_react8.forwardRef)(
|
|
1443
1427
|
({ isLoading, mask, ...props }, ref) => {
|
|
1444
|
-
return /* @__PURE__ */ (0,
|
|
1428
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1445
1429
|
import_input.Input,
|
|
1446
1430
|
{
|
|
1447
1431
|
...props,
|
|
@@ -1453,7 +1437,7 @@ var NormalInput = (0, import_react9.forwardRef)(
|
|
|
1453
1437
|
}
|
|
1454
1438
|
);
|
|
1455
1439
|
NormalInput.displayName = "NormalInput";
|
|
1456
|
-
var CurrencyInput = (0,
|
|
1440
|
+
var CurrencyInput = (0, import_react8.forwardRef)(
|
|
1457
1441
|
({
|
|
1458
1442
|
hasPrefix,
|
|
1459
1443
|
minimumFractionDigits = 2,
|
|
@@ -1462,7 +1446,7 @@ var CurrencyInput = (0, import_react9.forwardRef)(
|
|
|
1462
1446
|
...props
|
|
1463
1447
|
}, ref) => {
|
|
1464
1448
|
const multiplicator = 10 ** minimumFractionDigits;
|
|
1465
|
-
const inputElementRef = (0,
|
|
1449
|
+
const inputElementRef = (0, import_react8.useRef)(null);
|
|
1466
1450
|
const assignInputRef = (el) => {
|
|
1467
1451
|
inputElementRef.current = el;
|
|
1468
1452
|
if (typeof ref === "function") {
|
|
@@ -1485,7 +1469,7 @@ var CurrencyInput = (0, import_react9.forwardRef)(
|
|
|
1485
1469
|
}, 1);
|
|
1486
1470
|
}
|
|
1487
1471
|
};
|
|
1488
|
-
return /* @__PURE__ */ (0,
|
|
1472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1489
1473
|
import_react_number_format.NumberFormatBase,
|
|
1490
1474
|
{
|
|
1491
1475
|
format: (e) => currencyFormatter(
|
|
@@ -1577,85 +1561,9 @@ var CurrencyInput = (0, import_react9.forwardRef)(
|
|
|
1577
1561
|
);
|
|
1578
1562
|
CurrencyInput.displayName = "CurrencyInput";
|
|
1579
1563
|
|
|
1580
|
-
// src/components/CollapsableMenu/MenuModalSearch/index.tsx
|
|
1581
|
-
var import_popover2 = require("@base-ui/react/popover");
|
|
1582
|
-
var import_react10 = require("react");
|
|
1583
|
-
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1584
|
-
var MenuModalSearch = ({
|
|
1585
|
-
searchItems,
|
|
1586
|
-
setIsFocused,
|
|
1587
|
-
searchPlaceholder = "Buscar",
|
|
1588
|
-
searchEmptyMessage = "Nenhum resultado encontrado"
|
|
1589
|
-
}) => {
|
|
1590
|
-
const [search, setSearch] = (0, import_react10.useState)("");
|
|
1591
|
-
const searchItemsFiltered = searchItems.filter(
|
|
1592
|
-
(item) => {
|
|
1593
|
-
var _a;
|
|
1594
|
-
return (_a = item.searchText) == null ? void 0 : _a.toLowerCase().includes(search.toLowerCase());
|
|
1595
|
-
}
|
|
1596
|
-
);
|
|
1597
|
-
const anchor = document.getElementById("menu-item/search");
|
|
1598
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_popover2.Popover.Root, { open: true, modal: false, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_popover2.Popover.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1599
|
-
import_popover2.Popover.Positioner,
|
|
1600
|
-
{
|
|
1601
|
-
anchor,
|
|
1602
|
-
side: "right",
|
|
1603
|
-
align: "start",
|
|
1604
|
-
sideOffset: 4,
|
|
1605
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1606
|
-
import_popover2.Popover.Popup,
|
|
1607
|
-
{
|
|
1608
|
-
className: menuPopupWrapperClass,
|
|
1609
|
-
initialFocus: false,
|
|
1610
|
-
finalFocus: false,
|
|
1611
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1612
|
-
"div",
|
|
1613
|
-
{
|
|
1614
|
-
className: menuModalStyleClass,
|
|
1615
|
-
onClick: (e) => e.stopPropagation(),
|
|
1616
|
-
children: [
|
|
1617
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: modalHeaderClass, children: searchPlaceholder }),
|
|
1618
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: itemsListClass, children: [
|
|
1619
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1620
|
-
Input,
|
|
1621
|
-
{
|
|
1622
|
-
placeholder: searchPlaceholder,
|
|
1623
|
-
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(IconSearch, {}),
|
|
1624
|
-
iconRight: search.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1625
|
-
IconClose,
|
|
1626
|
-
{
|
|
1627
|
-
style: { cursor: "pointer" },
|
|
1628
|
-
onClick: () => setSearch("")
|
|
1629
|
-
}
|
|
1630
|
-
),
|
|
1631
|
-
value: search,
|
|
1632
|
-
onChange: (e) => setSearch(e.target.value),
|
|
1633
|
-
onFocus: () => setIsFocused(true),
|
|
1634
|
-
onBlur: () => setIsFocused(false)
|
|
1635
|
-
}
|
|
1636
|
-
),
|
|
1637
|
-
search && (searchItemsFiltered.length > 0 ? searchItemsFiltered == null ? void 0 : searchItemsFiltered.map((subitem) => {
|
|
1638
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MenuSubitem, { subitem }, subitem.key);
|
|
1639
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1640
|
-
"span",
|
|
1641
|
-
{
|
|
1642
|
-
className: nothingFoundSpanClass,
|
|
1643
|
-
style: { textAlign: "center" },
|
|
1644
|
-
children: searchEmptyMessage
|
|
1645
|
-
}
|
|
1646
|
-
))
|
|
1647
|
-
] })
|
|
1648
|
-
]
|
|
1649
|
-
}
|
|
1650
|
-
)
|
|
1651
|
-
}
|
|
1652
|
-
)
|
|
1653
|
-
}
|
|
1654
|
-
) }) });
|
|
1655
|
-
};
|
|
1656
|
-
|
|
1657
1564
|
// src/components/CollapsableMenu/MenuSearch/index.tsx
|
|
1658
|
-
var
|
|
1565
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1566
|
+
var SEARCH_NAV_VALUE = "search";
|
|
1659
1567
|
var MenuSearch = ({
|
|
1660
1568
|
sideBarOpen,
|
|
1661
1569
|
searchInput,
|
|
@@ -1663,10 +1571,12 @@ var MenuSearch = ({
|
|
|
1663
1571
|
onActiveSearchChange,
|
|
1664
1572
|
searchItems,
|
|
1665
1573
|
searchPlaceholder = "Buscar",
|
|
1666
|
-
searchEmptyMessage = "Nenhum resultado encontrado"
|
|
1574
|
+
searchEmptyMessage = "Nenhum resultado encontrado",
|
|
1575
|
+
onInputFocus,
|
|
1576
|
+
onInputBlur
|
|
1667
1577
|
}) => {
|
|
1668
|
-
const [
|
|
1669
|
-
const
|
|
1578
|
+
const [innerSearch, setInnerSearch] = (0, import_react9.useState)("");
|
|
1579
|
+
const popupHoveredRef = (0, import_react9.useRef)(false);
|
|
1670
1580
|
const filtered = searchItems.filter(
|
|
1671
1581
|
(item) => {
|
|
1672
1582
|
var _a;
|
|
@@ -1674,80 +1584,154 @@ var MenuSearch = ({
|
|
|
1674
1584
|
}
|
|
1675
1585
|
);
|
|
1676
1586
|
if (sideBarOpen) {
|
|
1677
|
-
return /* @__PURE__ */ (0,
|
|
1587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1678
1588
|
"div",
|
|
1679
1589
|
{
|
|
1680
1590
|
id: "menu-item/search",
|
|
1681
1591
|
className: `${searchContainerClass} ${searchContainerOpenClass}`,
|
|
1682
|
-
children:
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
),
|
|
1694
|
-
isSearchFocused && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1695
|
-
MenuModalSearch,
|
|
1696
|
-
{
|
|
1697
|
-
searchItems,
|
|
1698
|
-
setIsFocused: setIsSearchFocused,
|
|
1699
|
-
searchPlaceholder,
|
|
1700
|
-
searchEmptyMessage
|
|
1701
|
-
}
|
|
1702
|
-
)
|
|
1703
|
-
]
|
|
1592
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1593
|
+
Input,
|
|
1594
|
+
{
|
|
1595
|
+
placeholder: searchPlaceholder,
|
|
1596
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(IconSearch, {}),
|
|
1597
|
+
iconRight: searchInput.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(IconClose, { onClick: () => onSearchChange("") }),
|
|
1598
|
+
value: searchInput,
|
|
1599
|
+
onChange: (e) => onSearchChange(e.target.value),
|
|
1600
|
+
onFocus: () => onActiveSearchChange(searchInput)
|
|
1601
|
+
}
|
|
1602
|
+
)
|
|
1704
1603
|
}
|
|
1705
1604
|
);
|
|
1706
1605
|
}
|
|
1707
|
-
return /* @__PURE__ */ (0,
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
),
|
|
1716
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_navigation_menu2.NavigationMenu.Content, { className: menuModalStyleClass, children: [
|
|
1717
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: modalHeaderClass, children: searchPlaceholder }),
|
|
1718
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: itemsListClass, children: [
|
|
1719
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1720
|
-
Input,
|
|
1606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1607
|
+
import_navigation_menu3.NavigationMenu.Item,
|
|
1608
|
+
{
|
|
1609
|
+
value: SEARCH_NAV_VALUE,
|
|
1610
|
+
className: menuItemWrapperClass,
|
|
1611
|
+
children: [
|
|
1612
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1613
|
+
import_navigation_menu3.NavigationMenu.Trigger,
|
|
1721
1614
|
{
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
IconClose,
|
|
1726
|
-
{
|
|
1727
|
-
style: { cursor: "pointer" },
|
|
1728
|
-
onClick: () => setInnerSearch("")
|
|
1729
|
-
}
|
|
1730
|
-
),
|
|
1731
|
-
value: innerSearch,
|
|
1732
|
-
onChange: (e) => setInnerSearch(e.target.value)
|
|
1615
|
+
nativeButton: false,
|
|
1616
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: searchContainerClass, id: "menu-item/search" }),
|
|
1617
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(IconSearch, {})
|
|
1733
1618
|
}
|
|
1734
1619
|
),
|
|
1735
|
-
|
|
1736
|
-
|
|
1620
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1621
|
+
import_navigation_menu3.NavigationMenu.Content,
|
|
1737
1622
|
{
|
|
1738
|
-
className:
|
|
1739
|
-
|
|
1740
|
-
|
|
1623
|
+
className: menuModalStyleClass,
|
|
1624
|
+
onMouseEnter: () => {
|
|
1625
|
+
popupHoveredRef.current = true;
|
|
1626
|
+
},
|
|
1627
|
+
onMouseLeave: () => {
|
|
1628
|
+
popupHoveredRef.current = false;
|
|
1629
|
+
},
|
|
1630
|
+
children: [
|
|
1631
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: modalHeaderClass, children: searchPlaceholder }),
|
|
1632
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: itemsListClass, children: [
|
|
1633
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1634
|
+
Input,
|
|
1635
|
+
{
|
|
1636
|
+
placeholder: searchPlaceholder,
|
|
1637
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(IconSearch, {}),
|
|
1638
|
+
iconRight: innerSearch.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1639
|
+
IconClose,
|
|
1640
|
+
{
|
|
1641
|
+
style: { cursor: "pointer" },
|
|
1642
|
+
onClick: () => setInnerSearch("")
|
|
1643
|
+
}
|
|
1644
|
+
),
|
|
1645
|
+
value: innerSearch,
|
|
1646
|
+
onChange: (e) => setInnerSearch(e.target.value),
|
|
1647
|
+
onFocus: () => onInputFocus == null ? void 0 : onInputFocus(),
|
|
1648
|
+
onBlur: () => onInputBlur == null ? void 0 : onInputBlur(popupHoveredRef.current)
|
|
1649
|
+
}
|
|
1650
|
+
),
|
|
1651
|
+
innerSearch && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ScrollArea, { maxHeight: "calc(100vh - 120px)", children: filtered.length > 0 ? filtered.map((subitem) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MenuSubitem, { subitem }, subitem.key)) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1652
|
+
"span",
|
|
1653
|
+
{
|
|
1654
|
+
className: nothingFoundSpanClass,
|
|
1655
|
+
style: { textAlign: "center" },
|
|
1656
|
+
children: searchEmptyMessage
|
|
1657
|
+
}
|
|
1658
|
+
) })
|
|
1659
|
+
] })
|
|
1660
|
+
]
|
|
1741
1661
|
}
|
|
1742
|
-
)
|
|
1743
|
-
]
|
|
1744
|
-
|
|
1745
|
-
|
|
1662
|
+
)
|
|
1663
|
+
]
|
|
1664
|
+
}
|
|
1665
|
+
);
|
|
1746
1666
|
};
|
|
1747
1667
|
|
|
1748
1668
|
// src/components/CollapsableMenu/index.tsx
|
|
1749
|
-
var
|
|
1750
|
-
var
|
|
1669
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1670
|
+
var BodyNavigationMenu = ({
|
|
1671
|
+
bodyItems,
|
|
1672
|
+
renderMenuItem,
|
|
1673
|
+
searchInput,
|
|
1674
|
+
onSearchChange,
|
|
1675
|
+
onActiveSearchChange,
|
|
1676
|
+
searchItems,
|
|
1677
|
+
searchPlaceholder,
|
|
1678
|
+
searchEmptyMessage
|
|
1679
|
+
}) => {
|
|
1680
|
+
const [navValue, setNavValue] = (0, import_react10.useState)("");
|
|
1681
|
+
const searchInputFocusedRef = (0, import_react10.useRef)(false);
|
|
1682
|
+
const handleInputFocus = (0, import_react10.useCallback)(() => {
|
|
1683
|
+
searchInputFocusedRef.current = true;
|
|
1684
|
+
setNavValue("search");
|
|
1685
|
+
}, []);
|
|
1686
|
+
const handleInputBlur = (0, import_react10.useCallback)((popupHovered) => {
|
|
1687
|
+
searchInputFocusedRef.current = false;
|
|
1688
|
+
if (!popupHovered) setNavValue("");
|
|
1689
|
+
}, []);
|
|
1690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1691
|
+
import_navigation_menu4.NavigationMenu.Root,
|
|
1692
|
+
{
|
|
1693
|
+
delay: 0,
|
|
1694
|
+
closeDelay: 100,
|
|
1695
|
+
orientation: "vertical",
|
|
1696
|
+
value: navValue,
|
|
1697
|
+
onValueChange: (val) => {
|
|
1698
|
+
if (!val && searchInputFocusedRef.current) return;
|
|
1699
|
+
setNavValue(val);
|
|
1700
|
+
},
|
|
1701
|
+
children: [
|
|
1702
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_navigation_menu4.NavigationMenu.List, { children: [
|
|
1703
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1704
|
+
MenuSearch,
|
|
1705
|
+
{
|
|
1706
|
+
sideBarOpen: false,
|
|
1707
|
+
searchInput,
|
|
1708
|
+
onSearchChange,
|
|
1709
|
+
onActiveSearchChange,
|
|
1710
|
+
searchItems,
|
|
1711
|
+
searchPlaceholder,
|
|
1712
|
+
searchEmptyMessage,
|
|
1713
|
+
onInputFocus: handleInputFocus,
|
|
1714
|
+
onInputBlur: handleInputBlur
|
|
1715
|
+
}
|
|
1716
|
+
),
|
|
1717
|
+
bodyItems.map(renderMenuItem)
|
|
1718
|
+
] }),
|
|
1719
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_navigation_menu4.NavigationMenu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1720
|
+
import_navigation_menu4.NavigationMenu.Positioner,
|
|
1721
|
+
{
|
|
1722
|
+
sideOffset: 4,
|
|
1723
|
+
side: "right",
|
|
1724
|
+
align: "start",
|
|
1725
|
+
collisionAvoidance: { align: "none" },
|
|
1726
|
+
style: { zIndex: 10 },
|
|
1727
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_navigation_menu4.NavigationMenu.Popup, { className: menuPopupWrapperClass, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_navigation_menu4.NavigationMenu.Viewport, { className: menuViewportClass }) })
|
|
1728
|
+
}
|
|
1729
|
+
) })
|
|
1730
|
+
]
|
|
1731
|
+
}
|
|
1732
|
+
);
|
|
1733
|
+
};
|
|
1734
|
+
var CollapsableMenu = (0, import_react10.forwardRef)(
|
|
1751
1735
|
({
|
|
1752
1736
|
menuObject,
|
|
1753
1737
|
defaultSideBarOpen,
|
|
@@ -1761,25 +1745,25 @@ var CollapsableMenu = (0, import_react12.forwardRef)(
|
|
|
1761
1745
|
defaultSideBarOpen,
|
|
1762
1746
|
onSideBarToggle
|
|
1763
1747
|
);
|
|
1764
|
-
const itemsFormattedToSearch = (0,
|
|
1748
|
+
const itemsFormattedToSearch = (0, import_react10.useMemo)(
|
|
1765
1749
|
() => formatSearchItems(menuObject.categories),
|
|
1766
1750
|
[menuObject.categories]
|
|
1767
1751
|
);
|
|
1768
|
-
const searchItemsFiltered = (0,
|
|
1752
|
+
const searchItemsFiltered = (0, import_react10.useMemo)(
|
|
1769
1753
|
() => itemsFormattedToSearch.filter(
|
|
1770
1754
|
(item) => filterItems(item, state.searchInput)
|
|
1771
1755
|
),
|
|
1772
1756
|
[itemsFormattedToSearch, state.searchInput]
|
|
1773
1757
|
);
|
|
1774
|
-
const { footerItems, bodyItems } = (0,
|
|
1758
|
+
const { footerItems, bodyItems } = (0, import_react10.useMemo)(() => {
|
|
1775
1759
|
const filtered = filterSidebarItems(menuObject.categories);
|
|
1776
1760
|
return {
|
|
1777
1761
|
footerItems: filtered.filter((item) => item.barPosition === "footer"),
|
|
1778
1762
|
bodyItems: filtered.filter((item) => !item.barPosition)
|
|
1779
1763
|
};
|
|
1780
1764
|
}, [menuObject.categories]);
|
|
1781
|
-
const renderMenuItem = (0,
|
|
1782
|
-
(item, index) => /* @__PURE__ */ (0,
|
|
1765
|
+
const renderMenuItem = (0, import_react10.useCallback)(
|
|
1766
|
+
(item, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1783
1767
|
MenuItem,
|
|
1784
1768
|
{
|
|
1785
1769
|
item,
|
|
@@ -1793,7 +1777,7 @@ var CollapsableMenu = (0, import_react12.forwardRef)(
|
|
|
1793
1777
|
),
|
|
1794
1778
|
[state.sideBarOpen, state.categoryOpen, actions]
|
|
1795
1779
|
);
|
|
1796
|
-
return /* @__PURE__ */ (0,
|
|
1780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MenuProvider, { component: subitemComponent, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1797
1781
|
"div",
|
|
1798
1782
|
{
|
|
1799
1783
|
ref,
|
|
@@ -1802,7 +1786,7 @@ var CollapsableMenu = (0, import_react12.forwardRef)(
|
|
|
1802
1786
|
"aria-label": "Menu principal",
|
|
1803
1787
|
...props,
|
|
1804
1788
|
children: [
|
|
1805
|
-
/* @__PURE__ */ (0,
|
|
1789
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1806
1790
|
MenuHeader,
|
|
1807
1791
|
{
|
|
1808
1792
|
sideBarOpen: state.sideBarOpen,
|
|
@@ -1810,8 +1794,8 @@ var CollapsableMenu = (0, import_react12.forwardRef)(
|
|
|
1810
1794
|
onToggleSidebar: actions.toggleSidebar
|
|
1811
1795
|
}
|
|
1812
1796
|
),
|
|
1813
|
-
/* @__PURE__ */ (0,
|
|
1814
|
-
/* @__PURE__ */ (0,
|
|
1797
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: menuBodyClass, children: state.sideBarOpen ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(ScrollArea, { maxHeight: "calc(100vh - 48px)", children: [
|
|
1798
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1815
1799
|
MenuSearch,
|
|
1816
1800
|
{
|
|
1817
1801
|
sideBarOpen: state.sideBarOpen,
|
|
@@ -1823,7 +1807,7 @@ var CollapsableMenu = (0, import_react12.forwardRef)(
|
|
|
1823
1807
|
searchEmptyMessage
|
|
1824
1808
|
}
|
|
1825
1809
|
),
|
|
1826
|
-
/* @__PURE__ */ (0,
|
|
1810
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1827
1811
|
MenuContent,
|
|
1828
1812
|
{
|
|
1829
1813
|
activeSearch: state.activeSearch,
|
|
@@ -1834,57 +1818,35 @@ var CollapsableMenu = (0, import_react12.forwardRef)(
|
|
|
1834
1818
|
renderMenuItem
|
|
1835
1819
|
}
|
|
1836
1820
|
)
|
|
1837
|
-
] }) : /* @__PURE__ */ (0,
|
|
1838
|
-
|
|
1821
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1822
|
+
BodyNavigationMenu,
|
|
1839
1823
|
{
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
sideBarOpen: state.sideBarOpen,
|
|
1849
|
-
searchInput: state.searchInput,
|
|
1850
|
-
onSearchChange: actions.setSearchInput,
|
|
1851
|
-
onActiveSearchChange: actions.setActiveSearch,
|
|
1852
|
-
searchItems: itemsFormattedToSearch,
|
|
1853
|
-
searchPlaceholder,
|
|
1854
|
-
searchEmptyMessage
|
|
1855
|
-
}
|
|
1856
|
-
),
|
|
1857
|
-
bodyItems.map(renderMenuItem)
|
|
1858
|
-
] }),
|
|
1859
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_navigation_menu3.NavigationMenu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1860
|
-
import_navigation_menu3.NavigationMenu.Positioner,
|
|
1861
|
-
{
|
|
1862
|
-
sideOffset: 4,
|
|
1863
|
-
side: "right",
|
|
1864
|
-
align: "start",
|
|
1865
|
-
collisionAvoidance: { align: "none" },
|
|
1866
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_navigation_menu3.NavigationMenu.Popup, { className: menuPopupWrapperClass, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_navigation_menu3.NavigationMenu.Viewport, { className: menuViewportClass }) })
|
|
1867
|
-
}
|
|
1868
|
-
) })
|
|
1869
|
-
]
|
|
1824
|
+
bodyItems,
|
|
1825
|
+
renderMenuItem,
|
|
1826
|
+
searchInput: state.searchInput,
|
|
1827
|
+
onSearchChange: actions.setSearchInput,
|
|
1828
|
+
onActiveSearchChange: actions.setActiveSearch,
|
|
1829
|
+
searchItems: itemsFormattedToSearch,
|
|
1830
|
+
searchPlaceholder,
|
|
1831
|
+
searchEmptyMessage
|
|
1870
1832
|
}
|
|
1871
1833
|
) }),
|
|
1872
|
-
/* @__PURE__ */ (0,
|
|
1873
|
-
|
|
1834
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: menuFooterClass, children: state.sideBarOpen ? footerItems.map(renderMenuItem) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1835
|
+
import_navigation_menu4.NavigationMenu.Root,
|
|
1874
1836
|
{
|
|
1875
1837
|
delay: 100,
|
|
1876
1838
|
closeDelay: 150,
|
|
1877
1839
|
orientation: "vertical",
|
|
1878
1840
|
children: [
|
|
1879
|
-
/* @__PURE__ */ (0,
|
|
1880
|
-
/* @__PURE__ */ (0,
|
|
1881
|
-
|
|
1841
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_navigation_menu4.NavigationMenu.List, { children: footerItems.map(renderMenuItem) }),
|
|
1842
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_navigation_menu4.NavigationMenu.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1843
|
+
import_navigation_menu4.NavigationMenu.Positioner,
|
|
1882
1844
|
{
|
|
1883
1845
|
sideOffset: 4,
|
|
1884
1846
|
side: "right",
|
|
1885
1847
|
align: "start",
|
|
1886
1848
|
collisionAvoidance: { align: "none" },
|
|
1887
|
-
children: /* @__PURE__ */ (0,
|
|
1849
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_navigation_menu4.NavigationMenu.Popup, { className: menuPopupWrapperClass, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_navigation_menu4.NavigationMenu.Viewport, { className: menuViewportClass }) })
|
|
1888
1850
|
}
|
|
1889
1851
|
) })
|
|
1890
1852
|
]
|