mainbase-ui 1.2.4 → 1.2.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.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { ReactNode, CSSProperties, HTMLAttributes, ButtonHTMLAttributes, InputHTMLAttributes, PropsWithChildren, ImgHTMLAttributes, ReactElement, MouseEvent, KeyboardEvent, Ref, RefObject, TextareaHTMLAttributes, ElementType } from 'react';
2
+ import { ReactNode, CSSProperties, HTMLAttributes, ButtonHTMLAttributes, InputHTMLAttributes, PropsWithChildren, ImgHTMLAttributes, ReactElement, MouseEvent, KeyboardEvent, Ref, AnchorHTMLAttributes, RefObject, TextareaHTMLAttributes, ElementType } from 'react';
3
3
 
4
4
  type MainbaseColorScheme = "light" | "dark";
5
5
  type MainbaseRadius = number | string;
@@ -156,6 +156,10 @@ interface MainbaseComponentDefaults {
156
156
  firstDayOfWeek?: 0 | 1;
157
157
  clearable?: boolean;
158
158
  };
159
+ Image?: {
160
+ radius?: "none" | "sm" | "md" | "lg" | "xl" | "full";
161
+ fit?: "contain" | "cover" | "fill" | "none" | "scale-down";
162
+ };
159
163
  }
160
164
  interface MainbaseTheme {
161
165
  colorScheme: MainbaseColorScheme;
@@ -215,9 +219,11 @@ interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
215
219
  }
216
220
  declare function Badge({ variant, size, leftSection, rightSection, className, children, ...props }: BadgeProps): react.JSX.Element;
217
221
 
222
+ type ButtonVariant = "primary" | "secondary" | "outline" | "ghost" | "danger";
223
+ type ButtonSize = "sm" | "md" | "lg";
218
224
  interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
219
- variant?: "primary" | "secondary" | "outline" | "ghost";
220
- size?: "sm" | "md" | "lg";
225
+ variant?: ButtonVariant;
226
+ size?: ButtonSize;
221
227
  loading?: boolean;
222
228
  leftSection?: ReactNode;
223
229
  rightSection?: ReactNode;
@@ -707,6 +713,26 @@ interface DatePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultV
707
713
  }
708
714
  declare function DatePicker({ type, value, defaultValue, onChange, size, placeholder, rangeSeparator, locale, firstDayOfWeek, minDate, maxDate, disabled, error, clearable, name, dateFormat, className, ...props }: DatePickerProps): react.JSX.Element;
709
715
 
716
+ type ImageFit = "contain" | "cover" | "fill" | "none" | "scale-down";
717
+ interface ImageProps extends ImgHTMLAttributes<HTMLImageElement> {
718
+ radius?: "none" | "sm" | "md" | "lg" | "xl" | "full";
719
+ fit?: ImageFit;
720
+ fallback?: string;
721
+ }
722
+ declare const Image: react.ForwardRefExoticComponent<ImageProps & react.RefAttributes<HTMLImageElement>>;
723
+
724
+ interface HighlightProps extends HTMLAttributes<HTMLSpanElement> {
725
+ children: ReactNode;
726
+ color?: "primary" | "success" | "warning";
727
+ }
728
+ declare function Highlight({ children, color, className, ...props }: HighlightProps): react.JSX.Element;
729
+
730
+ type LinkVariant = "default" | "primary" | "muted";
731
+ interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
732
+ variant?: LinkVariant;
733
+ }
734
+ declare const Link: react.ForwardRefExoticComponent<LinkProps & react.RefAttributes<HTMLAnchorElement>>;
735
+
710
736
  type ClickOutsideEvent = "mousedown" | "touchstart" | "pointerdown";
