@mesob/ui 0.5.4 → 0.5.5

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.
@@ -1643,7 +1643,7 @@ declare function AccordionTrigger({ className, children, chevron, chevronPositio
1643
1643
  declare function AccordionContent({ className, children, ...props }: React$1.ComponentProps<typeof Accordion$1.Panel>): react_jsx_runtime.JSX.Element;
1644
1644
 
1645
1645
  declare const actionIconVariants: (props?: ({
1646
- variant?: "default" | "secondary" | "destructive" | "outline" | "ghost" | "light" | null | undefined;
1646
+ variant?: "light" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
1647
1647
  size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
1648
1648
  radius?: "xs" | "sm" | "md" | "lg" | "xl" | "full" | null | undefined;
1649
1649
  } & class_variance_authority_types.ClassProp) | undefined) => string;
@@ -1696,7 +1696,7 @@ declare function AlertDialogCancel({ className, ...props }: React$1.ComponentPro
1696
1696
 
1697
1697
  declare const anchorVariants: (props?: ({
1698
1698
  variant?: "default" | "muted" | "gradient" | "subtle" | null | undefined;
1699
- underline?: "never" | "always" | "hover" | null | undefined;
1699
+ underline?: "always" | "never" | "hover" | null | undefined;
1700
1700
  size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
1701
1701
  weight?: "bold" | "normal" | "medium" | "semibold" | null | undefined;
1702
1702
  } & class_variance_authority_types.ClassProp) | undefined) => string;
@@ -1758,7 +1758,7 @@ type BackgroundImageProps = React$1.ComponentProps<'div'> & {
1758
1758
  declare function BackgroundImage({ className, src, radius, style, ...props }: BackgroundImageProps): react_jsx_runtime.JSX.Element;
1759
1759
 
1760
1760
  declare const badgeVariants: (props?: ({
1761
- variant?: "link" | "success" | "default" | "secondary" | "destructive" | "outline" | "ghost" | "light" | "dot" | "warning" | null | undefined;
1761
+ variant?: "link" | "light" | "default" | "dot" | "success" | "secondary" | "destructive" | "outline" | "ghost" | "warning" | null | undefined;
1762
1762
  size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
1763
1763
  radius?: "none" | "sm" | "md" | "lg" | "full" | null | undefined;
1764
1764
  circle?: boolean | null | undefined;
@@ -1796,8 +1796,8 @@ type BurgerProps = Omit<React$1.ComponentProps<'button'>, 'children'> & VariantP
1796
1796
  declare function Burger({ className, size, opened, ariaLabel, ...props }: BurgerProps): react_jsx_runtime.JSX.Element;
1797
1797
 
1798
1798
  declare const buttonVariants: (props?: ({
1799
- variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | "light" | null | undefined;
1800
- size?: "default" | "xs" | "sm" | "md" | "lg" | "xl" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | "icon-xl" | null | undefined;
1799
+ variant?: "link" | "light" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
1800
+ size?: "default" | "icon" | "xs" | "sm" | "md" | "lg" | "xl" | "icon-xs" | "icon-sm" | "icon-lg" | "icon-xl" | null | undefined;
1801
1801
  radius?: "xs" | "sm" | "md" | "lg" | "xl" | "full" | null | undefined;
1802
1802
  fullWidth?: boolean | null | undefined;
1803
1803
  } & class_variance_authority_types.ClassProp) | undefined) => string;
@@ -2389,10 +2389,10 @@ declare const gridVariants: (props?: ({
2389
2389
  gutter?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
2390
2390
  } & class_variance_authority_types.ClassProp) | undefined) => string;
2391
2391
  declare const gridColVariants: (props?: ({
2392
- span?: 3 | 1 | 2 | 4 | 6 | 8 | "auto" | 7 | 5 | 10 | 9 | 12 | 11 | null | undefined;
2393
- sm?: 3 | 1 | 2 | 4 | 6 | 8 | 7 | 5 | 10 | 9 | 12 | 11 | null | undefined;
2394
- md?: 3 | 1 | 2 | 4 | 6 | 8 | 7 | 5 | 10 | 9 | 12 | 11 | null | undefined;
2395
- lg?: 3 | 1 | 2 | 4 | 6 | 8 | 7 | 5 | 10 | 9 | 12 | 11 | null | undefined;
2392
+ span?: 1 | 4 | "auto" | 2 | 3 | 7 | 5 | 6 | 8 | 10 | 9 | 12 | 11 | null | undefined;
2393
+ sm?: 1 | 4 | 2 | 3 | 7 | 5 | 6 | 8 | 10 | 9 | 12 | 11 | null | undefined;
2394
+ md?: 1 | 4 | 2 | 3 | 7 | 5 | 6 | 8 | 10 | 9 | 12 | 11 | null | undefined;
2395
+ lg?: 1 | 4 | 2 | 3 | 7 | 5 | 6 | 8 | 10 | 9 | 12 | 11 | null | undefined;
2396
2396
  } & class_variance_authority_types.ClassProp) | undefined) => string;
2397
2397
  type GridProps = React$1.ComponentProps<'div'> & VariantProps<typeof gridVariants>;
2398
2398
  type GridColProps = React$1.ComponentProps<'div'> & VariantProps<typeof gridColVariants> & {
@@ -2832,7 +2832,13 @@ declare function SheetTitle({ className, ...props }: React$1.ComponentProps<type
2832
2832
  declare function SheetDescription({ className, ...props }: React$1.ComponentProps<typeof Dialog$1.Description>): react_jsx_runtime.JSX.Element;
2833
2833
 
2834
2834
  declare function TooltipProvider({ delay, ...props }: Tooltip$1.Provider.Props): react_jsx_runtime.JSX.Element;
2835
- declare function Tooltip({ ...props }: Tooltip$1.Root.Props): react_jsx_runtime.JSX.Element;
2835
+ type TooltipProps = Omit<Tooltip$1.Root.Props, 'children'> & {
2836
+ children: ReactNode;
2837
+ label?: ReactNode;
2838
+ contentProps?: Omit<Tooltip$1.Popup.Props & Pick<Tooltip$1.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'>, 'children'>;
2839
+ triggerProps?: Omit<Tooltip$1.Trigger.Props, 'children'>;
2840
+ };
2841
+ declare function Tooltip({ label, contentProps, triggerProps, children, ...props }: TooltipProps): react_jsx_runtime.JSX.Element;
2836
2842
  declare function TooltipTrigger({ ...props }: Tooltip$1.Trigger.Props): react_jsx_runtime.JSX.Element;
2837
2843
  declare function TooltipContent({ className, side, sideOffset, align, alignOffset, children, ...props }: Tooltip$1.Popup.Props & Pick<Tooltip$1.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'>): react_jsx_runtime.JSX.Element;
2838
2844
 
@@ -2906,7 +2912,7 @@ declare function SidebarMenuSubButton({ render, size, isActive, className, ...pr
2906
2912
  }): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
2907
2913
 
2908
2914
  declare const simpleGridVariants: (props?: ({
2909
- cols?: 3 | 1 | 2 | 4 | 6 | "auto" | 5 | null | undefined;
2915
+ cols?: 1 | 4 | "auto" | 2 | 3 | 5 | 6 | null | undefined;
2910
2916
  spacing?: "0" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
2911
2917
  } & class_variance_authority_types.ClassProp) | undefined) => string;
2912
2918
  type SimpleGridProps = React$1.ComponentProps<'div'> & VariantProps<typeof simpleGridVariants> & {
@@ -3062,11 +3068,11 @@ declare function TagsInput({ className, value, defaultValue, onChange, placehold
3062
3068
 
3063
3069
  declare const textVariants: (props?: ({
3064
3070
  size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
3065
- weight?: "bold" | "light" | "normal" | "medium" | "semibold" | "extrabold" | null | undefined;
3071
+ weight?: "bold" | "normal" | "medium" | "light" | "semibold" | "extrabold" | null | undefined;
3066
3072
  align?: "center" | "left" | "right" | "start" | "end" | "justify" | null | undefined;
3067
3073
  transform?: "none" | "capitalize" | "lowercase" | "uppercase" | null | undefined;
3068
3074
  decoration?: "none" | "line-through" | "underline" | null | undefined;
3069
- variant?: "success" | "default" | "primary" | "secondary" | "accent" | "destructive" | "muted" | "warning" | "dimmed" | null | undefined;
3075
+ variant?: "default" | "success" | "primary" | "secondary" | "accent" | "destructive" | "muted" | "warning" | "dimmed" | null | undefined;
3070
3076
  truncate?: boolean | null | undefined;
3071
3077
  inherit?: boolean | null | undefined;
3072
3078
  italic?: boolean | null | undefined;
@@ -3093,7 +3099,7 @@ declare const TextInput: React$1.ForwardRefExoticComponent<Omit<TextInputProps,
3093
3099
 
3094
3100
  declare const themeIconVariants: (props?: ({
3095
3101
  size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | null | undefined;
3096
- variant?: "default" | "outline" | "light" | "filled" | "gradient" | "subtle" | null | undefined;
3102
+ variant?: "light" | "default" | "filled" | "outline" | "gradient" | "subtle" | null | undefined;
3097
3103
  color?: "success" | "primary" | "secondary" | "accent" | "destructive" | "warning" | null | undefined;
3098
3104
  radius?: "none" | "sm" | "md" | "lg" | "full" | null | undefined;
3099
3105
  } & class_variance_authority_types.ClassProp) | undefined) => string;
@@ -3111,9 +3117,9 @@ declare function TimelineDescription({ className, ...props }: React$1.ComponentP
3111
3117
  declare function TimelineTime({ className, ...props }: React$1.ComponentProps<'time'>): react_jsx_runtime.JSX.Element;
3112
3118
 
3113
3119
  declare const titleVariants: (props?: ({
3114
- order?: 3 | 1 | 2 | 4 | 6 | 5 | null | undefined;
3120
+ order?: 1 | 4 | 2 | 3 | 5 | 6 | null | undefined;
3115
3121
  variant?: "default" | "primary" | "secondary" | "accent" | "muted" | "dimmed" | "gradient" | null | undefined;
3116
- weight?: "bold" | "light" | "normal" | "medium" | "semibold" | "extrabold" | null | undefined;
3122
+ weight?: "bold" | "normal" | "medium" | "light" | "semibold" | "extrabold" | null | undefined;
3117
3123
  align?: "center" | "left" | "right" | null | undefined;
3118
3124
  } & class_variance_authority_types.ClassProp) | undefined) => string;
3119
3125
  type TitleProps = Omit<React$1.ComponentProps<'h1'>, 'ref'> & VariantProps<typeof titleVariants>;
@@ -248,7 +248,7 @@ function AppBreadcrumbs({
248
248
  className
249
249
  }) {
250
250
  const mesob = useMesob();
251
- const Link2 = linkProp ?? mesob?.linkComponent ?? mesob?.navigation?.Link;
251
+ const Link2 = linkProp ?? mesob?.navigation?.Link;
252
252
  const locale = mesob?.locale;
253
253
  const { items } = useBreadcrumbs2(void 0);
254
254
  if (items.length === 0) {
@@ -1749,12 +1749,12 @@ function AppHeaderActions({
1749
1749
  accountMenuFooter
1750
1750
  }) {
1751
1751
  const mesob = useMesob2();
1752
- const LinkComponent = mesob?.linkComponent ?? mesob?.navigation?.Link;
1752
+ const LinkComponent = mesob?.navigation?.Link;
1753
1753
  const locale = mesob?.locale;
1754
1754
  const hasHrefItems = topMenuItems.some((i) => i.href) || menuItems.some((i) => i.href);
1755
1755
  if (hasHrefItems && !LinkComponent) {
1756
1756
  throw new Error(
1757
- "[AppHeaderActions] MesobProvider with routing is required for menu items with href"
1757
+ "[AppHeaderActions] MesobProvider is required for menu items with href"
1758
1758
  );
1759
1759
  }
1760
1760
  const initials = user?.fullName?.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2) || "U";
@@ -2076,8 +2076,27 @@ function TooltipProvider({
2076
2076
  }
2077
2077
  );
2078
2078
  }
2079
- function Tooltip({ ...props }) {
2080
- return /* @__PURE__ */ jsx19(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props });
2079
+ function Tooltip({
2080
+ label,
2081
+ contentProps,
2082
+ triggerProps,
2083
+ children,
2084
+ ...props
2085
+ }) {
2086
+ if (label !== void 0) {
2087
+ return /* @__PURE__ */ jsxs12(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props, children: [
2088
+ /* @__PURE__ */ jsx19(
2089
+ TooltipTrigger,
2090
+ {
2091
+ render: /* @__PURE__ */ jsx19("span", { className: "inline-block" }),
2092
+ ...triggerProps,
2093
+ children
2094
+ }
2095
+ ),
2096
+ /* @__PURE__ */ jsx19(TooltipContent, { ...contentProps, children: label })
2097
+ ] });
2098
+ }
2099
+ return /* @__PURE__ */ jsx19(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props, children });
2081
2100
  }
2082
2101
  function TooltipTrigger({ ...props }) {
2083
2102
  return /* @__PURE__ */ jsx19(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
@@ -2828,7 +2847,7 @@ function NavItemRow({
2828
2847
  onNavClick
2829
2848
  }) {
2830
2849
  const mesob = useMesob3();
2831
- const Link2 = mesob?.linkComponent ?? mesob?.navigation?.Link;
2850
+ const Link2 = mesob?.navigation?.Link;
2832
2851
  const locale = mesob?.locale;
2833
2852
  const activeBranch = hasActiveDescendant(item, pathname);
2834
2853
  const { open, toggle } = useNavBranchOpen(activeBranch);
@@ -3510,7 +3529,7 @@ function NoDataAvailable({
3510
3529
  icon
3511
3530
  }) {
3512
3531
  const mesob = useMesob4();
3513
- const Link2 = mesob?.linkComponent ?? mesob?.navigation?.Link;
3532
+ const Link2 = mesob?.navigation?.Link;
3514
3533
  const locale = mesob?.locale;
3515
3534
  const iconMap = {
3516
3535
  certificate: IconCertificateOff,
@@ -4309,11 +4328,10 @@ function EntityDetailHeader({
4309
4328
  className
4310
4329
  }) {
4311
4330
  const mesob = useMesob5();
4312
- const LinkComponent = mesob?.linkComponent ?? mesob?.navigation?.Link;
4331
+ const LinkComponent = mesob?.navigation?.Link;
4313
4332
  const pathname = mesob?.pathname ?? "";
4314
4333
  const locale = mesob?.locale;
4315
- const goBack = mesob?.goBack ?? (() => window.history.back());
4316
- const resolvedBackButton = showBack ? /* @__PURE__ */ jsx37(PageGoBack, { onBack: goBack, label: "Go back" }) : void 0;
4334
+ const resolvedBackButton = showBack && mesob?.goBack ? /* @__PURE__ */ jsx37(PageGoBack, { onBack: mesob.goBack, label: "Go back" }) : void 0;
4317
4335
  const hrefBasedActiveTab = useMemo3(() => {
4318
4336
  const hasPathname = Boolean(pathname);
4319
4337
  const allHaveHref = tabs.every((t) => t.href);
@@ -7982,7 +8000,6 @@ import { useState as useState22 } from "react";
7982
8000
  import { Controller as Controller2 } from "react-hook-form";
7983
8001
 
7984
8002
  // src/provider/mesob-provider.tsx
7985
- import { createNavigation } from "next-intl/navigation";
7986
8003
  import { createContext as createContext3, useContext as useContext3, useMemo as useMemo10 } from "react";
7987
8004
  import { z as z2 } from "zod";
7988
8005
 
@@ -15413,7 +15430,7 @@ function Anchor({
15413
15430
  ...props
15414
15431
  }) {
15415
15432
  const mesob = useMesob7();
15416
- const Link2 = mesob?.linkComponent ?? mesob?.navigation?.Link;
15433
+ const Link2 = mesob?.navigation?.Link;
15417
15434
  const locale = mesob?.locale;
15418
15435
  const useLink = href && !isExternal2(href) && Link2;
15419
15436
  const Comp = useLink ? Link2 : "a";
@@ -15615,7 +15632,7 @@ function AnimatedTabs({
15615
15632
  linkComponent: linkProp
15616
15633
  }) {
15617
15634
  const mesob = useMesob8();
15618
- const LinkComponent = linkProp ?? mesob?.linkComponent ?? mesob?.navigation?.Link;
15635
+ const LinkComponent = linkProp ?? mesob?.navigation?.Link;
15619
15636
  const locale = mesob?.locale;
15620
15637
  const [internalActiveTab, setInternalActiveTab] = useState36(
15621
15638
  defaultTab ?? tabs[0]?.value ?? ""
@@ -21369,7 +21386,7 @@ function NavLink({
21369
21386
  ...props
21370
21387
  }) {
21371
21388
  const mesob = useMesob9();
21372
- const Link2 = mesob?.linkComponent ?? mesob?.navigation?.Link;
21389
+ const Link2 = mesob?.navigation?.Link;
21373
21390
  const locale = mesob?.locale;
21374
21391
  const useLink = href && !isExternal3(href) && Link2;
21375
21392
  const Comp = useLink ? Link2 : "a";