@synerise/ds-information-card 1.6.3 → 1.6.5

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 (40) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +9 -7
  3. package/dist/InformationCard.d.ts +6 -6
  4. package/dist/InformationCard.js +82 -135
  5. package/dist/InformationCard.styles.d.ts +25 -25
  6. package/dist/InformationCard.styles.js +68 -69
  7. package/dist/InformationCard.types.d.ts +8 -8
  8. package/dist/InformationCard.types.js +1 -1
  9. package/dist/InformationCard.utils.d.ts +3 -3
  10. package/dist/InformationCard.utils.js +29 -36
  11. package/dist/InformationCardActions/InformationCardActions.d.ts +2 -2
  12. package/dist/InformationCardActions/InformationCardActions.js +22 -26
  13. package/dist/InformationCardActions/InformationCardActions.types.d.ts +2 -2
  14. package/dist/InformationCardActions/InformationCardActions.types.js +1 -1
  15. package/dist/InformationCardDescription/InformationCardDescription.d.ts +2 -2
  16. package/dist/InformationCardDescription/InformationCardDescription.js +23 -29
  17. package/dist/InformationCardFooter/InformationCardFooter.d.ts +2 -2
  18. package/dist/InformationCardFooter/InformationCardFooter.js +29 -42
  19. package/dist/InformationCardFooter/InformationCardFooter.types.d.ts +3 -3
  20. package/dist/InformationCardFooter/InformationCardFooter.types.js +1 -1
  21. package/dist/InformationCardPropertyList/InformationCardPropertyList.d.ts +2 -2
  22. package/dist/InformationCardPropertyList/InformationCardPropertyList.js +32 -30
  23. package/dist/InformationCardPropertyList/InformationCardPropertyList.types.d.ts +1 -1
  24. package/dist/InformationCardPropertyList/InformationCardPropertyList.types.js +1 -1
  25. package/dist/InformationCardSummary/InformationCardSummary.d.ts +2 -2
  26. package/dist/InformationCardSummary/InformationCardSummary.js +29 -30
  27. package/dist/InformationCardSummary/InformationCardSummary.types.d.ts +2 -2
  28. package/dist/InformationCardSummary/InformationCardSummary.types.js +1 -1
  29. package/dist/InformationCardTooltip/InformationCard.constants.d.ts +1 -1
  30. package/dist/InformationCardTooltip/InformationCard.constants.js +13 -6
  31. package/dist/InformationCardTooltip/InformationCardTooltip.d.ts +4 -4
  32. package/dist/InformationCardTooltip/InformationCardTooltip.js +27 -43
  33. package/dist/InformationCardTooltip/InformationCardTooltip.styles.d.ts +1 -1
  34. package/dist/InformationCardTooltip/InformationCardTooltip.styles.js +6 -3
  35. package/dist/InformationCardTooltip/InformationCardTooltip.types.d.ts +5 -5
  36. package/dist/InformationCardTooltip/InformationCardTooltip.types.js +1 -1
  37. package/dist/index.js +12 -7
  38. package/dist/modules.d.js +1 -1
  39. package/dist/modules.d.ts +0 -0
  40. package/package.json +23 -23