711
737
  interface UseClickOutsideOptions {
712
738
  enabled?: boolean;
@@ -786,4 +812,4 @@ interface TitleProps extends HTMLAttributes<HTMLHeadingElement> {
786
812
  }
787
813
  declare function Title({ order, size, weight, color, leftSection, rightSection, className, children, ...props }: TitleProps): react.JSX.Element;
788
814
 
789
- export { Accordion, type AccordionChevronPosition, type AccordionControlProps, type AccordionItemProps, type AccordionPanelProps, type AccordionProps, type AccordionSize, type AccordionType, type AccordionValue, type AccordionVariant, Alert, type AlertProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Badge, type BadgeProps, Button, Card, type CardProps, Checkbox, type CheckboxProps, type ClassValue, DatePicker, type DatePickerProps, type DatePickerSize, type DatePickerType, type DatePickerValue, type DateRangeValue, Divider, type DividerProps, Drawer, type DrawerPosition, type DrawerProps, type DrawerSize, FileInput, type FileInputProps, type FileInputSize, Group, type GroupProps, Icon, IconButton, type IconButtonProps, type IconProps, Input, type InputProps, type MainbaseColorScheme, type MainbaseColors, type MainbaseComponentDefaults, MainbasePortalContext, MainbaseProvider, type MainbaseProviderProps, type MainbaseRadii, type MainbaseShadows, type MainbaseSpacing, type MainbaseTheme, type MainbaseThemeOverride, type MainbaseTransitions, type MainbaseTypography, type MainbaseZIndex, Menu, type MenuDividerProps, type MenuDropdownProps, type MenuItemProps, type MenuLabelProps, type MenuPosition, type MenuProps, type MenuTargetProps, type MenuWidth, Modal, type ModalProps, Pagination, type PaginationProps, type PaginationSize, type PaginationVariant, PasswordInput, type PasswordInputProps, type PasswordInputSize, PinInput, type PinInputProps, type PinInputSize, type PinInputType, Popover, type PopoverDropdownProps, type PopoverPosition, type PopoverProps, type PopoverTargetProps, Portal, type PortalProps, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Select, type SelectOption, type SelectProps, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, Stack, type StackProps, Switch, type SwitchProps, Tabs, TabsList, type TabsListProps, type TabsOrientation, TabsPanel, type TabsPanelProps, type TabsProps, type TabsSize, TabsTab, type TabsTabProps, type TabsVariant, Text, type TextProps, Textarea, type TextareaProps, Title, type TitleProps, type ToastApi, type ToastItem, type ToastOptions, type ToastPosition, ToastProvider, type ToastProviderProps, type ToastShortcutInput, type ToastVariant, Tooltip, type TooltipPosition, type TooltipProps, type UseClickOutsideOptions, type UseControllableStateOptions, type UseDisclosureHandlers, type UseDisclosureReturn, cx, defaultMainbaseTheme, useClickOutside, useComponentDefaults, useControllableState, useDisclosure, useLockScroll, useMainbaseTheme, useToast };
815
+ export { Accordion, type AccordionChevronPosition, type AccordionControlProps, type AccordionItemProps, type AccordionPanelProps, type AccordionProps, type AccordionSize, type AccordionType, type AccordionValue, type AccordionVariant, Alert, type AlertProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Badge, type BadgeProps, Button, Card, type CardProps, Checkbox, type CheckboxProps, type ClassValue, DatePicker, type DatePickerProps, type DatePickerSize, type DatePickerType, type DatePickerValue, type DateRangeValue, Divider, type DividerProps, Drawer, type DrawerPosition, type DrawerProps, type DrawerSize, FileInput, type FileInputProps, type FileInputSize, Group, type GroupProps, Highlight, type HighlightProps, Icon, IconButton, type IconButtonProps, type IconProps, Image, type ImageFit, type ImageProps, Input, type InputProps, Link, type LinkProps, type LinkVariant, type MainbaseColorScheme, type MainbaseColors, type MainbaseComponentDefaults, MainbasePortalContext, MainbaseProvider, type MainbaseProviderProps, type MainbaseRadii, type MainbaseShadows, type MainbaseSpacing, type MainbaseTheme, type MainbaseThemeOverride, type MainbaseTransitions, type MainbaseTypography, type MainbaseZIndex, Menu, type MenuDividerProps, type MenuDropdownProps, type MenuItemProps, type MenuLabelProps, type MenuPosition, type MenuProps, type MenuTargetProps, type MenuWidth, Modal, type ModalProps, Pagination, type PaginationProps, type PaginationSize, type PaginationVariant, PasswordInput, type PasswordInputProps, type PasswordInputSize, PinInput, type PinInputProps, type PinInputSize, type PinInputType, Popover, type PopoverDropdownProps, type PopoverPosition, type PopoverProps, type PopoverTargetProps, Portal, type PortalProps, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Select, type SelectOption, type SelectProps, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, Stack, type StackProps, Switch, type SwitchProps, Tabs, TabsList, type TabsListProps, type TabsOrientation, TabsPanel, type TabsPanelProps, type TabsProps, type TabsSize, TabsTab, type TabsTabProps, type TabsVariant, Text, type TextProps, Textarea, type TextareaProps, Title, type TitleProps, type ToastApi, type ToastItem, type ToastOptions, type ToastPosition, ToastProvider, type ToastProviderProps, type ToastShortcutInput, type ToastVariant, Tooltip, type TooltipPosition, type TooltipProps, type UseClickOutsideOptions, type UseControllableStateOptions, type UseDisclosureHandlers, type UseDisclosureReturn, cx, defaultMainbaseTheme, useClickOutside, useComponentDefaults, useControllableState, useDisclosure, useLockScroll, useMainbaseTheme, useToast };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { ReactNode, CSSProperties, HTMLAttributes, ButtonHTMLAttributes, InputHTMLAttributes, PropsWithChildren, ImgHTMLAttributes, ReactElement, MouseEvent, KeyboardEvent, Ref, RefObject, TextareaHTMLAttributes, ElementType } from 'react';
2
+ import { ReactNode, CSSProperties, HTMLAttributes, ButtonHTMLAttributes, InputHTMLAttributes, PropsWithChildren, ImgHTMLAttributes, ReactElement, MouseEvent, KeyboardEvent, Ref, AnchorHTMLAttributes, RefObject, TextareaHTMLAttributes, ElementType } from 'react';
3
3
 
4
4
  type MainbaseColorScheme = "light" | "dark";
5
5
  type MainbaseRadius = number | string;
@@ -156,6 +156,10 @@ interface MainbaseComponentDefaults {
156
156
  firstDayOfWeek?: 0 | 1;
157
157
  clearable?: boolean;
158
158
  };
159
+ Image?: {
160
+ radius?: "none" | "sm" | "md" | "lg" | "xl" | "full";
161
+ fit?: "contain" | "cover" | "fill" | "none" | "scale-down";
162
+ };
159
163
  }
