@koobiq/react-components 0.0.1-beta.20 → 0.0.1-beta.22

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.
Files changed (43) hide show
  1. package/dist/components/Alert/Alert.js +18 -3
  2. package/dist/components/Alert/components/AlertIcon/AlertIcon.js +3 -3
  3. package/dist/components/Alert/components/AlertIcon/types.d.ts +1 -1
  4. package/dist/components/Alert/types.d.ts +21 -3
  5. package/dist/components/Backdrop/Backdrop.js +10 -2
  6. package/dist/components/Backdrop/types.d.ts +13 -2
  7. package/dist/components/Button/Button.js +28 -13
  8. package/dist/components/Button/Button.module.css.js +5 -2
  9. package/dist/components/Button/types.d.ts +22 -3
  10. package/dist/components/ButtonToggleGroup/ButtonToggleGroup.js +3 -3
  11. package/dist/components/ButtonToggleGroup/ButtonToggleGroup.module.css.js +3 -3
  12. package/dist/components/ButtonToggleGroup/types.d.ts +1 -1
  13. package/dist/components/Dialog/components/DialogCloseButton.d.ts +14 -5
  14. package/dist/components/IconButton/IconButton.js +27 -12
  15. package/dist/components/IconButton/index.d.ts +2 -2
  16. package/dist/components/IconButton/types.d.ts +22 -3
  17. package/dist/components/Link/Link.js +30 -8
  18. package/dist/components/Link/Link.module.css.js +4 -4
  19. package/dist/components/Link/types.d.ts +28 -4
  20. package/dist/components/Menu/Menu.js +1 -3
  21. package/dist/components/Modal/Modal.js +2 -10
  22. package/dist/components/Popover/Popover.js +1 -3
  23. package/dist/components/SidePanel/SidePanel.js +2 -6
  24. package/dist/components/TagGroup/Tag.d.ts +24 -0
  25. package/dist/components/TagGroup/Tag.js +10 -0
  26. package/dist/components/TagGroup/TagGroup.d.ts +2 -0
  27. package/dist/components/TagGroup/TagGroup.js +22 -0
  28. package/dist/components/TagGroup/TagGroup.module.css.js +8 -0
  29. package/dist/components/TagGroup/components/TagInner/TagInner.d.ts +11 -0
  30. package/dist/components/TagGroup/components/TagInner/TagInner.js +86 -0
  31. package/dist/components/TagGroup/components/TagInner/TagInner.module.css.js +30 -0
  32. package/dist/components/TagGroup/components/TagInner/index.d.ts +1 -0
  33. package/dist/components/TagGroup/components/TagInner/utils.d.ts +3 -0
  34. package/dist/components/TagGroup/components/TagInner/utils.js +9 -0
  35. package/dist/components/TagGroup/components/index.d.ts +1 -0
  36. package/dist/components/TagGroup/index.d.ts +3 -0
  37. package/dist/components/TagGroup/intl.json.js +7 -0
  38. package/dist/components/TagGroup/types.d.ts +37 -0
  39. package/dist/components/TagGroup/types.js +9 -0
  40. package/dist/components/index.d.ts +2 -0
  41. package/dist/index.js +8 -0
  42. package/dist/style.css +115 -7
  43. package/package.json +5 -5
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { jsxs, jsx } from "react/jsx-runtime";
3
+ import { deprecate } from "@koobiq/logger";
3
4
  import { polymorphicForwardRef, mergeProps, isNotNil, clsx } from "@koobiq/react-core";
4
5
  import { IconXmark16 } from "@koobiq/react-icons";
5
6
  import { useLocalizedStringFormatter } from "@koobiq/react-primitives";
