analytica-frontend-lib 1.0.63 → 1.0.64

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/index.d.mts CHANGED
@@ -23,7 +23,7 @@ export { default as Calendar } from './Calendar/index.mjs';
23
23
  export { default as Modal } from './Modal/index.mjs';
24
24
  export { default as DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, MenuLabel, ProfileMenuFooter, ProfileMenuHeader, ProfileMenuSection, ProfileMenuTrigger } from './DropdownMenu/index.mjs';
25
25
  export { default as Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './Select/index.mjs';
26
- export { default as Menu, MenuContent, MenuItem, MenuOverflow, MenuSeparator } from './Menu/index.mjs';
26
+ export { default as Menu, MenuContent, MenuItem, MenuOverflow } from './Menu/index.mjs';
27
27
  export { CardActivitiesResults, CardPerformance, CardProgress, CardQuestions, CardResults, CardStatus, CardTopic } from './Card/index.mjs';
28
28
  export { Skeleton, SkeletonCard, SkeletonCircle, SkeletonList, SkeletonRectangle, SkeletonRounded, SkeletonTable, SkeletonText } from './Skeleton/index.mjs';
29
29
  import 'react/jsx-runtime';
package/dist/index.d.ts CHANGED
@@ -23,7 +23,7 @@ export { default as Calendar } from './Calendar/index.js';
23
23
  export { default as Modal } from './Modal/index.js';
24
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, MenuContent, MenuItem, MenuOverflow, MenuSeparator } from './Menu/index.js';
26
+ export { default as Menu, MenuContent, MenuItem, MenuOverflow } from './Menu/index.js';
27
27
  export { CardActivitiesResults, CardPerformance, CardProgress, CardQuestions, CardResults, CardStatus, CardTopic } from './Card/index.js';
28
28
  export { Skeleton, SkeletonCard, SkeletonCircle, SkeletonList, SkeletonRectangle, SkeletonRounded, SkeletonTable, SkeletonText } from './Skeleton/index.js';
29
29
  import 'react/jsx-runtime';