160
164
  interface MainbaseTheme {
161
165
  colorScheme: MainbaseColorScheme;
@@ -215,9 +219,11 @@ interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
215
219
  }
216
220
  declare function Badge({ variant, size, leftSection, rightSection, className, children, ...props }: BadgeProps): react.JSX.Element;
217
221
 
222
+ type ButtonVariant = "primary" | "secondary" | "outline" | "ghost" | "danger";
223
+ type ButtonSize = "sm" | "md" | "lg";
218
224
  interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
219
- variant?: "primary" | "secondary" | "outline" | "ghost";
220
- size?: "sm" | "md" | "lg";
225
+ variant?: ButtonVariant;
226
+ size?: ButtonSize;
221
227
  loading?: boolean;
222
228
  leftSection?: ReactNode;
223
229
  rightSection?: ReactNode;
@@ -707,6 +713,26 @@ interface DatePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultV
707
713
  }
708
714
  declare function DatePicker({ type, value, defaultValue, onChange, size, placeholder, rangeSeparator, locale, firstDayOfWeek, minDate, maxDate, disabled, error, clearable, name, dateFormat, className, ...props }: DatePickerProps): react.JSX.Element;
709
715
 
716
+ type ImageFit = "contain" | "cover" | "fill" | "none" | "scale-down";
717
+ interface ImageProps extends ImgHTMLAttributes<HTMLImageElement> {
718
+ radius?: "none" | "sm" | "md" | "lg" | "xl" | "full";
719
+ fit?: ImageFit;
720
+ fallback?: string;
721
+ }
722
+ declare const Image: react.ForwardRefExoticComponent<ImageProps & react.RefAttributes<HTMLImageElement>>;
723
+
724
+ interface HighlightProps extends HTMLAttributes<HTMLSpanElement> {
725
+ children: ReactNode;
726
+ color?: "primary" | "success" | "warning";
727
+ }
728
+ declare function Highlight({ children, color, className, ...props }: HighlightProps): react.JSX.Element;
729
+
730
+ type LinkVariant = "default" | "primary" | "muted";
731
+ interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
732
+ variant?: LinkVariant;
733
+ }
734
+ declare const Link: react.ForwardRefExoticComponent<LinkProps & react.RefAttributes<HTMLAnchorElement>>;
735
+
710
736
  type ClickOutsideEvent = "mousedown" | "touchstart" | "pointerdown";
