@koobiq/react-components 0.0.1-beta.21 → 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.
@@ -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
  /**
@@ -41,4 +57,5 @@ export type AlertBaseProps = {
41
57
  statusIcon?: ComponentPropsWithRef<'div'>;
42
58
  closeIcon?: IconButtonProps;
43
59
  };
44
- };
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,11 +4,17 @@ 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;
@@ -17,6 +23,9 @@ export declare const DialogCloseButton: import("react").ForwardRefExoticComponen
17
23
  'data-testid'?: string | number;
18
24
  onHoverStart?: (e: import("@koobiq/react-primitives").HoverEvent) => void;
19
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,
@@ -2,7 +2,7 @@ const base = "kbq-link-093ccd";
2
2
  const hovered = "kbq-link-hovered-1916bc";
3
3
  const pressed = "kbq-link-pressed-0b493d";
4
4
  const focusVisible = "kbq-link-focusVisible-a98307";
5
- const visitable = "kbq-link-visitable-c8175e";
5
+ const allowVisited = "kbq-link-allowVisited-cb5a56";
6
6
  const pseudo = "kbq-link-pseudo-5f21eb";
7
7
  const hasIcon = "kbq-link-hasIcon-ea84d7";
8
8
  const inherit = "kbq-link-inherit-aa3736";
@@ -11,7 +11,7 @@ const s = {
11
11
  hovered,
12
12
  pressed,
13
13
  focusVisible,
14
- visitable,
14
+ allowVisited,
15
15
  pseudo,
16
16
  hasIcon,
17
17
  "text-normal": "kbq-link-text-normal-814a6c",
@@ -20,6 +20,7 @@ const s = {
20
20
  inherit
21
21
  };
22
22
  export {
23
+ allowVisited,
23
24
  base,
24
25
  s as default,
25
26
  focusVisible,
@@ -27,6 +28,5 @@ export {
27
28
  hovered,
28
29
  inherit,
29
30
  pressed,
30
- pseudo,
31
- visitable
31
+ pseudo
32
32
  };
@@ -3,6 +3,29 @@ import type { ExtendableProps } from '@koobiq/react-core';
3
3
  import type { UseLinkProps } from '@koobiq/react-primitives';
4
4
  import type { TypographyPropVariant } from '../Typography';
5
5
  export type LinkPropVariant = Extract<TypographyPropVariant, 'text-compact' | 'text-normal' | 'text-big' | 'inherit'>;
6
+ type LinkBaseDeprecatedProps = {
7
+ /**
8
+ * @deprecated
9
+ * The "disabled" prop is deprecated. Use "isDisabled" prop to replace it.
10
+ *
11
+ * If `true`, the component is disabled.
12
+ * */
13
+ disabled?: boolean;
14
+ /**
15
+ * @deprecated
16
+ * The "visitable" prop is deprecated. Use "isVisitable" prop to replace it.
17
+ *
18
+ * If `true`, displays :visited CSS-state.
19
+ * */
20
+ visitable?: boolean;
21
+ /**
22
+ * @deprecated
23
+ * The "pseudo" prop is deprecated. Use "isPseudo" prop to replace it.
24
+ *
25
+ * If `true`, displays the link as a pseudo-link.
26
+ * */
27
+ pseudo?: boolean;
28
+ };
6
29
  export type LinkBaseProps = ExtendableProps<{
7
30
  /** The content of the component. */
8
31
  children?: ReactNode;
@@ -13,13 +36,14 @@ export type LinkBaseProps = ExtendableProps<{
13
36
  /** Icon placed after the children. */
14
37
  endIcon?: ReactNode;
15
38
  /** If `true`, the component is disabled. */
16
- disabled?: boolean;
39
+ isDisabled?: boolean;
17
40
  /** If `true`, displays :visited CSS-state. */
18
- visitable?: boolean;
41
+ allowVisited?: boolean;
19
42
  /** If `true`, displays the link as a pseudo-link. */
20
- pseudo?: boolean;
43
+ isPseudo?: boolean;
21
44
  /** Additional CSS-classes. */
22
45
  className?: string;
23
46
  /** Inline styles */
24
47
  style?: CSSProperties;
25
- }, UseLinkProps>;
48
+ } & LinkBaseDeprecatedProps, UseLinkProps>;
49
+ export {};
@@ -31,7 +31,6 @@ function MenuRender(props, ref) {
31
31
  state,
32
32
  controlRef
33
33
  );