package/dist/index.js CHANGED
@@ -47,7 +47,6 @@ __export(src_exports, {
47
47
  MenuItem: () => MenuItem,
48
48
  MenuLabel: () => MenuLabel,
49
49
  MenuOverflow: () => MenuOverflow,
50
- MenuSeparator: () => MenuSeparator,
51
50
  Modal: () => Modal_default,
52
51
  NavButton: () => NavButton_default,
53
52
  ProfileMenuFooter: () => ProfileMenuFooter,
@@ -2583,16 +2582,16 @@ var Calendar = ({
2583
2582
  onDateSelect?.(day.date);
2584
2583
  };
2585
2584
  if (variant === "navigation") {
2586
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: `bg-background rounded-xl p-3 ${className}`, children: [
2585
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: `bg-background rounded-xl pt-6 ${className}`, children: [
2587
2586
  /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center justify-between mb-4 px-6", children: [
2588
2587
  /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "relative", ref: monthPickerContainerRef, children: [
2589
2588
  /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
2590
2589
  "button",
2591
2590
  {
2592
2591
  onClick: toggleMonthPicker,
2593
- className: "flex items-center gap-1 hover:bg-background-100 rounded px-2 py-1 transition-colors",
2592
+ className: "flex items-center group gap-1 rounded transition-colors cursor-pointer",
2594
2593
  children: [
2595
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "text-sm font-medium text-text-600", children: [
2594
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "text-sm font-medium text-text-600 group-hover:text-primary-950", children: [
2596
2595
  MONTH_NAMES[currentDate.getMonth()],
2597
2596
  " ",
2598
2597
  currentDate.getFullYear()
@@ -2684,7 +2683,7 @@ var Calendar = ({
2684
2683
  )
2685
2684
  ] })
2686
2685
  ] }),
2687
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "grid grid-cols-7 gap-1 mb-2", children: WEEK_DAYS_SHORT.map((day, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2686
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "grid grid-cols-7 gap-1 mb-2 px-3", children: WEEK_DAYS_SHORT.map((day, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2688
2687
  "div",
2689
2688
  {
2690
2689
  className: "h-9 flex items-center justify-center text-xs font-normal text-text-600",
@@ -2692,7 +2691,7 @@ var Calendar = ({
2692
2691
  },
2693
2692
  `${day}-${index}`
2694
2693
  )) }),
2695
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "grid grid-cols-7 gap-1", children: calendarData.map((day) => {
2694
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "grid grid-cols-7 gap-1 px-3", children: calendarData.map((day) => {
2696
2695
  if (!day.isCurrentMonth) {
2697
2696
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2698
2697
  "div",
@@ -3281,7 +3280,7 @@ var ProfileMenuTrigger = (0, import_react11.forwardRef)(({ className, onClick, s
3281
3280
  "button",
3282
3281
  {
3283
3282
  ref,
3284
- className: `rounded-lg size-10 bg-background-50 flex items-center justify-center ${className}`,
3283
+ className: `rounded-lg size-10 bg-primary-50 flex items-center justify-center cursor-pointer ${className}`,
3285
3284
  onClick: (e) => {
3286
3285
  e.stopPropagation();
3287
3286
  toggleOpen();
@@ -3289,7 +3288,7 @@ var ProfileMenuTrigger = (0, import_react11.forwardRef)(({ className, onClick, s
3289
3288
  },
3290
3289
  "aria-expanded": open,
3291
3290
  ...props,
3292
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "size-6 rounded-full bg-background-100 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_phosphor_react10.User, { className: "text-background-950", size: 18 }) })
3291
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "size-6 rounded-full bg-primary-100 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_phosphor_react10.User, { className: "text-primary-950", size: 18 }) })
3293
3292
  }
3294
3293
  );
3295
3294
  });
@@ -3306,7 +3305,7 @@ var ProfileMenuHeader = (0, import_react11.forwardRef)(({ className, name, email
3306
3305
  `,
3307
3306
  ...props,
3308
3307
  children: [
3309
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "size-16 bg-background-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_phosphor_react10.User, { size: 34, className: "text-background-950" }) }),
3308
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "size-16 bg-primary-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_phosphor_react10.User, { size: 34, className: "text-primary-950" }) }),
3310
3309
  /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex flex-col ", children: [
3311
3310
  /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-xl font-bold text-text-950", children: name }),
3312
3311
  /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-md text-text-600", children: email })
@@ -3702,9 +3701,13 @@ var import_zustand4 = require("zustand");
3702
3701
  var import_react13 = require("react");
3703
3702
  var import_phosphor_react12 = require("phosphor-react");
3704
3703
  var import_jsx_runtime25 = require("react/jsx-runtime");
3705
- var createMenuStore = () => (0, import_zustand4.create)((set) => ({
3704
+ var createMenuStore = (onValueChange) => (0, import_zustand4.create)((set) => ({
3706
3705
  value: "",
3707
- setValue: (value) => set({ value })
3706
+ setValue: (value) => {
3707
+ set({ value });
3708
+ onValueChange?.(value);
3709
+ },
3710
+ onValueChange
3708
3711
  }));
3709
3712
  var useMenuStore = (externalStore) => {
3710
3713
  if (!externalStore) throw new Error("MenuItem must be inside Menu");
@@ -3726,22 +3729,12 @@ var Menu = (0, import_react13.forwardRef)(
3726
3729
  ...props
3727
3730
  }, ref) => {
3728
3731
  const storeRef = (0, import_react13.useRef)(null);
3729
- storeRef.current ??= createMenuStore();
3732
+ storeRef.current ??= createMenuStore(onValueChange);
3730
3733
  const store = storeRef.current;
3731
- const { setValue, value } = (0, import_zustand4.useStore)(store, (s) => s);
3734
+ const { setValue } = (0, import_zustand4.useStore)(store, (s) => s);
3732
3735
  (0, import_react13.useEffect)(() => {
3733
3736
  setValue(propValue ?? defaultValue);
3734
3737
  }, [defaultValue, propValue, setValue]);
3735
- const onValueChangeRef = (0, import_react13.useRef)(onValueChange);
3736
- const isInitializedRef = (0, import_react13.useRef)(false);
3737
- onValueChangeRef.current = onValueChange;
3738
- (0, import_react13.useEffect)(() => {
3739
- if (isInitializedRef.current) {
3740
- onValueChangeRef.current?.(value);
3741
- } else {
3742
- isInitializedRef.current = true;
3743
- }
3744
- }, [value]);
3745
3738
  const baseClasses = "w-full py-2 px-6 flex flex-row items-center justify-center";
3746
3739
  const variantClasses = VARIANT_CLASSES5[variant];
3747
3740
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
@@ -3771,6 +3764,7 @@ var MenuContent = (0, import_react13.forwardRef)(
3771
3764
  className: `
3772
3765
  ${baseClasses}
3773
3766
  ${variantClasses}
3767
+ ${variant == "breadcrumb" ? "flex-wrap" : ""}
3774
3768
  ${className ?? ""}
3775
3769
  `,
3776
3770
  style: variant === "menu2" ? { scrollbarWidth: "none", msOverflowStyle: "none" } : void 0,
@@ -3789,12 +3783,15 @@ var MenuItem = (0, import_react13.forwardRef)(
3789
3783
  disabled = false,
3790
3784
  store: externalStore,
3791
3785
  variant = "menu",
3786
+ separator = false,
3792
3787
  ...props
3793
3788
  }, ref) => {
3794
3789
  const store = useMenuStore(externalStore);
3795
3790
  const { value: selectedValue, setValue } = (0, import_zustand4.useStore)(store, (s) => s);
3796
3791
  const handleClick = (e) => {
3797
- if (!disabled) setValue(value);
3792
+ if (!disabled) {
3793
+ setValue(value);
3794
+ }
3798
3795
  props.onClick?.(e);
3799
3796
  };
3800
3797
  const commonProps = {
@@ -3827,41 +3824,59 @@ var MenuItem = (0, import_react13.forwardRef)(
3827
3824
  children
3828
3825
  }
3829
3826
  ),
3830
- menu2: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3827
+ menu2: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
3831
3828
  "li",
3832
3829
  {
3833
3830
  "data-variant": "menu2",
3834
3831
  className: `
3835
- w-full flex flex-row items-center p-4 gap-2 border-b-4 border-transparent text-text-950 text-xs font-bold cursor-pointer focus:rounded-sm justify-center
3836
- focus:outline-none focus:border-indicator-info focus:border-2
3837
- ${selectedValue === value ? "border-b-primary-950" : ""}
3838
- ${className ?? ""}
3832
+ w-full flex flex-col items-center px-4 pt-4 gap-3 border-b-4 border-transparent cursor-pointer focus:rounded-sm justify-center hover:bg-background-100 rounded-lg
3833
+ focus:outline-none focus:border-indicator-info focus:border-2
3834
+ ${selectedValue === value ? "" : "pb-4"}
3839
3835
  `,
3840
3836
  ...commonProps,
3841
- children
3837
+ children: [
3838
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3839
+ "span",
3840
+ {
3841
+ className: `flex flex-row items-center gap-2 px-2 text-text-950 text-xs font-bold ${className ?? ""}`,
3842
+ children
3843
+ }
3844
+ ),
3845
+ selectedValue === value && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "h-1 w-full bg-primary-950 rounded-lg" })
3846
+ ]
3842
3847
  }
3843
3848
  ),
3844
- breadcrumb: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3849
+ breadcrumb: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
3845
3850
  "li",
3846
3851
  {
3847
3852
  "data-variant": "breadcrumb",
3848
3853
  className: `
3849
- w-full p-2 rounded-lg hover:text-primary-600 cursor-pointer font-bold text-xs
3854
+ flex flex-row gap-2 items-center w-fit p-2 rounded-lg hover:text-primary-600 cursor-pointer font-bold text-xs
3850
3855
  focus:outline-none focus:border-indicator-info focus:border-2
3851
3856
  ${selectedValue === value ? "text-text-950" : "text-text-600"}
3852
3857
  ${className ?? ""}
3853
3858
  `,
3854
3859
  ...commonProps,
3855
- children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3856
- "span",
3857
- {
3858
- className: `
3860
+ children: [
3861
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3862
+ "span",
3863
+ {
3864
+ className: `
3859
3865
  border-b border-text-600 hover:border-primary-600 text-inherit text-xs
3860
- ${selectedValue === value ? "border-b-0 font-bold" : "border-b-primary-600"}
3866
+ ${selectedValue === value ? "border-b-0 font-bold" : "border-b-text-600"}
3861
3867
  `,
3862
- children
3863
- }
3864
- )
3868
+ children
3869
+ }
3870
+ ),
3871
+ separator && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3872
+ import_phosphor_react12.CaretRight,
3873
+ {
3874
+ size: 16,
3875
+ className: "text-text-600",
3876
+ "data-testid": "separator"
3877
+ }
3878
+ )
3879
+ ]
3865
3880
  }
3866
3881
  )
3867
3882
  };
@@ -3869,19 +3884,6 @@ var MenuItem = (0, import_react13.forwardRef)(
3869
3884
  }
3870
3885
  );
3871
3886
  MenuItem.displayName = "MenuItem";
3872
- var MenuSeparator = (0, import_react13.forwardRef)(
3873
- ({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3874
- "li",
3875
- {
3876
- ref,
3877
- "aria-hidden": "true",
3878
- className: `[&>svg]:w-4 [&>svg]:h-4 text-text-600 ${className ?? ""}`,
3879
- ...props,
3880
- children: children ?? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_phosphor_react12.CaretRight, {})
3881
- }
3882
- )
3883
- );
3884
- MenuSeparator.displayName = "MenuSeparator";
3885
3887
  var internalScroll = (container, direction) => {
3886
3888
  if (!container) return;
3887
3889
  container.scrollBy({
@@ -4339,7 +4341,8 @@ var CardPerformance = (0, import_react14.forwardRef)(
4339
4341
  layout: "horizontal",
4340
4342
  padding: "medium",
4341
4343
  minHeight: "none",
4342
- className: `justify-between gap-2 ${className}`,
4344
+ className: `justify-between gap-2 ${actionVariant == "caret" ? "cursor-pointer" : ""} ${className}`,
4345
+ onClick: () => actionVariant == "caret" && onClickButton?.(valueButton),
4343
4346
  ...props,
4344
4347
  children: [
4345
4348
  /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "w-full flex flex-col justify-between gap-2", children: [
@@ -4368,8 +4371,7 @@ var CardPerformance = (0, import_react14.forwardRef)(
4368
4371
  import_phosphor_react13.CaretRight,
4369
4372
  {
4370
4373
  className: "size-4.5 text-text-800 cursor-pointer",
4371
- "data-testid": "caret-icon",
4372
- onClick: () => onClickButton?.(valueButton)
4374
+ "data-testid": "caret-icon"
4373
4375
  }
4374
4376
  )
4375
4377
  ]
@@ -4704,7 +4706,7 @@ var CardAudio = (0, import_react14.forwardRef)(
4704
4706
  layout: "horizontal",
4705
4707
  padding: "medium",
4706
4708
  minHeight: "none",
4707
- className: `w-auto h-14 items-center gap-2 border-none ${className}`,
4709
+ className: `w-auto h-14 items-center gap-2 ${className}`,
4708
4710
  ...props,
4709
4711
  children: [
4710
4712
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
@@ -5034,7 +5036,6 @@ var SkeletonTable = (0, import_react15.forwardRef)(
5034
5036
  MenuItem,
5035
5037
  MenuLabel,
5036
5038
  MenuOverflow,
5037
- MenuSeparator,
5038
5039
  Modal,
5039
5040
  NavButton,
5040
5041
  ProfileMenuFooter,