@amboss/design-system 1.5.21 → 1.6.1

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.
@@ -0,0 +1,14 @@
1
+ import React, { ReactElement } from "react";
2
+ import { IconName } from "../Icon/Icon";
3
+ import { CalloutVariations } from "../../types";
4
+ export declare type CalloutProps = {
5
+ type?: CalloutVariations;
6
+ icon?: IconName;
7
+ "data-e2e-test-id"?: string;
8
+ text: string | ReactElement;
9
+ description?: string | ReactElement;
10
+ };
11
+ export declare function Callout({ text, description, type, icon, "data-e2e-test-id": dataE2eTestId, }: CalloutProps): React.ReactElement;
12
+ export declare namespace Callout {
13
+ var defaultProps: Partial<CalloutProps>;
14
+ }
@@ -1,26 +1,65 @@
1
1
  import React from "react";
2
2
  import { LinkVariations, LinkTextSize } from "../../types";
3
3
  declare type FontWeight = "normal" | "bold" | "inherit";
4
- declare type AnchorProps = {
4
+ declare type NoTargetNoRel = {
5
+ target?: never;
6
+ rel?: never;
7
+ };
8
+ declare type LinkPropsExtended = {
5
9
  as?: "a";
6
10
  href: string;
11
+ onClick?: never;
12
+ to?: never;
7
13
  } & ({
8
14
  target: "_blank";
9
15
  rel: "noopener noreferrer";
10
- } | {
11
- target?: undefined;
12
- rel?: undefined;
13
- });
16
+ } | NoTargetNoRel);
17
+ declare type LinkAsButtonProps = {
18
+ as: "button";
19
+ onClick: (e: React.MouseEvent) => void;
20
+ href?: never;
21
+ to?: never;
22
+ } & NoTargetNoRel;
23
+ declare type RouterLinkProps = {
24
+ as: React.ComponentType;
25
+ to: string;
26
+ onClick?: never;
27
+ href?: never;
28
+ } & NoTargetNoRel;
14
29
  declare type LinkProps = Record<string, unknown> & {
15
30
  children: string;
16
- as?: "a" | React.ComponentType;
17
31
  size?: LinkTextSize;
18
32
  weight?: FontWeight;
19
33
  variant?: LinkVariations;
20
34
  "data-e2e-test-id"?: string;
21
- } & AnchorProps;
22
- export declare function Link({ children, size, weight, variant, target, rel, href, "data-e2e-test-id": dataE2eTestId, ...rest }: LinkProps): React.ReactElement;
35
+ } & (LinkPropsExtended | LinkAsButtonProps | RouterLinkProps);
36
+ export declare function Link({ children, size, weight, variant, "data-e2e-test-id": dataE2eTestId, ...rest }: LinkProps): React.ReactElement;
23
37
  export declare namespace Link {
24
- var defaultProps: Partial<LinkProps>;
38
+ var defaultProps: Partial<Record<string, unknown> & {
39
+ children: string;
40
+ size?: "xs" | "s" | "m" | "l";
41
+ weight?: FontWeight;
42
+ variant?: "primary" | "secondary" | "tertiary";
43
+ "data-e2e-test-id"?: string;
44
+ } & {
45
+ as?: "a";
46
+ href: string;
47
+ onClick?: never;
48
+ to?: never;
49
+ } & NoTargetNoRel> | Partial<Record<string, unknown> & {
50
+ children: string;
51
+ size?: "xs" | "s" | "m" | "l";
52
+ weight?: FontWeight;
53
+ variant?: "primary" | "secondary" | "tertiary";
54
+ "data-e2e-test-id"?: string;
55
+ } & {
56
+ as?: "a";
57
+ href: string;
58
+ onClick?: never;
59
+ to?: never;
60
+ } & {
61
+ target: "_blank";
62
+ rel: "noopener noreferrer";
63
+ }>;
25
64
  }
26
65
  export {};
@@ -40,3 +40,4 @@ export { RoundButton } from "./components/RoundButton/RoundButton";
40
40
  export { Notification } from "./components/Notification/Notification";
41
41
  export { Logo } from "./components/Logo/Logo";
42
42
  export { MediaItem } from "./components/MediaItem/MediaItem";
43
+ export { Callout } from "./components/Callout/Callout";
@@ -23,6 +23,8 @@ declare const TextVariationsRuntype: Union<[Union<[Literal<"primary">, Literal<"
23
23
  export declare type TextVariations = Static<typeof TextVariationsRuntype>;
24
24
  declare const IconsVariationsRuntype: Union<[Union<[Literal<"primary">, Literal<"secondary">, Literal<"tertiary">]>, Literal<"info">, Literal<"error">, Literal<"warning">, Literal<"inherit">]>;
25
25
  export declare type IconsVariations = Static<typeof IconsVariationsRuntype>;
26
+ declare const CalloutVariationsRuntype: Union<[Literal<"info">, Literal<"success">, Literal<"error">, Literal<"warning">]>;
27
+ export declare type CalloutVariations = Static<typeof CalloutVariationsRuntype>;
26
28
  declare const LinkVariationsRuntype: Union<[Union<[Literal<"primary">, Literal<"secondary">, Literal<"tertiary">]>]>;
27
29
  export declare type LinkVariations = Static<typeof LinkVariationsRuntype>;
28
30
  export declare type MQ<T> = [T, T?, T?];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amboss/design-system",
3
- "version": "1.5.21",
3
+ "version": "1.6.1",
4
4
  "description": "the design system for AMBOSS products",
5
5
  "author": "Bagrat Gobedashvili",
6
6
  "license": "ISC",