34
- const { isDisabled, ...otherMenuTriggerProps } = menuTriggerProps;
35
34
  const popoverProps = mergeProps(
36
35
  {
37
36
  style,
@@ -49,8 +48,7 @@ function MenuRender(props, ref) {
49
48
  return /* @__PURE__ */ jsxs(Fragment, { children: [
50
49
  control?.({
51
50
  ref: controlRef,
52
- disabled: isDisabled,
53
- ...otherMenuTriggerProps
51
+ ...menuTriggerProps
54
52
  }),
55
53
  /* @__PURE__ */ jsx(PopoverInner, { type: "menu", placement, ...popoverProps, children: /* @__PURE__ */ jsx(MenuInner, { ...otherProps, ...menuProps }) })
56
54
  ] });
@@ -63,11 +63,7 @@ const ModalComponent = forwardRef((props, ref) => {
63
63
  },
64
64
  other
65
65
  );
66
- const backdropProps = mergeProps(
67
- { open: openState && !hideBackdrop },
68
- underlayProps,
69
- slotProps?.backdrop
70
- );
66
+ const backdropProps = mergeProps({ isOpen: openState && !hideBackdrop }, underlayProps, slotProps?.backdrop);
71
67
  const dialogProps = mergeProps(
72
68
  {
73
69
  onClose: close,
@@ -85,12 +81,8 @@ const ModalComponent = forwardRef((props, ref) => {
85
81
  },
86
82
  slotProps?.modal
87
83
  );
88
- const { isDisabled, ...otherTriggerProps } = triggerProps;
89
84
  return /* @__PURE__ */ jsxs(Fragment, { children: [
90
- control?.({
91
- disabled: isDisabled,
92
- ...otherTriggerProps
93
- }),
85
+ control?.(triggerProps),
94
86
  /* @__PURE__ */ jsx(
95
87
  Transition,
96
88
  {
@@ -69,7 +69,6 @@ const PopoverInner = (props) => {
69
69
  if (isValidElement(children)) return cloneElement(children, overlayProps);
70
70
  return children;
71
71
  };
72
- const { isDisabled, ...otherTriggerProps } = triggerProps;
73
72
  const arrowProps = mergeProps(
74
73
  { className: s.arrow },
75
74
  arrowPropsCommon,
@@ -104,8 +103,7 @@ const PopoverInner = (props) => {
104
103
  return /* @__PURE__ */ jsxs(Fragment, { children: [
105
104
  control?.({
106
105
  ref: controlRef,
107
- disabled: isDisabled,
108
- ...otherTriggerProps
106
+ ...triggerProps
109
107
  }),
110
108
  /* @__PURE__ */ jsx(Transition, { ...transitionProps, children: (transition) => /* @__PURE__ */ jsxs(
111
109
  Overlay,
@@ -67,7 +67,7 @@ const SidePanelComponent = forwardRef(
67
67
  other
68
68
  );
69
69
  const backdropProps = mergeProps(
70
- { open: openState && !hideBackdrop },
70
+ { isOpen: openState && !hideBackdrop },
71
71
  underlayProps,
72
72
  slotProps?.backdrop
73
73
  );
@@ -88,12 +88,8 @@ const SidePanelComponent = forwardRef(
88
88
  },
89
89
  slotProps?.panel
90
90
  );
91
- const { isDisabled, ...otherTriggerProps } = triggerProps;
92
91
  return /* @__PURE__ */ jsxs(Fragment, { children: [
93
- control?.({
94
- disabled: isDisabled,
95
- ...otherTriggerProps
96
- }),
92
+ control?.(triggerProps),
97
93
  /* @__PURE__ */ jsx(
98
94
  Transition,
99
95
  {
package/dist/style.css CHANGED
@@ -560,12 +560,12 @@
560
560
  inset: 0;
561
561
  }
562
562
 
563
- .kbq-button-hovered-037da3:not(.kbq-button-progress-f454f0) {
563
+ .kbq-button-hovered-037da3:not(.kbq-button-loading-dbac1d) {
564
564
  --button-border-color: var(--button-border-color-hover);
565
565
  background-color: var(--button-bg-color-hover);
566
566
  }
567
567
 
568
- .kbq-button-pressed-508d5d:not(.kbq-button-progress-f454f0) {
568
+ .kbq-button-pressed-508d5d:not(.kbq-button-loading-dbac1d) {
569
569
  --button-border-color: var(--button-border-color-active);
570
570
  background-color: var(--button-bg-color-active);
571
571
  }
@@ -574,7 +574,7 @@
574
574
  --button-outline-color: var(--kbq-states-line-focus-theme);
575
575
  }
576
576
 
577
- .kbq-button-progress-f454f0, .kbq-button-disabled-1df5f6 {
577
+ .kbq-button-loading-dbac1d, .kbq-button-disabled-1df5f6 {
578
578
  cursor: not-allowed;
579
579
  }
580
580
 
@@ -1651,19 +1651,19 @@
1651
1651
  text-decoration-color: var(--kbq-line-theme-less);
1652
1652
  }
1653
1653
 
1654
- .kbq-link-visitable-c8175e:where(:visited) {
1654
+ .kbq-link-allowVisited-cb5a56:where(:visited) {
1655
1655
  color: var(--kbq-foreground-visited);
1656
1656
  -webkit-text-decoration-color: var(--kbq-line-visited);
1657
1657
  text-decoration-color: var(--kbq-line-visited);
1658
1658
  }
1659
1659
 
1660
- .kbq-link-visitable-c8175e:where(.kbq-link-hovered-1916bc:visited) {
1660
+ .kbq-link-allowVisited-cb5a56:where(.kbq-link-hovered-1916bc:visited) {
1661
1661
  color: var(--kbq-states-foreground-visited-hover);
1662
1662
  -webkit-text-decoration-color: var(--kbq-line-visited);
1663
1663
  text-decoration-color: var(--kbq-line-visited);
1664
1664
  }
1665
1665
 
1666
- .kbq-link-visitable-c8175e:where(.kbq-link-pressed-0b493d:visited) {
1666
+ .kbq-link-allowVisited-cb5a56:where(.kbq-link-pressed-0b493d:visited) {
1667
1667
  color: var(--kbq-states-foreground-visited-active);
1668
1668
  -webkit-text-decoration-color: var(--kbq-line-visited);
1669
1669
  text-decoration-color: var(--kbq-line-visited);
@@ -3206,7 +3206,7 @@
3206
3206
  overflow: hidden;
3207
3207
  }
3208
3208
 
3209
- .kbq-buttontogglegroup-block-f9494f {
3209
+ .kbq-buttontogglegroup-fullWidth-f63c5c {
3210
3210
  inline-size: 100%;
3211
3211
  }
3212
3212
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koobiq/react-components",
3
- "version": "0.0.1-beta.21",
3
+ "version": "0.0.1-beta.22",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {
@@ -27,10 +27,10 @@
27
27
  "@koobiq/design-tokens": "^3.12.1",
28
28
  "@types/react-transition-group": "^4.4.12",
29
29
  "react-transition-group": "^4.4.5",
30
- "@koobiq/logger": "0.0.1-beta.21",
31
- "@koobiq/react-icons": "0.0.1-beta.21",
32
- "@koobiq/react-primitives": "0.0.1-beta.21",
33
- "@koobiq/react-core": "0.0.1-beta.21"
30
+ "@koobiq/logger": "0.0.1-beta.22",
31
+ "@koobiq/react-core": "0.0.1-beta.22",
32
+ "@koobiq/react-icons": "0.0.1-beta.22",
33
+ "@koobiq/react-primitives": "0.0.1-beta.22"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "@koobiq/design-tokens": "^3.11.2",