711
737
  interface UseClickOutsideOptions {
712
738
  enabled?: boolean;
@@ -786,4 +812,4 @@ interface TitleProps extends HTMLAttributes<HTMLHeadingElement> {
786
812
  }
787
813
  declare function Title({ order, size, weight, color, leftSection, rightSection, className, children, ...props }: TitleProps): react.JSX.Element;
788
814
 
789
- export { Accordion, type AccordionChevronPosition, type AccordionControlProps, type AccordionItemProps, type AccordionPanelProps, type AccordionProps, type AccordionSize, type AccordionType, type AccordionValue, type AccordionVariant, Alert, type AlertProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Badge, type BadgeProps, Button, Card, type CardProps, Checkbox, type CheckboxProps, type ClassValue, DatePicker, type DatePickerProps, type DatePickerSize, type DatePickerType, type DatePickerValue, type DateRangeValue, Divider, type DividerProps, Drawer, type DrawerPosition, type DrawerProps, type DrawerSize, FileInput, type FileInputProps, type FileInputSize, Group, type GroupProps, Icon, IconButton, type IconButtonProps, type IconProps, Input, type InputProps, type MainbaseColorScheme, type MainbaseColors, type MainbaseComponentDefaults, MainbasePortalContext, MainbaseProvider, type MainbaseProviderProps, type MainbaseRadii, type MainbaseShadows, type MainbaseSpacing, type MainbaseTheme, type MainbaseThemeOverride, type MainbaseTransitions, type MainbaseTypography, type MainbaseZIndex, Menu, type MenuDividerProps, type MenuDropdownProps, type MenuItemProps, type MenuLabelProps, type MenuPosition, type MenuProps, type MenuTargetProps, type MenuWidth, Modal, type ModalProps, Pagination, type PaginationProps, type PaginationSize, type PaginationVariant, PasswordInput, type PasswordInputProps, type PasswordInputSize, PinInput, type PinInputProps, type PinInputSize, type PinInputType, Popover, type PopoverDropdownProps, type PopoverPosition, type PopoverProps, type PopoverTargetProps, Portal, type PortalProps, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Select, type SelectOption, type SelectProps, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, Stack, type StackProps, Switch, type SwitchProps, Tabs, TabsList, type TabsListProps, type TabsOrientation, TabsPanel, type TabsPanelProps, type TabsProps, type TabsSize, TabsTab, type TabsTabProps, type TabsVariant, Text, type TextProps, Textarea, type TextareaProps, Title, type TitleProps, type ToastApi, type ToastItem, type ToastOptions, type ToastPosition, ToastProvider, type ToastProviderProps, type ToastShortcutInput, type ToastVariant, Tooltip, type TooltipPosition, type TooltipProps, type UseClickOutsideOptions, type UseControllableStateOptions, type UseDisclosureHandlers, type UseDisclosureReturn, cx, defaultMainbaseTheme, useClickOutside, useComponentDefaults, useControllableState, useDisclosure, useLockScroll, useMainbaseTheme, useToast };
815
+ export { Accordion, type AccordionChevronPosition, type AccordionControlProps, type AccordionItemProps, type AccordionPanelProps, type AccordionProps, type AccordionSize, type AccordionType, type AccordionValue, type AccordionVariant, Alert, type AlertProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Badge, type BadgeProps, Button, Card, type CardProps, Checkbox, type CheckboxProps, type ClassValue, DatePicker, type DatePickerProps, type DatePickerSize, type DatePickerType, type DatePickerValue, type DateRangeValue, Divider, type DividerProps, Drawer, type DrawerPosition, type DrawerProps, type DrawerSize, FileInput, type FileInputProps, type FileInputSize, Group, type GroupProps, Highlight, type HighlightProps, Icon, IconButton, type IconButtonProps, type IconProps, Image, type ImageFit, type ImageProps, Input, type InputProps, Link, type LinkProps, type LinkVariant, type MainbaseColorScheme, type MainbaseColors, type MainbaseComponentDefaults, MainbasePortalContext, MainbaseProvider, type MainbaseProviderProps, type MainbaseRadii, type MainbaseShadows, type MainbaseSpacing, type MainbaseTheme, type MainbaseThemeOverride, type MainbaseTransitions, type MainbaseTypography, type MainbaseZIndex, Menu, type MenuDividerProps, type MenuDropdownProps, type MenuItemProps, type MenuLabelProps, type MenuPosition, type MenuProps, type MenuTargetProps, type MenuWidth, Modal, type ModalProps, Pagination, type PaginationProps, type PaginationSize, type PaginationVariant, PasswordInput, type PasswordInputProps, type PasswordInputSize, PinInput, type PinInputProps, type PinInputSize, type PinInputType, Popover, type PopoverDropdownProps, type PopoverPosition, type PopoverProps, type PopoverTargetProps, Portal, type PortalProps, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Select, type SelectOption, type SelectProps, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, Stack, type StackProps, Switch, type SwitchProps, Tabs, TabsList, type TabsListProps, type TabsOrientation, TabsPanel, type TabsPanelProps, type TabsProps, type TabsSize, TabsTab, type TabsTabProps, type TabsVariant, Text, type TextProps, Textarea, type TextareaProps, Title, type TitleProps, type ToastApi, type ToastItem, type ToastOptions, type ToastPosition, ToastProvider, type ToastProviderProps, type ToastShortcutInput, type ToastVariant, Tooltip, type TooltipPosition, type TooltipProps, type UseClickOutsideOptions, type UseControllableStateOptions, type UseDisclosureHandlers, type UseDisclosureReturn, cx, defaultMainbaseTheme, useClickOutside, useComponentDefaults, useControllableState, useDisclosure, useLockScroll, useMainbaseTheme, useToast };
package/dist/index.js CHANGED
@@ -166,6 +166,10 @@ var defaultMainbaseTheme = {
166
166
  size: "md",
167
167
  firstDayOfWeek: 1,
168
168
  clearable: true
169
+ },
170
+ Image: {
171
+ radius: "md",
172
+ fit: "cover"
169
173
  }
170
174
  }
