@citygross/components_v2 0.0.54 → 0.0.55

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,17 +1,17 @@
1
1
  import React from 'react';
2
- import { TPaletteKeys, THardSpacingKeys, TSpacingKeys } from '@citygross/design-tokens_v2';
2
+ import { THardSpacingKeys, TPaletteKeys, TSpacingKeys } from '@citygross/design-tokens_v2';
3
3
 
4
4
  declare type TAlertBox = {
5
+ arrowPlacement?: 'left' | 'right';
6
+ arrowSpacing?: THardSpacingKeys;
5
7
  background?: TPaletteKeys;
6
8
  borderColor?: TPaletteKeys;
7
- icon?: JSX.Element;
8
9
  children: React.ReactNode;
10
+ icon?: JSX.Element;
9
11
  iconMinWidth?: THardSpacingKeys;
10
- withArrow?: boolean;
11
- arrowPlacement?: 'left' | 'right';
12
- arrowSpacing?: THardSpacingKeys;
13
12
  padding?: TSpacingKeys;
13
+ withArrow?: boolean;
14
14
  };
15
- declare function AlertBox({ background, borderColor, icon, iconMinWidth, withArrow, arrowSpacing, arrowPlacement, padding, children }: TAlertBox): JSX.Element;
15
+ declare function AlertBox({ arrowPlacement, arrowSpacing, background, borderColor, children, icon, iconMinWidth, padding, withArrow }: TAlertBox): JSX.Element;
16
16
 
17
17
  export { AlertBox, TAlertBox };
@@ -3,15 +3,15 @@ import { BoxArrow } from '../BoxArrow/BoxArrow.js';
3
3
  import { alertBox, iconContainer } from './AlertBox.css.vanilla.js';
4
4
 
5
5
  function AlertBox({
6
+ arrowPlacement,
7
+ arrowSpacing,
6
8
  background = "blueLight",
7
9
  borderColor = "alertBlue",
10
+ children,
8
11
  icon,
9
12
  iconMinWidth = 24,
10
- withArrow,
11
- arrowSpacing,
12
- arrowPlacement,
13
13
  padding = "sm",
14
- children
14
+ withArrow
15
15
  }) {
16
16
  return /* @__PURE__ */ React.createElement("div", null, withArrow ? /* @__PURE__ */ React.createElement(
17
17
  BoxArrow,
@@ -30,7 +30,7 @@ function AlertBox({
30
30
  padding
31
31
  })
32
32
  },
33
- icon ? /* @__PURE__ */ React.createElement("div", { className: iconContainer({ minWidth: `${iconMinWidth}` }) }, icon) : null,
33
+ icon ? /* @__PURE__ */ React.createElement("div", { className: iconContainer({ minWidth: iconMinWidth }) }, icon) : null,
34
34
  children
35
35
  ));
36
36
  }
@@ -1,21 +1,21 @@
1
1
  import React from 'react';
2
2
 
3
3
  declare type TCgButton = {
4
- size?: 'small' | 'medium' | 'icon' | 'large';
5
- variant?: 'primary' | 'secondary' | 'ghost' | 'tertiary' | 'prio' | 'dark';
6
- icon?: React.ReactNode;
7
- flexReverse?: boolean;
8
- loading?: boolean;
4
+ ariaLabel?: string;
5
+ buttonRef?: React.Ref<HTMLButtonElement>;
9
6
  children?: React.ReactNode;
7
+ className?: string;
10
8
  disabled?: boolean;
11
- onClick?: () => void;
9
+ flexReverse?: boolean;
12
10
  fullWidth?: boolean;
13
- buttonRef?: React.Ref<HTMLButtonElement>;
11
+ icon?: React.ReactNode;
12
+ loading?: boolean;
13
+ onClick?: () => void;
14
14
  round?: boolean;
15
- className?: string;
16
15
  shouldPreventDefault?: boolean;
17
- ariaLabel?: string;
16
+ size?: 'small' | 'medium' | 'icon' | 'large';
17
+ variant?: 'primary' | 'secondary' | 'ghost' | 'tertiary' | 'prio' | 'dark';
18
18
  };
19
- declare const Button: ({ size, variant, icon, flexReverse, disabled, onClick, children, loading, fullWidth, buttonRef, round, className, shouldPreventDefault, ariaLabel }: TCgButton) => JSX.Element;
19
+ declare const Button: ({ ariaLabel, buttonRef, children, className, disabled, flexReverse, fullWidth, icon, loading, onClick, round, shouldPreventDefault, size, variant }: TCgButton) => JSX.Element;
20
20
 
21
21
  export { Button, TCgButton };
@@ -3,43 +3,38 @@ import { button, buttonContent, buttonLoader } from './Button.css.vanilla.js';
3
3
  import { Spinner } from '../Spinner/Spinner.js';
4
4
 
5
5
  const Button = ({
6
- size,
7
- variant,
8
- icon,
9
- flexReverse,
10
- disabled,
11
- onClick,
6
+ ariaLabel,
7
+ buttonRef,
12
8
  children,
13
- loading,
9
+ className,
10
+ disabled,
11
+ flexReverse,
14
12
  fullWidth,
15
- buttonRef,
13
+ icon,
14
+ loading,
15
+ onClick,
16
16
  round,
17
- className,
18
17
  shouldPreventDefault = true,
19
- ariaLabel
18
+ size,
19
+ variant
20
20
  }) => {
21
21
  return /* @__PURE__ */ React.createElement(
22
22
  "button",
23
23
  {
24
- ref: buttonRef,
25
24
  "aria-label": ariaLabel,
26
25
  className: `${button({
27
26
  buttonPadding: size,
28
27
  buttonRadius: round ? "round" : "default",
28
+ buttonShadow: variant === "ghost" || variant === "secondary" ? "none" : size === "small" ? "small" : "default",
29
29
  buttonVariant: variant,
30
- fullWidth,
31
- buttonShadow: variant === "ghost" || variant === "secondary" ? "none" : size === "small" ? "small" : "default"
30
+ fullWidth
32
31
  })} ${className}`,
33
32
  disabled: disabled || loading,
34
- onKeyDown: (event) => {
35
- if (event.key === "Enter") {
36
- onClick && onClick();
37
- }
38
- },
39
33
  onClick: (e) => {
40
34
  shouldPreventDefault && e.preventDefault();
41
35
  onClick && onClick();
42
- }
36
+ },
37
+ ref: buttonRef
43
38
  },
44
39
  /* @__PURE__ */ React.createElement(
45
40
  "div",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citygross/components_v2",
3
- "version": "0.0.54",
3
+ "version": "0.0.55",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -79,5 +79,5 @@
79
79
  "react-slick": "^0.30.1",
80
80
  "slick-carousel": "^1.8.1"
81
81
  },
82
- "gitHead": "830c0216869887f1ce92050246d7ccf6cbe37e03"
82
+ "gitHead": "58ef69ddd64ea278231d5795b6a16f5169e9553f"
83
83
  }