@@ -1,11 +1,11 @@
1
- import type { ReactNode } from 'react';
2
- import { type Color, type Size } from '@synerise/ds-avatar/dist/Avatar.types';
3
- import { type IconProps } from '@synerise/ds-icon';
4
- import { type SubtleTextAreaProps } from '@synerise/ds-subtle-form/dist/Elements/TextArea/TextArea.types';
5
- import type { WithHTMLAttributes } from '@synerise/ds-utils';
6
- import { type InformationCardActionsProps } from './InformationCardActions/InformationCardActions.types';
7
- import { type InformationCardPropertyListProps } from './InformationCardPropertyList/InformationCardPropertyList.types';
8
- import { type InformationCardSummaryProps } from './InformationCardSummary/InformationCardSummary.types';
1
+ import { ReactNode } from 'react';
2
+ import { Color, Size } from '@synerise/ds-avatar/dist/Avatar.types';
3
+ import { IconProps } from '@synerise/ds-icon';
4
+ import { SubtleTextAreaProps } from '@synerise/ds-subtle-form/dist/Elements/TextArea/TextArea.types';
5
+ import { WithHTMLAttributes } from '@synerise/ds-utils';
6
+ import { InformationCardActionsProps } from './InformationCardActions/InformationCardActions.types';
7
+ import { InformationCardPropertyListProps } from './InformationCardPropertyList/InformationCardPropertyList.types';
8
+ import { InformationCardSummaryProps } from './InformationCardSummary/InformationCardSummary.types';
9
9
  export type BadgeData = {
10
10
  type?: string;
11
11
  title?: string;
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,6 +1,6 @@
1
- import React, { type PropsWithChildren } from 'react';
2
- import { type InlineAlertType } from '@synerise/ds-alert/dist/InlineAlert/InlineAlert.types';
3
- import { type BadgeData } from './InformationCard.types';
1
+ import { default as React, PropsWithChildren } from 'react';
2
+ import { InlineAlertType } from '@synerise/ds-alert/dist/InlineAlert/InlineAlert.types';
3
+ import { BadgeData } from './InformationCard.types';
4
4
  export declare function buildInitialsBadge(name: string): React.JSX.Element;
5
5
  export declare function buildExtraInfo(message: string, level?: InlineAlertType): React.JSX.Element;
6
6
  export declare function getInitials(name: string): string;
@@ -1,36 +1,27 @@
1
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- import React from 'react';
3
- import Alert from '@synerise/ds-alert';
4
- import Avatar, { ObjectAvatar } from '@synerise/ds-avatar';
5
- import Badge from '@synerise/ds-badge';
6
- import Icon from '@synerise/ds-icon';
7
- import * as S from './InformationCard.styles';
8
- export function buildInitialsBadge(name) {
9
- return /*#__PURE__*/React.createElement(Initials, {
10
- name: name
11
- });
1
+ import { jsx } from "react/jsx-runtime";
2
+ import Alert from "@synerise/ds-alert";
3
+ import Avatar, { ObjectAvatar } from "@synerise/ds-avatar";
4
+ import Badge from "@synerise/ds-badge";
5
+ import Icon from "@synerise/ds-icon";
6
+ import { ExtraInfo } from "./InformationCard.styles.js";
7
+ function buildInitialsBadge(name) {
8
+ return /* @__PURE__ */ jsx(Initials, { name });
12
9
  }
13
- export function buildExtraInfo(message, level) {
14
- return /*#__PURE__*/React.createElement(S.ExtraInfo, null, /*#__PURE__*/React.createElement(Alert.InlineAlert, {
15
- type: level || 'warning',
16
- message: message
17
- }));
10
+ function buildExtraInfo(message, level) {
11
+ return /* @__PURE__ */ jsx(ExtraInfo, { children: /* @__PURE__ */ jsx(Alert.InlineAlert, { type: level || "warning", message }) });
18
12
  }
19
- export function getInitials(name) {
20
- var hasTokens = name.indexOf(' ') !== -1;
21
- return name.substring(0, hasTokens ? 1 : 2) + (hasTokens ? name.charAt(name.lastIndexOf(' ') + 1) : '');
13
+ function getInitials(name) {
14
+ const hasTokens = name.indexOf(" ") !== -1;
15
+ return name.substring(0, hasTokens ? 1 : 2) + (hasTokens ? name.charAt(name.lastIndexOf(" ") + 1) : "");
22
16
  }
23
- export function Initials(_ref) {
24
- var name = _ref.name,
25
- children = _ref.children;
26
- return /*#__PURE__*/React.createElement(Badge, null, /*#__PURE__*/React.createElement(Avatar, {
27
- size: "medium",
28
- shape: "circle",
29
- backgroundColor: "blue"
30
- }, name && getInitials(name) || children));
17
+ function Initials({
18
+ name,
19
+ children
20
+ }) {
21
+ return /* @__PURE__ */ jsx(Badge, { children: /* @__PURE__ */ jsx(Avatar, { size: "medium", shape: "circle", backgroundColor: "blue", children: name && getInitials(name) || children }) });
31
22
  }
32
- export function buildIconBadge(data) {
33
- var avatarExtra = {
23
+ function buildIconBadge(data) {
24
+ const avatarExtra = {
34
25
  object: {}
35
26
  };
36
27
  if (data.avatarTooltipText) {
@@ -38,10 +29,12 @@ export function buildIconBadge(data) {
38
29
  description: data.avatarTooltipText
39
30
  };
40
31
  }
41
- return /*#__PURE__*/React.createElement(ObjectAvatar, _extends({}, avatarExtra, {
42
- color: data.iconColor,
43
- iconComponent: /*#__PURE__*/React.createElement(Icon, {
44
- component: data.iconElement
45
- })
46
- }));
47
- }
32
+ return /* @__PURE__ */ jsx(ObjectAvatar, { ...avatarExtra, color: data.iconColor, iconComponent: /* @__PURE__ */ jsx(Icon, { component: data.iconElement }) });
33
+ }
34
+ export {
35
+ Initials,
36
+ buildExtraInfo,
37
+ buildIconBadge,
38
+ buildInitialsBadge,
39
+ getInitials
40
+ };
@@ -1,3 +1,3 @@
1
- import React from 'react';
2
- import { type InformationCardActionsProps } from './InformationCardActions.types';
1
+ import { default as React } from 'react';
2
+ import { InformationCardActionsProps } from './InformationCardActions.types';
3
3
  export declare const InformationCardActions: ({ onHeaderClick, navigationLabel, items, menuProps, maxHeight, }: InformationCardActionsProps) => React.JSX.Element;
@@ -1,26 +1,22 @@
1
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- import React from 'react';
3
- import { FormattedMessage } from 'react-intl';
4
- import Dropdown from '@synerise/ds-dropdown';
5
- import Menu from '@synerise/ds-menu';
6
- import Scrollbar from '@synerise/ds-scrollbar';
7
- import * as S from '../InformationCard.styles';
8
- var NAV_HEIGHT = 61;
9
- export var InformationCardActions = function InformationCardActions(_ref) {
10
- var onHeaderClick = _ref.onHeaderClick,
11
- navigationLabel = _ref.navigationLabel,
12
- items = _ref.items,
13
- menuProps = _ref.menuProps,
14
- maxHeight = _ref.maxHeight;
15
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Dropdown.BackAction, {
16
- label: navigationLabel || /*#__PURE__*/React.createElement(FormattedMessage, {
17
- id: "DS.INFORMATION-CARD.QUICK-ACTIONS",
18
- defaultMessage: "Quick actions"
19
- }),
20
- onClick: onHeaderClick
21
- }), /*#__PURE__*/React.createElement(S.InformationCardActionsWrapper, null, /*#__PURE__*/React.createElement(Scrollbar, {
22
- maxHeight: maxHeight ? maxHeight - NAV_HEIGHT : undefined
23
- }, /*#__PURE__*/React.createElement(Menu, _extends({}, menuProps, {
24
- dataSource: items
25
- })))));
26
- };
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import { FormattedMessage } from "react-intl";
3
+ import Dropdown from "@synerise/ds-dropdown";
4
+ import Menu from "@synerise/ds-menu";
5
+ import Scrollbar from "@synerise/ds-scrollbar";
6
+ import { InformationCardActionsWrapper } from "../InformationCard.styles.js";
7
+ const NAV_HEIGHT = 61;
8
+ const InformationCardActions = ({
9
+ onHeaderClick,
10
+ navigationLabel,
11
+ items,
12
+ menuProps,
13
+ maxHeight
14
+ }) => {
15
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
16
+ /* @__PURE__ */ jsx(Dropdown.BackAction, { label: navigationLabel || /* @__PURE__ */ jsx(FormattedMessage, { id: "DS.INFORMATION-CARD.QUICK-ACTIONS", defaultMessage: "Quick actions" }), onClick: onHeaderClick }),
17
+ /* @__PURE__ */ jsx(InformationCardActionsWrapper, { children: /* @__PURE__ */ jsx(Scrollbar, { maxHeight: maxHeight ? maxHeight - NAV_HEIGHT : void 0, children: /* @__PURE__ */ jsx(Menu, { ...menuProps, dataSource: items }) }) })
18
+ ] });
19
+ };
20
+ export {
21
+ InformationCardActions
22
+ };
@@ -1,5 +1,5 @@
1
- import { type ReactNode } from 'react';
2
- import { type AntdMenuProps, type MenuItemProps } from '@synerise/ds-menu';
1
+ import { ReactNode } from 'react';
2
+ import { AntdMenuProps, MenuItemProps } from '@synerise/ds-menu';
3
3
  export type InformationCardActionsProps = {
4
4
  items: MenuItemProps[];
5
5
  menuProps?: Partial<AntdMenuProps>;
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,5 +1,5 @@
1
- import React, { type ReactNode } from 'react';
2
- import { type SubtleTextAreaProps } from '@synerise/ds-subtle-form/dist/Elements/TextArea/TextArea.types';
1
+ import { default as React, ReactNode } from 'react';
2
+ import { SubtleTextAreaProps } from '@synerise/ds-subtle-form/dist/Elements/TextArea/TextArea.types';
3
3
  type InformationCardDescriptionProps = {
4
4
  extraInformation?: ReactNode;
5
5
  descriptionConfig?: SubtleTextAreaProps | string | null;
@@ -1,32 +1,26 @@
1
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- import React, { useState } from 'react';
3
- import SubtleForm from '@synerise/ds-subtle-form';
4
- import * as S from '../InformationCard.styles';
5
- export var InformationCardDescription = function InformationCardDescription(_ref) {
6
- var _ref$extraInformation = _ref.extraInformation,
7
- extraInformation = _ref$extraInformation === void 0 ? undefined : _ref$extraInformation,
8
- descriptionConfig = _ref.descriptionConfig;
9
- var _useState = useState(''),
10
- description = _useState[0],
11
- setDescription = _useState[1];
12
- var renderDescription = function renderDescription() {
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import SubtleForm from "@synerise/ds-subtle-form";
4
+ import { DescriptionWrapper, AlertWrapper, NonEditableWrapper } from "../InformationCard.styles.js";
5
+ const InformationCardDescription = ({
6
+ extraInformation = void 0,
7
+ descriptionConfig
8
+ }) => {
9
+ const [description, setDescription] = useState("");
10
+ const renderDescription = () => {
13
11
  if (descriptionConfig) {
14
- return typeof descriptionConfig === 'string' ? /*#__PURE__*/React.createElement(S.NonEditableWrapper, null, descriptionConfig) : /*#__PURE__*/React.createElement(SubtleForm.TextArea, _extends({
15
- minRows: 1,
16
- value: description,
17
- onChange: function onChange(value) {
18
- descriptionConfig.onChange && descriptionConfig.onChange(value);
19
- setDescription(value);
20
- },
21
- placeholder: "placeholder",
22
- suffixTooltip: "Edit"
23
- }, descriptionConfig, {
24
- disabled: descriptionConfig.disabled
25
- }));
12
+ return typeof descriptionConfig === "string" ? /* @__PURE__ */ jsx(NonEditableWrapper, { children: descriptionConfig }) : /* @__PURE__ */ jsx(SubtleForm.TextArea, { minRows: 1, value: description, onChange: (value) => {
13
+ descriptionConfig.onChange && descriptionConfig.onChange(value);
14
+ setDescription(value);
15
+ }, placeholder: "placeholder", suffixTooltip: "Edit", ...descriptionConfig, disabled: descriptionConfig.disabled });
26
16
  }
27
- return /*#__PURE__*/React.createElement(React.Fragment, null);
17
+ return /* @__PURE__ */ jsx(Fragment, {});
28
18
  };
29
- return /*#__PURE__*/React.createElement(S.DescriptionWrapper, {
30
- "data-testid": "information-card-description"
31
- }, /*#__PURE__*/React.createElement(S.AlertWrapper, null, extraInformation), descriptionConfig && renderDescription());
32
- };
19
+ return /* @__PURE__ */ jsxs(DescriptionWrapper, { "data-testid": "information-card-description", children: [
20
+ /* @__PURE__ */ jsx(AlertWrapper, { children: extraInformation }),
21
+ descriptionConfig && renderDescription()
22
+ ] });
23
+ };
24
+ export {
25
+ InformationCardDescription
26
+ };
@@ -1,3 +1,3 @@
1
- import React from 'react';
2
- import { type InformationCardFooterProps } from './InformationCardFooter.types';
1
+ import { default as React } from 'react';
2
+ import { InformationCardFooterProps } from './InformationCardFooter.types';
3
3
  export declare const InformationCardFooter: ({ actionButton, actionButtonCallback, actionsMenuButtonLabel, actionsMenuButtonOnClick, actionButtonTooltipText, text, }: InformationCardFooterProps) => React.JSX.Element;
@@ -1,42 +1,29 @@
1
- import React from 'react';
2
- import { FormattedMessage } from 'react-intl';
3
- import Button from '@synerise/ds-button';
4
- import Icon, { AngleRightS, ArrowRuCircleM } from '@synerise/ds-icon';
5
- import Tooltip from '@synerise/ds-tooltip';
6
- import { Text } from '@synerise/ds-typography';
7
- import * as S from '../InformationCard.styles';
8
- export var InformationCardFooter = function InformationCardFooter(_ref) {
9
- var _ref$actionButton = _ref.actionButton,
10
- actionButton = _ref$actionButton === void 0 ? false : _ref$actionButton,
11
- actionButtonCallback = _ref.actionButtonCallback,
12
- actionsMenuButtonLabel = _ref.actionsMenuButtonLabel,
13
- actionsMenuButtonOnClick = _ref.actionsMenuButtonOnClick,
14
- _ref$actionButtonTool = _ref.actionButtonTooltipText,
15
- actionButtonTooltipText = _ref$actionButtonTool === void 0 ? '' : _ref$actionButtonTool,
16
- _ref$text = _ref.text,
17
- text = _ref$text === void 0 ? '' : _ref$text;
18
- return /*#__PURE__*/React.createElement(S.FooterWrapper, {
19
- "data-testid": "information-card-footer",
20
- style: {
21
- alignItems: 'center'
22
- }
23
- }, actionsMenuButtonOnClick && /*#__PURE__*/React.createElement(Button, {
24
- type: "ghost",
25
- mode: "label-icon",
26
- onClick: actionsMenuButtonOnClick
27
- }, actionsMenuButtonLabel || /*#__PURE__*/React.createElement(FormattedMessage, {
28
- id: "DS.INFORMATION-CARD.QUICK-ACTIONS",
29
- defaultMessage: "Quick actions"
30
- }), /*#__PURE__*/React.createElement(Icon, {
31
- component: /*#__PURE__*/React.createElement(AngleRightS, null)
32
- })), /*#__PURE__*/React.createElement(S.FlexGrow, null, text && /*#__PURE__*/React.createElement(Text, {
33
- size: "xsmall"
34
- }, text)), /*#__PURE__*/React.createElement(S.ActionButtonContainer, null, actionButton && actionButton === true && /*#__PURE__*/React.createElement(Tooltip, {
35
- type: "default",
36
- title: actionButtonTooltipText
37
- }, /*#__PURE__*/React.createElement(Button, {
38
- type: "ghost",
39
- mode: "single-icon",
40
- onClick: actionButtonCallback
41
- }, /*#__PURE__*/React.createElement(ArrowRuCircleM, null))) || typeof actionButton === 'function' && actionButton()));
42
- };
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { FormattedMessage } from "react-intl";
3
+ import Button from "@synerise/ds-button";
4
+ import Icon, { AngleRightS, ArrowRuCircleM } from "@synerise/ds-icon";
5
+ import Tooltip from "@synerise/ds-tooltip";
6
+ import { Text } from "@synerise/ds-typography";
7
+ import { FooterWrapper, FlexGrow, ActionButtonContainer } from "../InformationCard.styles.js";
8
+ const InformationCardFooter = ({
9
+ actionButton = false,
10
+ actionButtonCallback,
11
+ actionsMenuButtonLabel,
12
+ actionsMenuButtonOnClick,
13
+ actionButtonTooltipText = "",
14
+ text = ""
15
+ }) => {
16
+ return /* @__PURE__ */ jsxs(FooterWrapper, { "data-testid": "information-card-footer", style: {
17
+ alignItems: "center"
18
+ }, children: [
19
+ actionsMenuButtonOnClick && /* @__PURE__ */ jsxs(Button, { type: "ghost", mode: "label-icon", onClick: actionsMenuButtonOnClick, children: [
20
+ actionsMenuButtonLabel || /* @__PURE__ */ jsx(FormattedMessage, { id: "DS.INFORMATION-CARD.QUICK-ACTIONS", defaultMessage: "Quick actions" }),
21
+ /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(AngleRightS, {}) })
22
+ ] }),
23
+ /* @__PURE__ */ jsx(FlexGrow, { children: text && /* @__PURE__ */ jsx(Text, { size: "xsmall", children: text }) }),
24
+ /* @__PURE__ */ jsx(ActionButtonContainer, { children: actionButton && actionButton === true && /* @__PURE__ */ jsx(Tooltip, { type: "default", title: actionButtonTooltipText, children: /* @__PURE__ */ jsx(Button, { type: "ghost", mode: "single-icon", onClick: actionButtonCallback, children: /* @__PURE__ */ jsx(ArrowRuCircleM, {}) }) }) || typeof actionButton === "function" && actionButton() })
25
+ ] });
26
+ };
27
+ export {
28
+ InformationCardFooter
29
+ };
@@ -1,6 +1,6 @@
1
- import { type MouseEvent } from 'react';
2
- import { type InformationCardProps } from '../InformationCard.types';
3
- import { type InformationCardActionsProps } from '../InformationCardActions/InformationCardActions.types';
1
+ import { MouseEvent } from 'react';
2
+ import { InformationCardProps } from '../InformationCard.types';
3
+ import { InformationCardActionsProps } from '../InformationCardActions/InformationCardActions.types';
4
4
  export type InformationCardFooterProps = {
5
5
  text: InformationCardProps['footerText'];
6
6
  actionsMenuButtonLabel?: InformationCardActionsProps['buttonLabel'];
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,3 +1,3 @@
1
- import React from 'react';
2
- import { type InformationCardPropertyListProps } from './InformationCardPropertyList.types';
1
+ import { default as React } from 'react';
2
+ import { InformationCardPropertyListProps } from './InformationCardPropertyList.types';
3
3
  export declare const InformationCardPropertyList: ({ items, }: InformationCardPropertyListProps) => React.JSX.Element;
@@ -1,33 +1,35 @@
1
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- import React, { useMemo } from 'react';
3
- import { v4 as uuid } from 'uuid';
4
- import * as S from '../InformationCard.styles';
5
- var isDivider = function isDivider(item) {
6
- return 'type' in item && item.type === 'divider';
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { v4 } from "uuid";
4
+ import { InformationCardPropertyListWrapper, Divider, InformationCardPropertyItem, InformationCardPropertyItemLabel, InformationCardPropertyItemValue } from "../InformationCard.styles.js";
5
+ const isDivider = (item) => {
6
+ return "type" in item && item.type === "divider";
7
7
  };
8
- export var InformationCardPropertyList = function InformationCardPropertyList(_ref) {
9
- var items = _ref.items;
10
- var itemsWithIDs = useMemo(function () {
11
- return items == null ? void 0 : items.map(function (item) {
12
- return _extends({
13
- id: uuid()
14
- }, item);
15
- });
16
- }, [items]);
17
- return /*#__PURE__*/React.createElement(S.InformationCardPropertyListWrapper, {
18
- "data-testid": "information-card-property-list"
19
- }, itemsWithIDs == null ? void 0 : itemsWithIDs.map(function (item) {
8
+ const InformationCardPropertyList = ({
9
+ items
10
+ }) => {
11
+ const itemsWithIDs = useMemo(() => items?.map((item) => ({
12
+ id: v4(),
13
+ ...item
14
+ })), [items]);
15
+ return /* @__PURE__ */ jsx(InformationCardPropertyListWrapper, { "data-testid": "information-card-property-list", children: itemsWithIDs?.map((item) => {
20
16
  if (isDivider(item)) {
21
- return /*#__PURE__*/React.createElement(S.Divider, {
22
- dashed: true,
23
- key: item.id
24
- });
17
+ return /* @__PURE__ */ jsx(Divider, { dashed: true }, item.id);
25
18
  }
26
- var label = item.label,
27
- value = item.value,
28
- id = item.id;
29
- return /*#__PURE__*/React.createElement(S.InformationCardPropertyItem, {
30
- key: id
31
- }, label && /*#__PURE__*/React.createElement(S.InformationCardPropertyItemLabel, null, label, ":"), /*#__PURE__*/React.createElement(S.InformationCardPropertyItemValue, null, value));
32
- }));
33
- };
19
+ const {
20
+ label,
21
+ value,
22
+ id
23
+ } = item;
24
+ return /* @__PURE__ */ jsxs(InformationCardPropertyItem, { children: [
25
+ label && /* @__PURE__ */ jsxs(InformationCardPropertyItemLabel, { children: [
26
+ label,
27
+ ":"
28
+ ] }),
29
+ /* @__PURE__ */ jsx(InformationCardPropertyItemValue, { children: value })
30
+ ] }, id);
31
+ }) });
32
+ };
33
+ export {
34
+ InformationCardPropertyList
35
+ };
@@ -1,4 +1,4 @@
1
- import type { Key, ReactNode } from 'react';
1
+ import { Key, ReactNode } from 'react';
2
2
  export type InformationCardPropertyItemTypes = 'divider';
3
3
  export type InformationCardPropertyDivider = {
4
4
  type: InformationCardPropertyItemTypes;
@@ -1,3 +1,3 @@
1
- import React from 'react';
2
- import { type InformationCardSummaryProps } from './InformationCardSummary.types';
1
+ import { default as React } from 'react';
2
+ import { InformationCardSummaryProps } from './InformationCardSummary.types';
3
3
  export declare const InformationCardSummary: ({ items, }: InformationCardSummaryProps) => React.JSX.Element;
@@ -1,30 +1,29 @@
1
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- import React, { useMemo } from 'react';
3
- import { v4 as uuid } from 'uuid';
4
- import Tooltip from '@synerise/ds-tooltip';
5
- import * as S from '../InformationCard.styles';
6
- export var InformationCardSummary = function InformationCardSummary(_ref) {
7
- var items = _ref.items;
8
- var itemsWithIDs = useMemo(function () {
9
- return items == null ? void 0 : items.map(function (item) {
10
- return _extends({
11
- id: uuid()
12
- }, item);
13
- });
14
- }, [items]);
15
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(S.InformationCardSummaryWrapper, {
16
- "data-testid": "information-card-summary"
17
- }, itemsWithIDs == null ? void 0 : itemsWithIDs.map(function (_ref2) {
18
- var icon = _ref2.icon,
19
- label = _ref2.label,
20
- tooltip = _ref2.tooltip,
21
- tooltipProps = _ref2.tooltipProps,
22
- id = _ref2.id;
23
- var item = /*#__PURE__*/React.createElement(S.InformationCardSummaryItem, {
24
- key: id
25
- }, icon && /*#__PURE__*/React.createElement("div", null, icon), label && /*#__PURE__*/React.createElement("div", null, label));
26
- return tooltip ? /*#__PURE__*/React.createElement(Tooltip, _extends({
27
- title: tooltip
28
- }, tooltipProps), item) : item;
29
- })));
30
- };
1
+ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { v4 } from "uuid";
4
+ import Tooltip from "@synerise/ds-tooltip";
5
+ import { InformationCardSummaryWrapper, InformationCardSummaryItem } from "../InformationCard.styles.js";
6
+ const InformationCardSummary = ({
7
+ items
8
+ }) => {
9
+ const itemsWithIDs = useMemo(() => items?.map((item) => ({
10
+ id: v4(),
11
+ ...item
12
+ })), [items]);
13
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InformationCardSummaryWrapper, { "data-testid": "information-card-summary", children: itemsWithIDs?.map(({
14
+ icon,
15
+ label,
16
+ tooltip,
17
+ tooltipProps,
18
+ id
19
+ }) => {
20
+ const item = /* @__PURE__ */ jsxs(InformationCardSummaryItem, { children: [
21
+ icon && /* @__PURE__ */ jsx("div", { children: icon }),
22
+ label && /* @__PURE__ */ jsx("div", { children: label })
23
+ ] }, id);
24
+ return tooltip ? /* @__PURE__ */ jsx(Tooltip, { title: tooltip, ...tooltipProps, children: item }) : item;
25
+ }) }) });
26
+ };
27
+ export {
28
+ InformationCardSummary
29
+ };
@@ -1,5 +1,5 @@
1
- import type { Key, ReactNode } from 'react';
2
- import type { TooltipProps } from '@synerise/ds-tooltip';
1
+ import { Key, ReactNode } from 'react';
2
+ import { TooltipProps } from '@synerise/ds-tooltip';
3
3
  export type InformationCardSummaryItem = {
4
4
  key?: string | number;
5
5
  label: ReactNode;
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,4 +1,4 @@
1
- import { type FlipConfig, type HoverConfig, type OffsetConfig, type ShiftConfig } from '@synerise/ds-popover';
1
+ import { FlipConfig, HoverConfig, OffsetConfig, ShiftConfig } from '@synerise/ds-popover';
2
2
  export declare const TRANSITION_DURATION = 150;
3
3
  export declare const OFFSET_CONFIG: OffsetConfig;
4
4
  export declare const FLIP_CONFIG: FlipConfig;
@@ -1,14 +1,21 @@
1
- export var TRANSITION_DURATION = 150;
2
- export var OFFSET_CONFIG = {
1
+ const TRANSITION_DURATION = 150;
2
+ const OFFSET_CONFIG = {
3
3
  mainAxis: 8
4
4
  };
5
- export var FLIP_CONFIG = {};
6
- export var HOVER_CONFIG = {
5
+ const FLIP_CONFIG = {};
6
+ const HOVER_CONFIG = {
7
7
  delay: {
8
8
  open: 100,
9
9
  close: 400
10
10
  }
11
11
  };
12
- export var SHIFT_CONFIG = {
12
+ const SHIFT_CONFIG = {
13
13
  crossAxis: true
14
- };
14
+ };
15
+ export {
16
+ FLIP_CONFIG,
17
+ HOVER_CONFIG,
18
+ OFFSET_CONFIG,
19
+ SHIFT_CONFIG,
20
+ TRANSITION_DURATION
21
+ };
@@ -1,8 +1,8 @@
1
- import React from 'react';
1
+ import { default as React } from 'react';
2
2
  export declare const InformationCardTooltip: React.ForwardRefExoticComponent<{
3
- informationCardProps?: import("..").InformationCardProps;
3
+ informationCardProps?: import('..').InformationCardProps;
4
4
  content?: React.ReactNode;
5
5
  children: React.ReactNode;
6
- popoverProps?: Omit<import("@synerise/ds-popover").PopoverOptions, "listNavigationConfig" | "arrowConfig" | "returnFocus" | "modal">;
6
+ popoverProps?: Omit<import('@synerise/ds-popover').PopoverOptions, "listNavigationConfig" | "arrowConfig" | "returnFocus" | "modal">;
7
7
  asChild?: boolean;
8
- } & Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "content" | "asChild" | "popoverProps" | "informationCardProps"> & import("@synerise/ds-utils").DataAttributes & React.RefAttributes<HTMLDivElement>>;
8
+ } & Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "content" | "asChild" | "popoverProps" | "informationCardProps"> & import('@synerise/ds-utils').DataAttributes & React.RefAttributes<HTMLDivElement>>;