@amboss/design-system 1.15.0 → 1.15.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.
- package/build/cjs/build-tokens/visualConfig.js +24 -4
- package/build/cjs/scss/themes/dark.scss +7 -1
- package/build/cjs/scss/themes/light.scss +7 -1
- package/build/cjs/src/components/Button/Button.js +41 -23
- package/build/cjs/src/components/Callout/Callout.js +2 -3
- package/build/cjs/src/components/Link/Link.js +2 -7
- package/build/cjs/src/components/MediaItem/MediaItem.js +5 -10
- package/build/cjs/src/components/Patterns/ButtonGroup/ButtonGroup.js +12 -4
- package/build/esm/build-tokens/_colors.json +50 -0
- package/build/esm/build-tokens/visualConfig.d.ts +10 -0
- package/build/esm/build-tokens/visualConfig.js +24 -4
- package/build/esm/build-tokens/visualConfig.js.map +1 -1
- package/build/esm/scss/themes/dark.scss +7 -1
- package/build/esm/scss/themes/light.scss +7 -1
- package/build/esm/src/components/Button/Button.d.ts +3 -1
- package/build/esm/src/components/Button/Button.js +41 -23
- package/build/esm/src/components/Button/Button.js.map +1 -1
- package/build/esm/src/components/Button/mock.d.ts +326 -0
- package/build/esm/src/components/Callout/Callout.js +2 -3
- package/build/esm/src/components/Callout/Callout.js.map +1 -1
- package/build/esm/src/components/Link/Link.d.ts +4 -4
- package/build/esm/src/components/Link/Link.js +2 -7
- package/build/esm/src/components/Link/Link.js.map +1 -1
- package/build/esm/src/components/MediaItem/MediaItem.d.ts +0 -7
- package/build/esm/src/components/MediaItem/MediaItem.js +5 -10
- package/build/esm/src/components/MediaItem/MediaItem.js.map +1 -1
- package/build/esm/src/components/Patterns/ButtonGroup/ButtonGroup.d.ts +3 -4
- package/build/esm/src/components/Patterns/ButtonGroup/ButtonGroup.js +11 -4
- package/build/esm/src/components/Patterns/ButtonGroup/ButtonGroup.js.map +1 -1
- package/build/esm/src/components/Tooltip/BaseTooltip.d.ts +22 -0
- package/build/esm/src/components/Tooltip/Popover.d.ts +7 -0
- package/build/esm/src/components/Tooltip/util.d.ts +12 -0
- package/build/esm/src/types/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaItem.js","sources":["../../../../../src/components/MediaItem/MediaItem.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport styled from \"@emotion/styled\";\nimport { Icon } from \"../Icon/Icon\";\n\nexport type MediaItemProps = {\n src: string;\n title: string;\n /** Sets the height of the media to equal the width value making a square <br/>\n */\n squareByWidth?: boolean;\n /** Specify fit of the media background. <br/>\n * \"contain\" - the media keeps its aspect ratio, but is resized to fit within the given dimension. <br/>\n * \"cover\" - the media keeps its aspect ratio and fills the given dimension. The media will be clipped to fit.\n */\n fit: \"cover\" | \"contain\";\n};\n\nconst StyledMediaContainer = styled.div<Partial<MediaItemProps>>(\n ({ squareByWidth }) => ({\n position: \"relative\",\n backgroundColor: \" transparent\",\n overflow: \"hidden\",\n border: \"none\",\n width: \"100%\",\n borderRadius: \"inherit\",\n ...(squareByWidth && { paddingTop: \"100%\" }),\n ...(!squareByWidth && { height: \"100%\" }),\n })\n);\n\nconst StyledMedia = styled.img<Partial<MediaItemProps>>(({ theme, fit }) => ({\n position: \"absolute\",\n top: 0,\n left: 0,\n display: \"block\",\n width: \"100%\",\n height: \"100%\",\n backgroundPosition: \"center\",\n objectFit: fit,\n backgroundRepeat: \"no-repeat\",\n cursor: \"pointer\",\n \":global(.isDarkmodeActive) &\": {\n backgroundColor: theme.values.color.background.primary.default,\n },\n}));\n\nconst StyledContainer = styled.div<Partial<MediaItemProps>>(\n ({ theme, squareByWidth }) => ({\n position: \"absolute\",\n top: 0,\n left: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"100%\",\n backgroundColor: theme.values.color.background.transparent.active,\n ...(squareByWidth && { paddingTop: \"100%\" }),\n ...(!squareByWidth && { height: \"100%\" }),\n })\n);\n\nexport function MediaItem({\n src,\n title,\n squareByWidth,\n fit,\n}: MediaItemProps): React.ReactElement {\n const [srcError, setSrcError] = useState(false);\n\n const image = new Image();\n image.src = src;\n image.onerror = () => {\n if (!srcError) {\n setSrcError(true);\n }\n };\n\n return (\n <StyledMediaContainer squareByWidth={squareByWidth} data-ds-id=\"MediaItem\">\n {!srcError ? (\n <StyledMedia src={src} title={title} alt={title} fit={fit} />\n ) : (\n <StyledContainer title=\"Error not found\">\n <Icon name=\"image-broken\" color=\"tertiary\" />\n </StyledContainer>\n )}\n </StyledMediaContainer>\n );\n}\n
|
|
1
|
+
{"version":3,"file":"MediaItem.js","sources":["../../../../../src/components/MediaItem/MediaItem.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport styled from \"@emotion/styled\";\nimport { Icon } from \"../Icon/Icon\";\n\nexport type MediaItemProps = {\n src: string;\n title: string;\n /** Sets the height of the media to equal the width value making a square <br/>\n */\n squareByWidth?: boolean;\n /** Specify fit of the media background. <br/>\n * \"contain\" - the media keeps its aspect ratio, but is resized to fit within the given dimension. <br/>\n * \"cover\" - the media keeps its aspect ratio and fills the given dimension. The media will be clipped to fit.\n */\n fit: \"cover\" | \"contain\";\n};\n\nconst StyledMediaContainer = styled.div<Partial<MediaItemProps>>(\n ({ squareByWidth }) => ({\n position: \"relative\",\n backgroundColor: \" transparent\",\n overflow: \"hidden\",\n border: \"none\",\n width: \"100%\",\n borderRadius: \"inherit\",\n ...(squareByWidth && { paddingTop: \"100%\" }),\n ...(!squareByWidth && { height: \"100%\" }),\n })\n);\n\nconst StyledMedia = styled.img<Partial<MediaItemProps>>(({ theme, fit }) => ({\n position: \"absolute\",\n top: 0,\n left: 0,\n display: \"block\",\n width: \"100%\",\n height: \"100%\",\n backgroundPosition: \"center\",\n objectFit: fit,\n backgroundRepeat: \"no-repeat\",\n cursor: \"pointer\",\n \":global(.isDarkmodeActive) &\": {\n backgroundColor: theme.values.color.background.primary.default,\n },\n}));\n\nconst StyledContainer = styled.div<Partial<MediaItemProps>>(\n ({ theme, squareByWidth }) => ({\n position: \"absolute\",\n top: 0,\n left: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: \"100%\",\n backgroundColor: theme.values.color.background.transparent.active,\n ...(squareByWidth && { paddingTop: \"100%\" }),\n ...(!squareByWidth && { height: \"100%\" }),\n })\n);\n\nexport function MediaItem({\n src,\n title,\n squareByWidth = false,\n fit = \"cover\",\n}: MediaItemProps): React.ReactElement {\n const [srcError, setSrcError] = useState(false);\n\n const image = new Image();\n image.src = src;\n image.onerror = () => {\n if (!srcError) {\n setSrcError(true);\n }\n };\n\n return (\n <StyledMediaContainer squareByWidth={squareByWidth} data-ds-id=\"MediaItem\">\n {!srcError ? (\n <StyledMedia src={src} title={title} alt={title} fit={fit} />\n ) : (\n <StyledContainer title=\"Error not found\">\n <Icon name=\"image-broken\" color=\"tertiary\" />\n </StyledContainer>\n )}\n </StyledMediaContainer>\n );\n}\n"],"names":["StyledMediaContainer","_styled","process","env","NODE_ENV","target","label","_ref","squareByWidth","position","backgroundColor","overflow","border","width","borderRadius","paddingTop","height","StyledMedia","_ref2","theme","fit","top","left","display","backgroundPosition","objectFit","backgroundRepeat","cursor","values","color","background","primary","default","StyledContainer","_ref3","alignItems","justifyContent","transparent","active","MediaItem","_ref4","src","title","srcError","setSrcError","useState","image","Image","onerror","React","createElement","alt","Icon","name"],"mappings":";;;;AAiBA,MAAMA,oBAAoB,gBAAGC,OAAA,CAAA,KAAA,EAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,KAAA,YAAA,GAAA;EAAAC,MAAA,EAAA,WAAA;AAAA,CAAA,GAAA;EAAAA,MAAA,EAAA,WAAA;EAAAC,KAAA,EAAA,sBAAA;AAAA,CAAA,CAAA,CAC3BC,IAAA,IAAA;EAAA,IAAC;AAAEC,IAAAA,aAAAA;AAAc,GAAC,GAAAD,IAAA,CAAA;EAAA,OAAM;AACtBE,IAAAA,QAAQ,EAAE,UAAU;AACpBC,IAAAA,eAAe,EAAE,cAAc;AAC/BC,IAAAA,QAAQ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,KAAK,CAACL,GAAG,GAAGA,GAAG,CAAA;EACfK,KAAK,CAACE,OAAO,GAAG,MAAM;IACpB,IAAI,CAACL,QAAQ,EAAE;MACbC,WAAW,CAAC,IAAI,CAAC,CAAA;AACnB,KAAA;GACD,CAAA;AAED,EAAA,oBACEK,KAAA,CAAAC,aAAA,CAAClD,oBAAoB,EAAA;AAACQ,IAAAA,aAAa,EAAEA,aAAc;IAAC,YAAW,EAAA,WAAA;AAAW,GAAA,EACvE,CAACmC,QAAQ,gBACRM,KAAA,CAAAC,aAAA,CAACjC,WAAW,EAAA;AAACwB,IAAAA,GAAG,EAAEA,GAAI;AAACC,IAAAA,KAAK,EAAEA,KAAM;AAACS,IAAAA,GAAG,EAAET,KAAM;AAACtB,IAAAA,GAAG,EAAEA,GAAAA;AAAI,GAAE,CAAC,gBAE7D6B,KAAA,CAAAC,aAAA,CAACjB,eAAe,EAAA;AAACS,IAAAA,KAAK,EAAC,iBAAA;AAAiB,GAAA,eACtCO,KAAA,CAAAC,aAAA,CAACE,IAAI,EAAA;AAACC,IAAAA,IAAI,EAAC,cAAc;AAACxB,IAAAA,KAAK,EAAC,UAAA;GAAY,CAC7B,CAEC,CAAC,CAAA;AAE3B;;;;"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { MQ, SpaceSizes } from "../../../types";
|
|
3
|
+
import { ButtonProps } from "../../Button/Button";
|
|
3
4
|
export declare type ActionButtonProps = {
|
|
4
5
|
text: string;
|
|
5
|
-
|
|
6
|
-
variant: BaseVariations;
|
|
7
|
-
};
|
|
6
|
+
} & ButtonProps;
|
|
8
7
|
export declare type ButtonGroupProps = {
|
|
9
8
|
actionButton?: ActionButtonProps;
|
|
10
9
|
cancelButtonText?: string;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import _extends from '@babel/runtime/helpers/extends';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { Columns, Column } from '../../Column/Columns.js';
|
|
3
4
|
import { Button } from '../../Button/Button.js';
|
|
4
5
|
|
|
6
|
+
/* eslint-disable react/jsx-props-no-spreading */
|
|
5
7
|
function ButtonGroup(_ref) {
|
|
6
8
|
let {
|
|
7
9
|
cancelButtonText,
|
|
@@ -9,6 +11,10 @@ function ButtonGroup(_ref) {
|
|
|
9
11
|
onButtonClick,
|
|
10
12
|
"data-e2e-test-id": dataE2eTestId
|
|
11
13
|
} = _ref;
|
|
14
|
+
const {
|
|
15
|
+
text,
|
|
16
|
+
...rest
|
|
17
|
+
} = actionButton;
|
|
12
18
|
return /*#__PURE__*/React.createElement(Columns, {
|
|
13
19
|
gap: "s",
|
|
14
20
|
alignItems: ["spaceBetween", "right"],
|
|
@@ -17,14 +23,13 @@ function ButtonGroup(_ref) {
|
|
|
17
23
|
}, actionButton && /*#__PURE__*/React.createElement(Column, {
|
|
18
24
|
order: ["first", "last"],
|
|
19
25
|
size: [12, "narrow"]
|
|
20
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
21
|
-
variant:
|
|
22
|
-
type: actionButton.type,
|
|
26
|
+
}, /*#__PURE__*/React.createElement(Button, _extends({
|
|
27
|
+
variant: "primary",
|
|
23
28
|
fullWidth: true,
|
|
24
29
|
onClick: () => {
|
|
25
30
|
onButtonClick("action");
|
|
26
31
|
}
|
|
27
|
-
},
|
|
32
|
+
}, rest), text)), cancelButtonText && /*#__PURE__*/React.createElement(Column, {
|
|
28
33
|
size: [12, "narrow"]
|
|
29
34
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
30
35
|
variant: "secondary",
|
|
@@ -35,5 +40,7 @@ function ButtonGroup(_ref) {
|
|
|
35
40
|
}, cancelButtonText)));
|
|
36
41
|
}
|
|
37
42
|
|
|
43
|
+
/* eslint-enable react/jsx-props-no-spreading */
|
|
44
|
+
|
|
38
45
|
export { ButtonGroup };
|
|
39
46
|
//# sourceMappingURL=ButtonGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonGroup.js","sources":["../../../../../../src/components/Patterns/ButtonGroup/ButtonGroup.tsx"],"sourcesContent":["import React from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"ButtonGroup.js","sources":["../../../../../../src/components/Patterns/ButtonGroup/ButtonGroup.tsx"],"sourcesContent":["import React from \"react\";\nimport { MQ, SpaceSizes } from \"../../../types\";\nimport { Columns, Column } from \"../../Column/Columns\";\nimport { Button, ButtonProps } from \"../../Button/Button\";\n\nexport type ActionButtonProps = {\n text: string;\n} & ButtonProps;\n\nexport type ButtonGroupProps = {\n actionButton?: ActionButtonProps;\n cancelButtonText?: string;\n onButtonClick?: (action: \"cancel\" | \"action\") => void;\n space?: MQ<SpaceSizes> | SpaceSizes;\n \"data-e2e-test-id\"?: string;\n};\n\n/* eslint-disable react/jsx-props-no-spreading */\nexport function ButtonGroup({\n cancelButtonText,\n actionButton,\n onButtonClick,\n \"data-e2e-test-id\": dataE2eTestId,\n}: ButtonGroupProps): React.ReactElement {\n const { text, ...rest } = actionButton;\n\n return (\n <Columns\n gap=\"s\"\n alignItems={[\"spaceBetween\", \"right\"]}\n data-e2e-test-id={dataE2eTestId}\n data-ds-id=\"ButtonGroup\"\n >\n {actionButton && (\n <Column order={[\"first\", \"last\"]} size={[12, \"narrow\"]}>\n <Button\n variant=\"primary\"\n fullWidth\n onClick={() => {\n onButtonClick(\"action\");\n }}\n {...rest}\n >\n {text}\n </Button>\n </Column>\n )}\n {cancelButtonText && (\n <Column size={[12, \"narrow\"]}>\n <Button\n variant=\"secondary\"\n fullWidth\n onClick={() => {\n onButtonClick(\"cancel\");\n }}\n >\n {cancelButtonText}\n </Button>\n </Column>\n )}\n </Columns>\n );\n}\n\n/* eslint-enable react/jsx-props-no-spreading */\n"],"names":["ButtonGroup","_ref","cancelButtonText","actionButton","onButtonClick","dataE2eTestId","text","rest","React","createElement","Columns","gap","alignItems","Column","order","size","Button","_extends","variant","fullWidth","onClick"],"mappings":";;;;;AAiBA;AACO,SAASA,W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;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare type BaseTooltipCommonProps = {
|
|
3
|
+
id: string;
|
|
4
|
+
content: string | React.ReactElement;
|
|
5
|
+
placement?: "auto" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
6
|
+
padding?: "s" | "m";
|
|
7
|
+
portalContainer?: HTMLElement;
|
|
8
|
+
zIndex?: number;
|
|
9
|
+
dataE2eTestId?: string;
|
|
10
|
+
dataDsId?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare type BaseTooltipConditionalProps = {
|
|
13
|
+
trigger?: never;
|
|
14
|
+
children: React.ReactElement;
|
|
15
|
+
} | {
|
|
16
|
+
children?: never;
|
|
17
|
+
trigger: HTMLElement;
|
|
18
|
+
};
|
|
19
|
+
export declare type BaseTooltipProps = BaseTooltipCommonProps & BaseTooltipConditionalProps;
|
|
20
|
+
export declare type VerticalPlacement = "top" | "bottom";
|
|
21
|
+
export declare type HorizontalPlacement = "left" | "right" | "center";
|
|
22
|
+
export declare function BaseTooltip({ id, placement, content, children, trigger, portalContainer, zIndex, padding, dataE2eTestId, dataDsId, }: BaseTooltipProps): React.ReactElement;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type BaseTooltipProps } from "./BaseTooltip";
|
|
3
|
+
export declare type PopoverProps = {
|
|
4
|
+
content: React.ReactElement;
|
|
5
|
+
"data-e2e-test-id"?: string;
|
|
6
|
+
} & Pick<BaseTooltipProps, "id" | "placement" | "zIndex" | "portalContainer" | "children" | "trigger">;
|
|
7
|
+
export declare function Popover({ id, placement, content, children, portalContainer, zIndex, "data-e2e-test-id": dataE2eTestId, }: PopoverProps): React.ReactElement;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
import type { TooltipProps, TooltipPosition } from "./Tooltip";
|
|
3
|
+
export declare const DISTANCE_FROM_TRIGGER = 4;
|
|
4
|
+
export declare const ANIMATION_DISTANCE = 8;
|
|
5
|
+
export declare const ARROW_SIZE = 6;
|
|
6
|
+
export declare const TOOLTIP_MARGIN: number;
|
|
7
|
+
export declare const ARROW_OFFSET = 8;
|
|
8
|
+
/**
|
|
9
|
+
* Get tooltip position
|
|
10
|
+
*/
|
|
11
|
+
export declare function getTooltipPosition(placement: TooltipProps["placement"], triggerRef: RefObject<any>, tooltipRef: RefObject<any>, document: Document, window: Window): TooltipPosition;
|
|
12
|
+
export declare function getContentWrapStatus(tooltipRef: RefObject<any>): boolean;
|
|
@@ -28,7 +28,7 @@ declare const TextColorsRuntype: Union<[Union<[Union<[Literal<"primary">, Litera
|
|
|
28
28
|
export declare type TextColors = Static<typeof TextColorsRuntype>;
|
|
29
29
|
declare const TextVariationsRuntype: Union<[Union<[Literal<"primary">, Literal<"secondary">, Literal<"tertiary">]>, Literal<"info">, Literal<"error">, Literal<"warning">]>;
|
|
30
30
|
export declare type TextVariations = Static<typeof TextVariationsRuntype>;
|
|
31
|
-
declare const IconsColorsRuntime: Union<[Union<[Union<[Literal<"primary">, Literal<"secondary">, Literal<"tertiary">]>, Literal<"accent">]>, Literal<"info">, Literal<"error">, Literal<"warning">, Literal<"inherit">, Literal<"brand">]>;
|
|
31
|
+
declare const IconsColorsRuntime: Union<[Union<[Union<[Literal<"primary">, Literal<"secondary">, Literal<"tertiary">]>, Literal<"accent">]>, Literal<"info">, Literal<"error">, Literal<"warning">, Literal<"inherit">, Literal<"brand">, Literal<"quaternary">]>;
|
|
32
32
|
export declare type IconsColors = Static<typeof IconsColorsRuntime>;
|
|
33
33
|
declare const IconsVariationsRuntype: Union<[Union<[Literal<"primary">, Literal<"secondary">, Literal<"tertiary">]>, Literal<"info">, Literal<"error">, Literal<"warning">, Literal<"inherit">, Literal<"brand">]>;
|
|
34
34
|
export declare type IconsVariations = Static<typeof IconsVariationsRuntype>;
|