analytica-frontend-lib 1.0.53 → 1.0.55
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/Card/index.js +5 -5
- package/dist/Card/index.js.map +1 -1
- package/dist/Card/index.mjs +5 -5
- package/dist/Card/index.mjs.map +1 -1
- package/dist/DropdownMenu/index.d.mts +2 -2
- package/dist/DropdownMenu/index.d.ts +2 -2
- package/dist/DropdownMenu/index.js +4 -4
- package/dist/DropdownMenu/index.js.map +1 -1
- package/dist/DropdownMenu/index.mjs +3 -3
- package/dist/DropdownMenu/index.mjs.map +1 -1
- package/dist/Menu/index.d.mts +12 -6
- package/dist/Menu/index.d.ts +12 -6
- package/dist/Menu/index.js +30 -9
- package/dist/Menu/index.js.map +1 -1
- package/dist/Menu/index.mjs +29 -9
- package/dist/Menu/index.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +119 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +117 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -21,9 +21,9 @@ export { default as ProgressCircle } from './ProgressCircle/index.js';
|
|
|
21
21
|
export { default as Stepper } from './Stepper/index.js';
|
|
22
22
|
export { default as Calendar } from './Calendar/index.js';
|
|
23
23
|
export { default as Modal } from './Modal/index.js';
|
|
24
|
-
export { default as DropdownMenu, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger,
|
|
24
|
+
export { default as DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, MenuLabel, ProfileMenuFooter, ProfileMenuHeader, ProfileMenuSection, ProfileMenuTrigger } from './DropdownMenu/index.js';
|
|
25
25
|
export { default as Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './Select/index.js';
|
|
26
|
-
export { default as Menu, MenuItem, MenuSeparator } from './Menu/index.js';
|
|
26
|
+
export { default as Menu, MenuContent, MenuItem, MenuOverflow, MenuSeparator } from './Menu/index.js';
|
|
27
27
|
export { CardActivesResults, CardPerformance, CardProgress, CardQuestions, CardResults, CardStatus, CardTopic } from './Card/index.js';
|
|
28
28
|
import 'react/jsx-runtime';
|
|
29
29
|
import 'react';
|
package/dist/index.js
CHANGED
|
@@ -35,6 +35,7 @@ __export(src_exports, {
|
|
|
35
35
|
Chips: () => Chips_default,
|
|
36
36
|
Divider: () => Divider_default,
|
|
37
37
|
DropdownMenu: () => DropdownMenu_default,
|
|
38
|
+
DropdownMenuContent: () => DropdownMenuContent,
|
|
38
39
|
DropdownMenuItem: () => DropdownMenuItem,
|
|
39
40
|
DropdownMenuSeparator: () => DropdownMenuSeparator,
|
|
40
41
|
DropdownMenuTrigger: () => DropdownMenuTrigger,
|
|
@@ -45,6 +46,7 @@ __export(src_exports, {
|
|
|
45
46
|
MenuContent: () => MenuContent,
|
|
46
47
|
MenuItem: () => MenuItem,
|
|
47
48
|
MenuLabel: () => MenuLabel,
|
|
49
|
+
MenuOverflow: () => MenuOverflow,
|
|
48
50
|
MenuSeparator: () => MenuSeparator,
|
|
49
51
|
Modal: () => Modal_default,
|
|
50
52
|
NavButton: () => NavButton_default,
|
|
@@ -3137,7 +3139,7 @@ var MenuLabel = (0, import_react11.forwardRef)(({ className, inset, store: _stor
|
|
|
3137
3139
|
);
|
|
3138
3140
|
});
|
|
3139
3141
|
MenuLabel.displayName = "MenuLabel";
|
|
3140
|
-
var
|
|
3142
|
+
var DropdownMenuContent = (0, import_react11.forwardRef)(
|
|
3141
3143
|
({
|
|
3142
3144
|
className,
|
|
3143
3145
|
align = "start",
|
|
@@ -3190,7 +3192,7 @@ var MenuContent = (0, import_react11.forwardRef)(
|
|
|
3190
3192
|
);
|
|
3191
3193
|
}
|
|
3192
3194
|
);
|
|
3193
|
-
|
|
3195
|
+
DropdownMenuContent.displayName = "DropdownMenuContent";
|
|
3194
3196
|
var DropdownMenuItem = (0, import_react11.forwardRef)(
|
|
3195
3197
|
({
|
|
3196
3198
|
className,
|
|
@@ -3703,7 +3705,7 @@ var useMenuStore = (externalStore) => {
|
|
|
3703
3705
|
};
|
|
3704
3706
|
var VARIANT_CLASSES5 = {
|
|
3705
3707
|
menu: "bg-background shadow-soft-shadow-1",
|
|
3706
|
-
menu2: "
|
|
3708
|
+
menu2: "",
|
|
3707
3709
|
breadcrumb: ""
|
|
3708
3710
|
};
|
|
3709
3711
|
var Menu = (0, import_react13.forwardRef)(
|
|
@@ -3726,10 +3728,10 @@ var Menu = (0, import_react13.forwardRef)(
|
|
|
3726
3728
|
(0, import_react13.useEffect)(() => {
|
|
3727
3729
|
onValueChange?.(value);
|
|
3728
3730
|
}, [value, onValueChange]);
|
|
3729
|
-
const baseClasses = "w-full flex flex-row items-center
|
|
3731
|
+
const baseClasses = "w-full py-2 px-6 flex flex-row items-center justify-center";
|
|
3730
3732
|
const variantClasses = VARIANT_CLASSES5[variant];
|
|
3731
3733
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3732
|
-
"
|
|
3734
|
+
"div",
|
|
3733
3735
|
{
|
|
3734
3736
|
ref,
|
|
3735
3737
|
className: `
|
|
@@ -3737,7 +3739,6 @@ var Menu = (0, import_react13.forwardRef)(
|
|
|
3737
3739
|
${variantClasses}
|
|
3738
3740
|
${className ?? ""}
|
|
3739
3741
|
`,
|
|
3740
|
-
style: variant === "menu2" ? { scrollbarWidth: "none", msOverflowStyle: "none" } : void 0,
|
|
3741
3742
|
...props,
|
|
3742
3743
|
children: injectStore3(children, store)
|
|
3743
3744
|
}
|
|
@@ -3745,6 +3746,27 @@ var Menu = (0, import_react13.forwardRef)(
|
|
|
3745
3746
|
}
|
|
3746
3747
|
);
|
|
3747
3748
|
Menu.displayName = "Menu";
|
|
3749
|
+
var MenuContent = (0, import_react13.forwardRef)(
|
|
3750
|
+
({ className, children, variant = "menu", ...props }, ref) => {
|
|
3751
|
+
const baseClasses = "w-full flex flex-row items-center gap-2";
|
|
3752
|
+
const variantClasses = variant === "menu2" ? "overflow-x-auto scroll-smooth" : "";
|
|
3753
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3754
|
+
"ul",
|
|
3755
|
+
{
|
|
3756
|
+
ref,
|
|
3757
|
+
className: `
|
|
3758
|
+
${baseClasses}
|
|
3759
|
+
${variantClasses}
|
|
3760
|
+
${className ?? ""}
|
|
3761
|
+
`,
|
|
3762
|
+
style: variant === "menu2" ? { scrollbarWidth: "none", msOverflowStyle: "none" } : void 0,
|
|
3763
|
+
...props,
|
|
3764
|
+
children
|
|
3765
|
+
}
|
|
3766
|
+
);
|
|
3767
|
+
}
|
|
3768
|
+
);
|
|
3769
|
+
MenuContent.displayName = "MenuContent";
|
|
3748
3770
|
var MenuItem = (0, import_react13.forwardRef)(
|
|
3749
3771
|
({
|
|
3750
3772
|
className,
|
|
@@ -3845,6 +3867,90 @@ var MenuSeparator = (0, import_react13.forwardRef)(
|
|
|
3845
3867
|
)
|
|
3846
3868
|
);
|
|
3847
3869
|
MenuSeparator.displayName = "MenuSeparator";
|
|
3870
|
+
var internalScroll = (container, direction) => {
|
|
3871
|
+
if (!container) return;
|
|
3872
|
+
container.scrollBy({
|
|
3873
|
+
left: direction === "left" ? -150 : 150,
|
|
3874
|
+
behavior: "smooth"
|
|
3875
|
+
});
|
|
3876
|
+
};
|
|
3877
|
+
var internalCheckScroll = (container, setShowLeftArrow, setShowRightArrow) => {
|
|
3878
|
+
if (!container) return;
|
|
3879
|
+
const { scrollLeft, scrollWidth, clientWidth } = container;
|
|
3880
|
+
setShowLeftArrow(scrollLeft > 0);
|
|
3881
|
+
setShowRightArrow(scrollLeft + clientWidth < scrollWidth);
|
|
3882
|
+
};
|
|
3883
|
+
var MenuOverflow = ({
|
|
3884
|
+
children,
|
|
3885
|
+
className,
|
|
3886
|
+
defaultValue,
|
|
3887
|
+
value,
|
|
3888
|
+
onValueChange,
|
|
3889
|
+
...props
|
|
3890
|
+
}) => {
|
|
3891
|
+
const containerRef = (0, import_react13.useRef)(null);
|
|
3892
|
+
const [showLeftArrow, setShowLeftArrow] = (0, import_react13.useState)(false);
|
|
3893
|
+
const [showRightArrow, setShowRightArrow] = (0, import_react13.useState)(false);
|
|
3894
|
+
(0, import_react13.useEffect)(() => {
|
|
3895
|
+
const checkScroll = () => internalCheckScroll(
|
|
3896
|
+
containerRef.current,
|
|
3897
|
+
setShowLeftArrow,
|
|
3898
|
+
setShowRightArrow
|
|
3899
|
+
);
|
|
3900
|
+
checkScroll();
|
|
3901
|
+
const container = containerRef.current;
|
|
3902
|
+
container?.addEventListener("scroll", checkScroll);
|
|
3903
|
+
window.addEventListener("resize", checkScroll);
|
|
3904
|
+
return () => {
|
|
3905
|
+
container?.removeEventListener("scroll", checkScroll);
|
|
3906
|
+
window.removeEventListener("resize", checkScroll);
|
|
3907
|
+
};
|
|
3908
|
+
}, []);
|
|
3909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
3910
|
+
"div",
|
|
3911
|
+
{
|
|
3912
|
+
"data-testid": "menu-overflow-wrapper",
|
|
3913
|
+
className: `relative w-full overflow-hidden ${className ?? ""}`,
|
|
3914
|
+
children: [
|
|
3915
|
+
showLeftArrow && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
3916
|
+
"button",
|
|
3917
|
+
{
|
|
3918
|
+
onClick: () => internalScroll(containerRef.current, "left"),
|
|
3919
|
+
className: "absolute left-0 top-1/2 -translate-y-1/2 z-10 flex h-8 w-8 items-center justify-center rounded-full bg-white shadow-md cursor-pointer",
|
|
3920
|
+
"data-testid": "scroll-left-button",
|
|
3921
|
+
children: [
|
|
3922
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_phosphor_react12.CaretLeft, { size: 16 }),
|
|
3923
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "sr-only", children: "Scroll left" })
|
|
3924
|
+
]
|
|
3925
|
+
}
|
|
3926
|
+
),
|
|
3927
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3928
|
+
Menu,
|
|
3929
|
+
{
|
|
3930
|
+
defaultValue,
|
|
3931
|
+
onValueChange,
|
|
3932
|
+
value,
|
|
3933
|
+
variant: "menu2",
|
|
3934
|
+
...props,
|
|
3935
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MenuContent, { ref: containerRef, variant: "menu2", children })
|
|
3936
|
+
}
|
|
3937
|
+
),
|
|
3938
|
+
showRightArrow && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
3939
|
+
"button",
|
|
3940
|
+
{
|
|
3941
|
+
onClick: () => internalScroll(containerRef.current, "right"),
|
|
3942
|
+
className: "absolute right-0 top-1/2 -translate-y-1/2 z-10 flex h-8 w-8 items-center justify-center rounded-full bg-white shadow-md cursor-pointer",
|
|
3943
|
+
"data-testid": "scroll-right-button",
|
|
3944
|
+
children: [
|
|
3945
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_phosphor_react12.CaretRight, { size: 16 }),
|
|
3946
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "sr-only", children: "Scroll right" })
|
|
3947
|
+
]
|
|
3948
|
+
}
|
|
3949
|
+
)
|
|
3950
|
+
]
|
|
3951
|
+
}
|
|
3952
|
+
);
|
|
3953
|
+
};
|
|
3848
3954
|
var injectStore3 = (children, store) => import_react13.Children.map(children, (child) => {
|
|
3849
3955
|
if (!(0, import_react13.isValidElement)(child)) return child;
|
|
3850
3956
|
const typedChild = child;
|
|
@@ -3904,7 +4010,7 @@ var CardActivesResults = (0, import_react14.forwardRef)(
|
|
|
3904
4010
|
"div",
|
|
3905
4011
|
{
|
|
3906
4012
|
ref,
|
|
3907
|
-
className: `w-full flex flex-col border border-border-50
|
|
4013
|
+
className: `w-full flex flex-col border border-border-50 bg-background rounded-xl ${className}`,
|
|
3908
4014
|
...props,
|
|
3909
4015
|
children: [
|
|
3910
4016
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
@@ -4038,7 +4144,7 @@ var CardProgress = (0, import_react14.forwardRef)(
|
|
|
4038
4144
|
{
|
|
4039
4145
|
ref,
|
|
4040
4146
|
className: `
|
|
4041
|
-
w-full flex border border-border-50 rounded-xl
|
|
4147
|
+
w-full flex border border-border-50 bg-background rounded-xl
|
|
4042
4148
|
${isHorizontal ? "flex-row h-20" : "flex-col"}
|
|
4043
4149
|
${className}
|
|
4044
4150
|
`,
|
|
@@ -4088,7 +4194,7 @@ var CardTopic = (0, import_react14.forwardRef)(
|
|
|
4088
4194
|
"div",
|
|
4089
4195
|
{
|
|
4090
4196
|
ref,
|
|
4091
|
-
className: `w-full py-2 px-4 flex flex-col justify-center gap-2 border border-border-50 rounded-xl min-h-20 ${className}`,
|
|
4197
|
+
className: `w-full py-2 px-4 flex flex-col justify-center gap-2 bg-background border border-border-50 rounded-xl min-h-20 ${className}`,
|
|
4092
4198
|
...props,
|
|
4093
4199
|
children: [
|
|
4094
4200
|
subHead && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-text-600 text-2xs flex flex-row gap-1", children: subHead.map((text, index) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_react14.Fragment, { children: [
|
|
@@ -4165,7 +4271,7 @@ var CardResults = (0, import_react14.forwardRef)(
|
|
|
4165
4271
|
{
|
|
4166
4272
|
ref,
|
|
4167
4273
|
className: `
|
|
4168
|
-
w-full flex border border-border-50 rounded-xl min-h-20 flex-row items-center pr-4
|
|
4274
|
+
w-full flex border border-border-50 bg-background rounded-xl min-h-20 flex-row items-center pr-4
|
|
4169
4275
|
${className}
|
|
4170
4276
|
`,
|
|
4171
4277
|
...props,
|
|
@@ -4235,7 +4341,7 @@ var CardStatus = (0, import_react14.forwardRef)(
|
|
|
4235
4341
|
{
|
|
4236
4342
|
ref,
|
|
4237
4343
|
className: `
|
|
4238
|
-
w-full flex border border-border-50 rounded-xl min-h-20 flex-row items-center pr-4
|
|
4344
|
+
w-full flex border border-border-50 bg-background rounded-xl min-h-20 flex-row items-center pr-4
|
|
4239
4345
|
${className}
|
|
4240
4346
|
`,
|
|
4241
4347
|
...props,
|
|
@@ -4394,6 +4500,7 @@ var CardForum = (0, import_react14.forwardRef)(
|
|
|
4394
4500
|
Chips,
|
|
4395
4501
|
Divider,
|
|
4396
4502
|
DropdownMenu,
|
|
4503
|
+
DropdownMenuContent,
|
|
4397
4504
|
DropdownMenuItem,
|
|
4398
4505
|
DropdownMenuSeparator,
|
|
4399
4506
|
DropdownMenuTrigger,
|
|
@@ -4404,6 +4511,7 @@ var CardForum = (0, import_react14.forwardRef)(
|
|
|
4404
4511
|
MenuContent,
|
|
4405
4512
|
MenuItem,
|
|
4406
4513
|
MenuLabel,
|
|
4514
|
+
MenuOverflow,
|
|
4407
4515
|
MenuSeparator,
|
|
4408
4516
|
Modal,
|
|
4409
4517
|
NavButton,
|