171
175
  };
@@ -362,6 +366,10 @@ function mergeTheme(parentTheme, override) {
362
366
  DatePicker: {
363
367
  ...parentTheme.components.DatePicker,
364
368
  ...override.components?.DatePicker
369
+ },
370
+ Image: {
371
+ ...parentTheme.components.Image,
372
+ ...override.components?.Image
365
373
  }
366
374
  }
367
375
  };
@@ -567,6 +575,11 @@ import {
567
575
  forwardRef
568
576
  } from "react";
569
577
 
578
+ // src/utils/cx.ts
579
+ function cx(...classes) {
580
+ return classes.filter((value) => Boolean(value)).join(" ");
581
+ }
582
+
570
583
  // src/components/Spinner/Spinner.tsx
571
584
  import { jsx as jsx5 } from "react/jsx-runtime";
572
585
  function Spinner({
@@ -612,42 +625,52 @@ var Button = forwardRef(function Button2({
612
625
  type = "button",
613
626
  ...props
614
627
  }, ref) {
615
- const defaults = useComponentDefaults("Button");
628
+ const defaults = useComponentDefaults(
629
+ "Button"
630
+ );
616
631
  const resolvedVariant = variant ?? defaults.variant ?? "primary";
617
632
  const resolvedSize = size ?? defaults.size ?? "md";
618
- const classes = [
619
- "mb-button",
620
- `mb-button--${resolvedVariant}`,
621
- `mb-button--${resolvedSize}`,
622
- className
623
- ].filter(Boolean).join(" ");
624
- const iconSize = {
625
- sm: 16,
626
- md: 18,
627
- lg: 20
628
- }[resolvedSize];
629
633
  return /* @__PURE__ */ jsxs4(
630
634
  "button",
631
635
  {
632
636
  ref,
633
637
  type,
634
- className: classes,
638
+ className: cx(
639
+ "mb-button",
640
+ `mb-button--${resolvedVariant}`,
641
+ `mb-button--${resolvedSize}`,
642
+ loading ? "mb-button--loading" : void 0,
643
+ className
644
+ ),
635
645
  disabled: disabled || loading,
636
- "aria-busy": loading || void 0,
637
646
  ...props,
638
647
  children: [
639
648
  loading ? /* @__PURE__ */ jsx6(
640
649
  Spinner,
641
650
  {
642
- size: 14,
643
- thickness: 2,
644
- color: "currentColor",
645
- trackColor: "transparent",
646
- "aria-hidden": "true"
651
+ size: 16
652
+ }
653
+ ) : leftSection && /* @__PURE__ */ jsx6(
654
+ "span",
655
+ {
656
+ className: "mb-button__icon",
657
+ children: /* @__PURE__ */ jsx6(Icon, { size: 18, children: leftSection })
647
658
  }
648
- ) : leftSection != null ? /* @__PURE__ */ jsx6(Icon, { size: iconSize, children: leftSection }) : null,
649
- /* @__PURE__ */ jsx6("span", { className: "mb-button__content", children }),
650
- !loading && rightSection != null ? /* @__PURE__ */ jsx6(Icon, { size: iconSize, children: rightSection }) : null
659
+ ),
660
+ /* @__PURE__ */ jsx6(
661
+ "span",
662
+ {
663
+ className: "mb-button__label",
664
+ children
665
+ }
666
+ ),
667
+ rightSection && !loading ? /* @__PURE__ */ jsx6(
668
+ "span",
669
+ {
670
+ className: "mb-button__icon",
671
+ children: /* @__PURE__ */ jsx6(Icon, { size: 18, children: rightSection })
672
+ }
673
+ ) : null
651
674
  ]
652
675
  }
653
676
  );
@@ -882,11 +905,6 @@ function useLockScroll(locked = true) {
882
905
  }, [locked]);
883
906
  }
884
907
 
885
- // src/utils/cx.ts
886
- function cx(...classes) {
887
- return classes.filter((value) => Boolean(value)).join(" ");
888
- }
889
-
890
908
  // src/components/Portal/Portal.tsx
891
909
  import {
892
910
  useContext as useContext3,
@@ -6204,8 +6222,108 @@ function DatePicker({
6204
6222
  );
6205
6223
  }
6206
6224
 
6225
+ // src/components/Image/Image.tsx
6226
+ import {
6227
+ forwardRef as forwardRef6,
6228
+ useState as useState13
6229
+ } from "react";
6230
+ import { jsx as jsx33 } from "react/jsx-runtime";
6231
+ var Image = forwardRef6(function Image2({
6232
+ radius,
6233
+ fit,
6234
+ fallback,
6235
+ className = "",
6236
+ src,
6237
+ onError,
6238
+ ...props
6239
+ }, ref) {
6240
+ const defaults = useComponentDefaults(
6241
+ "Image"
6242
+ );
6243
+ const [
6244
+ currentSrc,
6245
+ setCurrentSrc
6246
+ ] = useState13(
6247
+ src
6248
+ );
6249
+ const resolvedRadius = radius ?? defaults.radius ?? "md";
6250
+ const resolvedFit = fit ?? defaults.fit ?? "cover";
6251
+ return /* @__PURE__ */ jsx33(
6252
+ "img",
6253
+ {
6254
+ ref,
6255
+ src: currentSrc,
6256
+ className: cx(
6257
+ "mb-image",
6258
+ `mb-image--${resolvedRadius}`,
6259
+ `mb-image--${resolvedFit}`,
6260
+ className
6261
+ ),
6262
+ onError: (event) => {
6263
+ if (fallback && currentSrc !== fallback) {
6264
+ setCurrentSrc(
6265
+ fallback
6266
+ );
6267
+ }
6268
+ onError?.(
6269
+ event
6270
+ );
6271
+ },
6272
+ ...props
6273
+ }
6274
+ );
6275
+ });
6276
+
6277
+ // src/components/Highlight/Highlight.tsx
6278
+ import { jsx as jsx34 } from "react/jsx-runtime";
6279
+ function Highlight({
6280
+ children,
6281
+ color = "primary",
6282
+ className = "",
6283
+ ...props
6284
+ }) {
6285
+ return /* @__PURE__ */ jsx34(
6286
+ "span",
6287
+ {
6288
+ className: cx(
6289
+ "mb-highlight",
6290
+ `mb-highlight--${color}`,
6291
+ className
6292
+ ),
6293
+ ...props,
6294
+ children
6295
+ }
6296
+ );
6297
+ }
6298
+
6299
+ // src/components/Link/Link.tsx
6300
+ import {
6301
+ forwardRef as forwardRef7
6302
+ } from "react";
6303
+ import { jsx as jsx35 } from "react/jsx-runtime";
6304
+ var Link = forwardRef7(function Link2({
6305
+ variant = "default",
6306
+ className = "",
6307
+ children,
6308
+ ...props
6309
+ }, ref) {
6310
+ return /* @__PURE__ */ jsx35(
6311
+ "a",
6312
+ {
6313
+ ref,
6314
+ className: cx(
6315
+ "mb-link",
6316
+ `mb-link--${variant}`,
6317
+ className
6318
+ ),
6319
+ ...props,
6320
+ children
6321
+ }
6322
+ );
6323
+ });
6324
+
6207
6325
  // src/components/Card/Card.tsx
6208
- import { jsx as jsx33, jsxs as jsxs27 } from "react/jsx-runtime";
6326
+ import { jsx as jsx36, jsxs as jsxs27 } from "react/jsx-runtime";
6209
6327
  function Card({
6210
6328
  padding,
6211
6329
  radius,
@@ -6233,9 +6351,9 @@ function Card({
6233
6351
  className: classes,
6234
6352
  ...props,
6235
6353
  children: [
6236
- header != null ? /* @__PURE__ */ jsx33("div", { className: "mb-card__header", children: header }) : null,
6237
- /* @__PURE__ */ jsx33("div", { className: "mb-card__content", children }),
6238
- footer != null ? /* @__PURE__ */ jsx33("div", { className: "mb-card__footer", children: footer }) : null
6354
+ header != null ? /* @__PURE__ */ jsx36("div", { className: "mb-card__header", children: header }) : null,
6355
+ /* @__PURE__ */ jsx36("div", { className: "mb-card__content", children }),
6356
+ footer != null ? /* @__PURE__ */ jsx36("div", { className: "mb-card__footer", children: footer }) : null
6239
6357
  ]
6240
6358
  }
6241
6359
  );
@@ -6243,10 +6361,10 @@ function Card({
6243
6361
 
6244
6362
  // src/components/IconButton/IconButton.tsx
6245
6363
  import {
6246
- forwardRef as forwardRef6
6364
+ forwardRef as forwardRef8
6247
6365
  } from "react";
6248
- import { jsx as jsx34 } from "react/jsx-runtime";
6249
- var IconButton = forwardRef6(function IconButton2({
6366
+ import { jsx as jsx37 } from "react/jsx-runtime";
6367
+ var IconButton = forwardRef8(function IconButton2({
6250
6368
  icon,
6251
6369
  label,
6252
6370
  variant,
@@ -6271,7 +6389,7 @@ var IconButton = forwardRef6(function IconButton2({
6271
6389
  md: 18,
6272
6390
  lg: 20
6273
6391
  }[resolvedSize];
6274
- return /* @__PURE__ */ jsx34(
6392
+ return /* @__PURE__ */ jsx37(
6275
6393
  "button",
6276
6394
  {
6277
6395
  ref,
@@ -6281,7 +6399,7 @@ var IconButton = forwardRef6(function IconButton2({
6281
6399
  "aria-label": label,
6282
6400
  "aria-busy": loading || void 0,
6283
6401
  ...props,
6284
- children: loading ? /* @__PURE__ */ jsx34(
6402
+ children: loading ? /* @__PURE__ */ jsx37(
6285
6403
  Spinner,
6286
6404
  {
6287
6405
  size: 14,
@@ -6290,13 +6408,13 @@ var IconButton = forwardRef6(function IconButton2({
6290
6408
  trackColor: "transparent",
6291
6409
  "aria-hidden": "true"
6292
6410
  }
6293
- ) : /* @__PURE__ */ jsx34(Icon, { size: iconSize, children: icon })
6411
+ ) : /* @__PURE__ */ jsx37(Icon, { size: iconSize, children: icon })
6294
6412
  }
6295
6413
  );
6296
6414
  });
6297
6415
 
6298
6416
  // src/components/Input/Input.tsx
6299
- import { jsx as jsx35, jsxs as jsxs28 } from "react/jsx-runtime";
6417
+ import { jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
6300
6418
  function Input({
6301
6419
  leftSection,
6302
6420
  rightSection,
@@ -6314,8 +6432,8 @@ function Input({
6314
6432
  className
6315
6433
  ].filter(Boolean).join(" ");
6316
6434
  return /* @__PURE__ */ jsxs28("div", { className: classes, children: [
6317
- leftSection ? /* @__PURE__ */ jsx35("span", { className: "mb-input__section mb-input__section--left", children: /* @__PURE__ */ jsx35(Icon, { size: 18, children: leftSection }) }) : null,
6318
- /* @__PURE__ */ jsx35(
6435
+ leftSection ? /* @__PURE__ */ jsx38("span", { className: "mb-input__section mb-input__section--left", children: /* @__PURE__ */ jsx38(Icon, { size: 18, children: leftSection }) }) : null,
6436
+ /* @__PURE__ */ jsx38(
6319
6437
  "input",
6320
6438
  {
6321
6439
  className: "mb-input__control",
@@ -6324,17 +6442,17 @@ function Input({
6324
6442
  ...props
6325
6443
  }
6326
6444
  ),
6327
- rightSection ? /* @__PURE__ */ jsx35("span", { className: "mb-input__section mb-input__section--right", children: /* @__PURE__ */ jsx35(Icon, { size: 18, children: rightSection }) }) : null
6445
+ rightSection ? /* @__PURE__ */ jsx38("span", { className: "mb-input__section mb-input__section--right", children: /* @__PURE__ */ jsx38(Icon, { size: 18, children: rightSection }) }) : null
6328
6446
  ] });
6329
6447
  }
6330
6448
 
6331
6449
  // src/components/Textarea/Textarea.tsx
6332
- import { jsx as jsx36 } from "react/jsx-runtime";
6450
+ import { jsx as jsx39 } from "react/jsx-runtime";
6333
6451
  function Textarea({
6334
6452
  className = "",
6335
6453
  ...props
6336
6454
  }) {
6337
- return /* @__PURE__ */ jsx36(
6455
+ return /* @__PURE__ */ jsx39(
6338
6456
  "textarea",
6339
6457
  {
6340
6458
  className: `mb-textarea ${className}`,
@@ -6344,7 +6462,7 @@ function Textarea({
6344
6462
  }
6345
6463
 
6346
6464
  // src/components/Text/Text.tsx
6347
- import { jsx as jsx37, jsxs as jsxs29 } from "react/jsx-runtime";
6465
+ import { jsx as jsx40, jsxs as jsxs29 } from "react/jsx-runtime";
6348
6466
  function Text({
6349
6467
  as: Component = "p",
6350
6468
  size,
@@ -6379,16 +6497,16 @@ function Text({
6379
6497
  className: classes,
6380
6498
  ...props,
6381
6499
  children: [
6382
- leftSection != null ? /* @__PURE__ */ jsx37(Icon, { size: iconSize, children: leftSection }) : null,
6383
- /* @__PURE__ */ jsx37("span", { className: "mb-text__content", children }),
6384
- rightSection != null ? /* @__PURE__ */ jsx37(Icon, { size: iconSize, children: rightSection }) : null
6500
+ leftSection != null ? /* @__PURE__ */ jsx40(Icon, { size: iconSize, children: leftSection }) : null,
6501
+ /* @__PURE__ */ jsx40("span", { className: "mb-text__content", children }),
6502
+ rightSection != null ? /* @__PURE__ */ jsx40(Icon, { size: iconSize, children: rightSection }) : null
6385
6503
  ]
6386
6504
  }
6387
6505
  );
6388
6506
  }
6389
6507
 
6390
6508
  // src/components/Title/Title.tsx
6391
- import { jsx as jsx38, jsxs as jsxs30 } from "react/jsx-runtime";
6509
+ import { jsx as jsx41, jsxs as jsxs30 } from "react/jsx-runtime";
6392
6510
  function Title({
6393
6511
  order,
6394
6512
  size,
@@ -6432,9 +6550,9 @@ function Title({
6432
6550
  className: classes,
6433
6551
  ...props,
6434
6552
  children: [
6435
- leftSection != null ? /* @__PURE__ */ jsx38(Icon, { size: iconSize, children: leftSection }) : null,
6436
- /* @__PURE__ */ jsx38("span", { className: "mb-title__content", children }),
6437
- rightSection != null ? /* @__PURE__ */ jsx38(Icon, { size: iconSize, children: rightSection }) : null
6553
+ leftSection != null ? /* @__PURE__ */ jsx41(Icon, { size: iconSize, children: leftSection }) : null,
6554
+ /* @__PURE__ */ jsx41("span", { className: "mb-title__content", children }),
6555
+ rightSection != null ? /* @__PURE__ */ jsx41(Icon, { size: iconSize, children: rightSection }) : null
6438
6556
  ]
6439
6557
  }
6440
6558
  );
@@ -6453,9 +6571,12 @@ export {
6453
6571
  Drawer,
6454
6572
  FileInput,
6455
6573
  Group,
6574
+ Highlight,
6456
6575
  Icon,
6457
6576
  IconButton,
6577
+ Image,
6458
6578
  Input,
6579
+ Link,
6459
6580
  MainbasePortalContext,
6460
6581
  MainbaseProvider,
6461
6582
  Menu,