@@ -14,6 +15,8 @@ const Alert = polymorphicForwardRef(
14
15
  compact = false,
15
16
  as: Tag = "div",
16
17
  hideIcon = false,
18
+ isColored: isColoredProp = false,
19
+ isCompact: isCompactProp = false,
17
20
  slotProps,
18
21
  icon,
19
22
  onClose,
@@ -23,6 +26,18 @@ const Alert = polymorphicForwardRef(
23
26
  children,
24
27
  ...other
25
28
  }, ref) => {
29
+ const isColored = isColoredProp || colored;
30
+ const isCompact = isCompactProp || compact;
31
+ if (process.env.NODE_ENV !== "production" && colored) {
32
+ deprecate(
33
+ 'The "colored" prop is deprecated. Use "isColored" prop to replace it.'
34
+ );
35
+ }
36
+ if (process.env.NODE_ENV !== "production" && compact) {
37
+ deprecate(
38
+ 'The "compact" prop is deprecated. Use "isCompact" prop to replace it.'
39
+ );
40
+ }
26
41
  const stringFormatter = useLocalizedStringFormatter(intlMessages);
27
42
  const contentProps = mergeProps(
28
43
  {
@@ -34,7 +49,7 @@ const Alert = polymorphicForwardRef(
34
49
  {
35
50
  icon,
36
51
  status,
37
- compact
52
+ isCompact
38
53
  },
39
54
  slotProps?.statusIcon
40
55
  );
@@ -56,8 +71,8 @@ const Alert = polymorphicForwardRef(
56
71
  className: clsx(
57
72
  s.base,
58
73
  s[status],
59
- compact && s.compact,
60
- colored && s.colored,
74
+ isCompact && s.compact,
75
+ isColored && s.colored,
61
76
  className
62
77
  ),
63
78
  children: [
@@ -4,12 +4,12 @@ import { clsx } from "@koobiq/react-core";
4
4
  import s from "./AlertIcon.module.css.js";
5
5
  import { matchStatusToIcon } from "./utils.js";
6
6
  const AlertIcon = forwardRef(
7
- ({ status = "info", icon, compact }, ref) => /* @__PURE__ */ jsx(
7
+ ({ status = "info", icon, isCompact }, ref) => /* @__PURE__ */ jsx(
8
8
  "div",
9
9
  {
10
- className: clsx(s.base, status && s[status], compact && s.compact),
10
+ className: clsx(s.base, status && s[status], isCompact && s.compact),
11
11
  ref,
12
- children: icon || matchStatusToIcon[compact ? "compact" : "normal"][status]
12
+ children: icon || matchStatusToIcon[isCompact ? "compact" : "normal"][status]
13
13
  }
14
14
  )
15
15
  );
@@ -1,2 +1,2 @@
1
1
  import type { AlertBaseProps } from '../../index';
2
- export type AlertIconProps = Pick<AlertBaseProps, 'status' | 'compact' | 'icon'>;
2
+ export type AlertIconProps = Pick<AlertBaseProps, 'status' | 'icon' | 'isCompact'>;
@@ -2,6 +2,22 @@ import type { ComponentPropsWithRef, ReactNode } from 'react';
2
2
  import type { IconButtonProps } from '../IconButton';
3
3
  export declare const alertPropStatus: readonly ["info", "warning", "error", "success"];
4
4
  export type AlertPropStatus = (typeof alertPropStatus)[number];
5
+ type AlertBaseDeprecatedProps = {
6
+ /**
7
+ * @deprecated
8
+ * The "compact" prop is deprecated. Use "isCompact" prop to replace it.
9
+ *
10
+ * If `true`, compact mode will be enabled in the alert.
11
+ * */
12
+ compact?: boolean;
13
+ /**
14
+ * @deprecated
15
+ * The "colored" prop is deprecated. Use "isColored" prop to replace it.
16
+ *
17
+ * If `true`, background color will be enabled in the alert.
18
+ * */
19
+ colored?: boolean;
20
+ };
5
21
  export type AlertBaseProps = {
6
22
  /**
7
23
  * The status of the component.
@@ -12,12 +28,12 @@ export type AlertBaseProps = {
12
28
  * If `true`, compact mode will be enabled in the alert.
13
29
  * @default false
14
30
  */
15
- compact?: boolean;
31
+ isCompact?: boolean;
16
32
  /**
17
33
  * If `true`, background color will be enabled in the alert.
18
34
  * @default false
19
35
  */
20
- colored?: boolean;
36
+ isColored?: boolean;
21
37
  /** Additional CSS-classes. */
22
38
  className?: string;
23
39
  /**
@@ -35,9 +51,11 @@ export type AlertBaseProps = {
35
51
  icon?: ReactNode;
36
52
  /** A callback function called when the user clicks the alert's close button. */
37
53
  onClose?: IconButtonProps['onPress'];
54
+ /** The props used for each slot inside. */
38
55
  slotProps?: {
39
56
  content?: ComponentPropsWithRef<'div'>;
40
57
  statusIcon?: ComponentPropsWithRef<'div'>;
41
58
  closeIcon?: IconButtonProps;
42
59
  };
43
- };
60
+ } & AlertBaseDeprecatedProps;
61
+ export {};
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import "react";
4
+ import { deprecate } from "@koobiq/logger";
4
5
  import { polymorphicForwardRef, useDOMRef, clsx } from "@koobiq/react-core";
5
6
  import { Transition } from "react-transition-group";
6
7
  import s from "./Backdrop.module.css.js";
@@ -9,14 +10,21 @@ const Backdrop = polymorphicForwardRef(
9
10
  const {
10
11
  as: Tag = "div",
11
12
  duration = 300,
12
- open: openProp = false,
13
+ open = false,
14
+ isOpen: isOpenProp = false,
13
15
  style: styleProp,
14
16
  zIndex,
15
17
  children,
16
18
  className,
17
19
  ...other
18
20
  } = props;
21
+ const isOpen = isOpenProp || open;
19
22
  const domRef = useDOMRef(ref);
23
+ if (process.env.NODE_ENV !== "production" && open) {
24
+ deprecate(
25
+ 'The "open" prop is deprecated. Use "isOpen" prop to replace it.'
26
+ );
27
+ }
20
28
  const style = {
21
29
  "--backdrop-z-index": zIndex,
22
30
  "--backdrop-duration": `${duration}ms`,
@@ -25,7 +33,7 @@ const Backdrop = polymorphicForwardRef(
25
33
  return /* @__PURE__ */ jsx(
26
34
  Transition,
27
35
  {
28
- in: openProp,
36
+ in: isOpen,
29
37
  nodeRef: domRef,
30
38
  timeout: duration,
31
39
  appear: true,
@@ -1,16 +1,27 @@
1
1
  import type { CSSProperties, ReactNode } from 'react';
2
+ type BackdropBaseDeprecatedProps = {
3
+ /**
4
+ * @deprecated
5
+ * The "open" prop is deprecated. Use "isOpen" prop to replace it.
6
+ *
7
+ * If `true`, the component is shown.
8
+ * */
9
+ open?: boolean;
10
+ };
2
11
  export type BackdropBaseProps = {
3
12
  /** If `true`, the component is shown. */
4
- open?: boolean;
13
+ isOpen?: boolean;
5
14
  /** Additional CSS-classes. */
6
15
  className?: string;
7
16
  /** The content of the component. */
8
17
  children?: ReactNode;
9
18
  /** Inline styles. */
10
19
  style?: CSSProperties;
20
+ /** The duration of the transition, in milliseconds. */
11
21
  duration?: number;
12
22
  /** z-index. */
13
23
  zIndex?: CSSProperties['zIndex'];
14
24
  /** Unique identifier for testing purposes. */
15
25
  'data-testid'?: string;
16
- };
26
+ } & BackdropBaseDeprecatedProps;
27
+ export {};
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
3
+ import { deprecate } from "@koobiq/logger";
3
4
  import { polymorphicForwardRef, clsx } from "@koobiq/react-core";
4
5
  import { Button as Button$1 } from "@koobiq/react-primitives";
5
6
  import s from "./Button.module.css.js";
@@ -7,6 +8,8 @@ const Button = polymorphicForwardRef(
7
8
  ({
8
9
  as: Tag = "button",
9
10
  variant = "contrast-filled",
11
+ isLoading: isLoadingProp = false,
12
+ isDisabled: isDisabledProp = false,
10
13
  onlyIcon = false,
11
14
  fullWidth = false,
12
15
  progress = false,
@@ -17,31 +20,43 @@ const Button = polymorphicForwardRef(
17
20
  className,
18
21
  ...other
19
22
  }, ref) => {
23
+ const isLoading = isLoadingProp || progress;
24
+ const isDisabled = isDisabledProp || disabled;
25
+ if (process.env.NODE_ENV !== "production" && progress) {
26
+ deprecate(
27
+ 'The "progress" prop is deprecated. Use "isLoading" prop to replace it.'
28
+ );
29
+ }
30
+ if (process.env.NODE_ENV !== "production" && disabled) {
31
+ deprecate(
32
+ 'The "disabled" prop is deprecated. Use "isDisabled" prop to replace it.'
33
+ );
34
+ }
20
35
  const iconOnly = (!children || onlyIcon) && (startIcon || endIcon);
21
36
  const classNameFn = ({
22
- hovered,
23
- disabled: disabled2,
24
- loading,
25
- focusVisible,
26
- pressed
37
+ isHovered,
38
+ isDisabled: isDisabled2,
39
+ isLoading: isLoading2,
40
+ isPressed,
41
+ isFocusVisible
27
42
  }) => clsx(
28
43
  s.base,
29
44
  variant && s[variant],
30
- hovered && s.hovered,
31
- pressed && s.pressed,
45
+ isHovered && s.hovered,
46
+ isPressed && s.pressed,
32
47
  onlyIcon && s.onlyIcon,
33
- disabled2 && s.disabled,
34
- loading && s.progress,
48
+ isDisabled2 && s.disabled,
49
+ isLoading2 && s.loading,
35
50
  fullWidth && s.fullWidth,
36
- focusVisible && s.focusVisible,
51
+ isFocusVisible && s.focusVisible,
37
52
  className
38
53
  );
39
54
  return /* @__PURE__ */ jsxs(
40
55
  Button$1,
41
56
  {
42
57
  as: Tag,
43
- loading: progress,
44
- disabled,
58
+ isLoading,
59
+ isDisabled,
45
60
  className: classNameFn,
46
61
  ...other,
47
62
  ref,
@@ -54,7 +69,7 @@ const Button = polymorphicForwardRef(
54
69
  endIcon
55
70
  ] })
56
71
  ] }),
57
- progress && /* @__PURE__ */ jsx("div", { className: s.loader })
72
+ isLoading && /* @__PURE__ */ jsx("div", { className: s.loader })
58
73
  ]
59
74
  }
60
75
  );
@@ -1,24 +1,26 @@
1
1
  const base = "kbq-button-d95067";
2
2
  const hovered = "kbq-button-hovered-037da3";
3
- const progress = "kbq-button-progress-f454f0";
3
+ const loading = "kbq-button-loading-dbac1d";
4
4
  const pressed = "kbq-button-pressed-508d5d";
5
5
  const focusVisible = "kbq-button-focusVisible-e63c2b";
6
6
  const disabled = "kbq-button-disabled-1df5f6";
7
7
  const fullWidth = "kbq-button-fullWidth-c149b8";
8
8
  const onlyIcon = "kbq-button-onlyIcon-e1268c";
9
9
  const loader = "kbq-button-loader-467f28";
10
+ const progress = "kbq-button-progress-f454f0";
10
11
  const content = "kbq-button-content-2e3014";
11
12
  const label = "kbq-button-label-9f6f6b";
12
13
  const s = {
13
14
  base,
14
15
  hovered,
15
- progress,
16
+ loading,
16
17
  pressed,
17
18
  focusVisible,
18
19
  disabled,
19
20
  fullWidth,
20
21
  onlyIcon,
21
22
  loader,
23
+ progress,
22
24
  content,
23
25
  label,
24
26
  "contrast-filled": "kbq-button-contrast-filled-606131",
@@ -38,6 +40,7 @@ export {
38
40
  hovered,
39
41
  label,
40
42
  loader,
43
+ loading,
41
44
  onlyIcon,
42
45
  pressed,
43
46
  progress
@@ -3,6 +3,24 @@ import type { ExtendableProps } from '@koobiq/react-core';
3
3
  import type { HoverEvent, UseButtonProps } from '@koobiq/react-primitives';
4
4
  export declare const buttonPropVariant: readonly ["contrast-filled", "contrast-transparent", "fade-contrast-filled", "fade-contrast-outline", "fade-theme-outline", "theme-transparent"];
5
5
  export type ButtonPropVariant = (typeof buttonPropVariant)[number];
6
+ type ButtonBaseDeprecatedProps = {
7
+ /**
8
+ * @deprecated
9
+ * The "progress" prop is deprecated. Use "isLoading" prop to replace it.
10
+ *
11
+ * If `true`, the progress indicator is shown and the button becomes disabled.
12
+ * @default false
13
+ * */
14
+ progress?: boolean;
15
+ /**
16
+ * @deprecated
17
+ * The "disabled" prop is deprecated. Use "isDisabled" prop to replace it.
18
+ *
19
+ * If `true`, the component is disabled.
20
+ * @default false
21
+ * */
22
+ disabled?: boolean;
23
+ };
6
24
  export type ButtonBaseProps = ExtendableProps<{
7
25
  /** The content of the component. */
8
26
  children?: ReactNode;
@@ -15,12 +33,12 @@ export type ButtonBaseProps = ExtendableProps<{
15
33
  * If `true`, the progress indicator is shown and the button becomes disabled.
16
34
  * @default false
17
35
  * */
18
- progress?: boolean;
36
+ isLoading?: boolean;
19
37
  /**
20
38
  * If `true`, the component is disabled.
21
39
  * @default false
22
40
  * */
23
- disabled?: boolean;
41
+ isDisabled?: boolean;
24
42
  /**
25
43
  * If `true`, only the icon is shown, and the button has same sides.
26
44
  * @default false
@@ -43,4 +61,5 @@ export type ButtonBaseProps = ExtendableProps<{
43
61
  onHoverStart?: (e: HoverEvent) => void;
44
62
  /** Handler that is called when a hover interaction ends. */
45
63
  onHoverEnd?: (e: HoverEvent) => void;
46
- }, UseButtonProps>;
64
+ } & ButtonBaseDeprecatedProps, UseButtonProps>;
65
+ export {};
@@ -12,7 +12,7 @@ import { getSelectedToggleButton, getToggleButtonStyle } from "./utils.js";
12
12
  const MAX_ITEMS = 5;
13
13
  const ButtonToggleGroup = forwardRef((props, ref) => {
14
14
  const {
15
- isBlock = false,
15
+ fullWidth = false,
16
16
  isDisabled = false,
17
17
  hasEqualItemSize = false,
18
18
  style,
@@ -77,11 +77,11 @@ const ButtonToggleGroup = forwardRef((props, ref) => {
77
77
  {
78
78
  className: clsx(
79
79
  s.base,
80
- isBlock && s.block,
80
+ fullWidth && s.fullWidth,
81
81
  hasEqualItemSize && s.hasEqualItemSize,
82
82
  className
83
83
  ),
84
- "data-block": isBlock,
84
+ "data-fullwidth": fullWidth,
85
85
  "data-animated": isAnimated,
86
86
  "data-equal-item-size": hasEqualItemSize,
87
87
  ref: domRef,
@@ -1,17 +1,17 @@
1
1
  const base = "kbq-buttontogglegroup-79a88d";
2
- const block = "kbq-buttontogglegroup-block-f9494f";
2
+ const fullWidth = "kbq-buttontogglegroup-fullWidth-f63c5c";
3
3
  const thumb = "kbq-buttontogglegroup-thumb-7ff4ae";
4
4
  const container = "kbq-buttontogglegroup-container-e48aaf";
5
5
  const s = {
6
6
  base,
7
- block,
7
+ fullWidth,
8
8
  thumb,
9
9
  container
10
10
  };
11
11
  export {
12
12
  base,
13
- block,
14
13
  container,
15
14
  s as default,
15
+ fullWidth,
16
16
  thumb
17
17
  };
@@ -12,7 +12,7 @@ export type ButtonToggleGroupBaseProps = {
12
12
  * If `true`, the button will take up the full width of its container.
13
13
  * @default false
14
14
  * */
15
- isBlock?: boolean;
15
+ fullWidth?: boolean;
16
16
  /** The contents of the collection. */
17
17
  children?: Array<ReactElement<ButtonToggleProps>>;
18
18
  /**
@@ -4,19 +4,28 @@ export type DialogCloseButtonRef = ComponentRef<'button'>;
4
4
  export type DialogCloseButtonProps = ButtonProps;
5
5
  export declare const DialogCloseButton: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
6
6
  ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined;
7
- }, "children" | "progress" | "as" | "className" | "autoFocus" | "id" | "rel" | "aria-controls" | "aria-describedby" | "aria-details" | "aria-expanded" | "aria-haspopup" | "aria-label" | "aria-labelledby" | "aria-pressed" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "target" | "type" | "href" | "disabled" | "onPress" | "onPressStart" | "onPressEnd" | "onPressChange" | "onPressUp" | "onFocusChange" | "elementType" | "preventFocusOnPress" | "excludeFromTabOrder" | "variant" | "onHoverStart" | "onHoverEnd" | "onlyIcon" | "fullWidth" | "startIcon" | "endIcon" | "data-testid"> & Omit<import("@koobiq/react-primitives").ButtonOptions, "children" | "progress" | "className" | "disabled" | "variant" | "onHoverStart" | "onHoverEnd" | "onlyIcon" | "fullWidth" | "startIcon" | "endIcon" | "data-testid"> & {
8
- children?: import("react").ReactNode;
9
- variant?: import("../..").ButtonPropVariant;
7
+ }, "children" | "as" | "className" | "autoFocus" | "id" | "rel" | "aria-controls" | "aria-describedby" | "aria-details" | "aria-expanded" | "aria-haspopup" | "aria-label" | "aria-labelledby" | "aria-pressed" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "target" | "type" | "href" | "isDisabled" | "onPress" | "onPressStart" | "onPressEnd" | "onPressChange" | "onPressUp" | "onFocusChange" | "elementType" | "preventFocusOnPress" | "excludeFromTabOrder" | "variant" | "onHoverStart" | "onHoverEnd" | "isLoading" | "onlyIcon" | "fullWidth" | "startIcon" | "endIcon" | "data-testid" | keyof {
10
8
  progress?: boolean;
11
9
  disabled?: boolean;
10
+ }> & Omit<import("@koobiq/react-primitives").ButtonOptions, "children" | "className" | "isDisabled" | "variant" | "onHoverStart" | "onHoverEnd" | "isLoading" | "onlyIcon" | "fullWidth" | "startIcon" | "endIcon" | "data-testid" | keyof {
11
+ progress?: boolean;
12
+ disabled?: boolean;
13
+ }> & {
14
+ children?: import("react").ReactNode;
15
+ variant?: import("../..").ButtonPropVariant;
16
+ isLoading?: boolean;
17
+ isDisabled?: boolean;
12
18
  onlyIcon?: boolean;
13
19
  className?: string;
14
20
  fullWidth?: boolean;
15
21
  startIcon?: import("react").ReactNode;
16
22
  endIcon?: import("react").ReactNode;
17
23
  'data-testid'?: string | number;
18
- onHoverStart?: (e: import("@react-types/shared").HoverEvent) => void;
19
- onHoverEnd?: (e: import("@react-types/shared").HoverEvent) => void;
24
+ onHoverStart?: (e: import("@koobiq/react-primitives").HoverEvent) => void;
25
+ onHoverEnd?: (e: import("@koobiq/react-primitives").HoverEvent) => void;
26
+ } & {
27
+ progress?: boolean;
28
+ disabled?: boolean;
20
29
  } & {
21
30
  as?: "button" | undefined;
22
31
  }, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
+ import { deprecate } from "@koobiq/logger";
3
4
  import { polymorphicForwardRef, clsx } from "@koobiq/react-core";
4
5
  import { Button } from "@koobiq/react-primitives";
5
6
  import s from "./IconButton.module.css.js";
@@ -10,33 +11,47 @@ const IconButton = polymorphicForwardRef(
10
11
  size = "xl",
11
12
  compact = false,
12
13
  disabled = false,
14
+ isCompact: isCompactProp = false,
15
+ isDisabled: isDisabledProp = false,
13
16
  children,
14
17
  className,
15
18
  ...other
16
19
  }, ref) => {
20
+ const isCompact = isCompactProp || compact;
21
+ const isDisabled = isDisabledProp || disabled;
22
+ if (process.env.NODE_ENV !== "production" && compact) {
23
+ deprecate(
24
+ 'The "compact" prop is deprecated. Use "isCompact" prop to replace it.'
25
+ );
26
+ }
27
+ if (process.env.NODE_ENV !== "production" && disabled) {
28
+ deprecate(
29
+ 'The "disabled" prop is deprecated. Use "isDisabled" prop to replace it.'
30
+ );
31
+ }
17
32
  const classNameFn = ({
18
- hovered,
19
- disabled: disabled2,
20
- loading,
21
- focusVisible,
22
- pressed
33
+ isHovered,
34
+ isDisabled: isDisabled2,
35
+ isLoading,
36
+ isFocusVisible,
37
+ isPressed
23
38
  }) => clsx(
24
39
  s.base,
25
40
  size && s[size],
26
41
  variant && s[variant],
27
- hovered && s.hovered,
28
- pressed && s.pressed,
29
- disabled2 && s.disabled,
30
- loading && s.progress,
31
- compact && s.compact,
32
- focusVisible && s.focusVisible,
42
+ isHovered && s.hovered,
43
+ isPressed && s.pressed,
44
+ isDisabled2 && s.disabled,
45
+ isLoading && s.progress,
46
+ isCompact && s.compact,
47
+ isFocusVisible && s.focusVisible,
33
48
  className
34
49
  );
35
50
  return /* @__PURE__ */ jsx(
36
51
  Button,
37
52
  {
38
53
  as: Tag,
39
- disabled,
54
+ isDisabled,
40
55
  className: classNameFn,
41
56
  ...other,
42
57
  ref,
@@ -1,2 +1,2 @@
1
- export * from './IconButton.js';
2
- export * from './types.js';
1
+ export * from './IconButton';
2
+ export * from './types';
@@ -5,6 +5,24 @@ export declare const iconButtonPropVariant: readonly ["theme", "theme-contrast",
5
5
  export type IconButtonPropVariant = (typeof iconButtonPropVariant)[number];
6
6
  export declare const iconButtonPropSize: readonly ["l", "xl"];
7
7
  export type IconButtonPropSize = (typeof iconButtonPropSize)[number];
8
+ type IconButtonBaseDeprecatedProps = {
9
+ /**
10
+ * @deprecated
11
+ * The "disabled" prop is deprecated. Use "isDisabled" prop to replace it.
12
+ *
13
+ * If `true`, the component is disabled.
14
+ * @default false
15
+ * */
16
+ disabled?: boolean;
17
+ /**
18
+ * @deprecated
19
+ * The "compact" prop is deprecated. Use "isCompact" prop to replace it.
20
+ *
21
+ * If `true`, reduce the size of the component canvas.
22
+ * @default false
23
+ * */
24
+ compact?: boolean;
25
+ };
8
26
  export type IconButtonBaseProps = ExtendableProps<{
9
27
  /** The content of the component. */
10
28
  children?: ReactNode;
@@ -17,7 +35,7 @@ export type IconButtonBaseProps = ExtendableProps<{
17
35
  * If `true`, the component is disabled.
18
36
  * @default false
19
37
  * */
20
- disabled?: boolean;
38
+ isDisabled?: boolean;
21
39
  /**
22
40
  * Size of the component
23
41
  * @default xl
@@ -27,11 +45,12 @@ export type IconButtonBaseProps = ExtendableProps<{
27
45
  * If `true`, reduce the size of the component canvas.
28
46
  * @default false
29
47
  * */
30
- compact?: boolean;
48
+ isCompact?: boolean;
31
49
  /** Additional CSS-classes. */
32
50
  className?: string;
33
51
  /** Handler that is called when a hover interaction starts. */
34
52
  onHoverStart?: (e: HoverEvent) => void;
35
53
  /** Handler that is called when a hover interaction ends. */
36
54
  onHoverEnd?: (e: HoverEvent) => void;
37
- }, UseButtonProps>;
55
+ } & IconButtonBaseDeprecatedProps, UseButtonProps>;
56
+ export {};
@@ -1,11 +1,15 @@
1
1
  "use client";
2
2
  import { jsxs } from "react/jsx-runtime";
3
+ import { deprecate } from "@koobiq/logger";
3
4
  import { polymorphicForwardRef, clsx } from "@koobiq/react-core";
4
5
  import { Link as Link$1 } from "@koobiq/react-primitives";
5
6
  import s from "./Link.module.css.js";
6
7
  const Link = polymorphicForwardRef((props, ref) => {
7
8
  const {
8
9
  variant = "text-normal",
10
+ isPseudo: isPseudoProp = false,
11
+ isDisabled: isDisabledProp = false,
12
+ allowVisited: allowVisitedProp = false,
9
13
  visitable = false,
10
14
  pseudo = false,
11
15
  disabled,
@@ -16,24 +20,42 @@ const Link = polymorphicForwardRef((props, ref) => {
16
20
  className,
17
21
  ...other
18
22
  } = props;
23
+ const allowVisited = allowVisitedProp || visitable;
24
+ const isDisabled = isDisabledProp || disabled;
25
+ const isPseudo = isPseudoProp || pseudo;
19
26
  const hasIcon = Boolean(startIcon || endIcon);
27
+ if (process.env.NODE_ENV !== "production" && visitable) {
28
+ deprecate(
29
+ 'The "visitable" prop is deprecated. Use "allowVisited" prop to replace it.'
30
+ );
31
+ }
32
+ if (process.env.NODE_ENV !== "production" && pseudo) {
33
+ deprecate(
34
+ 'The "pseudo" prop is deprecated. Use "isPseudo" prop to replace it.'
35
+ );
36
+ }
37
+ if (process.env.NODE_ENV !== "production" && disabled) {
38
+ deprecate(
39
+ 'The "disabled" prop is deprecated. Use "isDisabled" prop to replace it.'
40
+ );
41
+ }
20
42
  const elementType = as !== "a" && as !== "button" ? `${as}` : void 0;
21
43
  return /* @__PURE__ */ jsxs(
22
44
  Link$1,
23
45
  {
24
46
  as,
25
- disabled,
47
+ isDisabled,
26
48
  elementType,
27
- ...disabled && { tabIndex: -1 },
28
- className: ({ hovered, pressed, focusVisible }) => clsx(
49
+ ...isDisabled && { tabIndex: -1 },
50
+ className: ({ isHovered, isPressed, isFocusVisible }) => clsx(
29
51
  s.base,
30
52
  s[variant],
31
- pseudo && s.pseudo,
32
- hovered && s.hovered,
33
- pressed && s.pressed,
53
+ isPseudo && s.pseudo,
54
+ isHovered && s.hovered,
55
+ isPressed && s.pressed,
34
56
  hasIcon && s.hasIcon,
35
- visitable && s.visitable,
36
- focusVisible && s.focusVisible,
57
+ allowVisited && s.allowVisited,
58
+ isFocusVisible && s.focusVisible,
37
59
  className
38
60
  ),
39
61
  ...other,