1.0.15 • Published 1 month ago

@synerise/ds-information-card v1.0.15

Weekly downloads
-
License
ISC
Repository
github
Last release
1 month ago

id: information-card

title: InformationCard

InformationCard UI Component

Information card shows details of an object or entity. It should be used as an additional information (details) provider when user is selecting something using menu or dropdown.

Installation

npm i @synerise/ds-information-card
or
yarn add @synerise/ds-information-card

Development

# lerna bootstrap # install all required reused shared lerna packages
yarn workspace @synerise/ds-information-card lint
yarn workspace @synerise/ds-information-card build

Usage

import { InformationCardTooltip } from '@synerise/ds-information-card';

<InformationCardTooltip
  informationCardProps={{
    title: 'Title',
    subtitle: 'Subtitle',
    icon: <SegmentM color="mars" />,
    iconColor: 'mars',
    avatarTooltipText: 'Tooltip Text',
  }}
  triggerProps={{
    popupPlacement: 'top'
  }}
>
  <button>Element to attach infocard to</button>
</InformationCardTooltip>;

Generally, components require being capable of rendering this and usually an additional effort is required to get them to support rendering. See text's menu item element packages/components/menu/src/Elements/Item/Text/Text.tsx.

Note that title and subtitle are required props. For just a single line of text consider using @synerise/ds-tooltip.

Usage with dropdown and other components relying on rc-trigger getPopupContainer

Some components render elements via portal, in such a case if tthey are listening for global events like click (for e.g. closing the dropdown) - developer using this component is responsible for proper handling of such a clicks. One of ways is making use of overlayInnerClass popover's class property to later. By default class is ignore-click-outside (so looking for domElement.closest('.ignore-click-outside') to determine whether handler should be skipped should be fine).

Demo

API

PropertyDescriptionTypeDefault
actionButtoncustom jsx element for rendering in action button (bottom-right)boolean | (() => ReactNode)-
actionButtonCallbackdefault action button callback method() => void-
actionButtonTooltipTextdefault action button tooltipstring-
asTooltipadjusts the styles to be displayed as a tooltipboolean-
avatarTooltipTextdescription in a tooltip shown when user (note renderBadge has to be provided)string-
classNamecustom class name for further stylingstring-
copyTooltipsubtitle's value to be copied when clicking on the copy buttonstring-
copiedTooltipfeedback to the user once information card's subtitle has been copiedstring-
descriptionConfigwhen information-card's children prop is not provided, defaultTextAreaProps can be used to parametrize default textareaSubtleTextAreaProps | string | null-
footerTextadditional feedback info to the user, when set to null - footer is hiddenReactNode | null-
iconicon (note this needs to be pure SVG icon, it relies on buildBadgeIcon helper)ReactNode-
iconColoricon color to be applied to icon elementstring-
noticeadditional information shown between subtitle and description section. Can be used for warnings, errors, destructive actions, notices. See buildExtraInfo and alert level there.ReactNode-
renderAdditionalDescriptionRender prop for displaying additional content above footer() => ReactNode-
renderBadgeCustom render prop for displaying. If set to null - badge won't be shown.Function | null-
renderFooterrender prop for rendering the bottom part of (by default section with a small text and an optional action button on the right)() => JSX.Element-
subtitleSecond line. Required prop. Can be copied.string-
titleTitle of the information-card. Can be copied.string-
actionsMenuConfig for displaying "quick actions" - a button in footer that reveals a menu with linksActionsMenuProps-
propertyListItemsan array of object properties to list, can also include dividersInformationCardPropertyListItem[]-
summaryItemsAn array of (label + icon + optional tooltip) summary items to display below propertiesInformationCardSummaryItem[]-

ActionsMenuProps

Quick actions menu

PropertyDescriptionTypeDefault
itemsArray of menu items. See ds-menuMenuItemProps[]-
menuPropsMenu props. See ds-menuPartial<MenuProps>-
buttonLabelfooter button label that shows menuReactNode'Quick actions'
navigationLabelBack to content navigation labelReactNode'Quick actions'

InformationCardPropertyListItem

Displays a list of properties (label & value)

PropertyDescriptionTypeDefault
labellabel to display in the listReactNode-
valuevalur to display in the listReactNode-
typeBack to content navigation labeldivider-

InformationCardSummaryItem

Displays a list of icons with value and optional tooltip

PropertyDescriptionTypeDefault
iconIcon to renderReactNode-
labelLabel to displayReactNode-
tooltipTooltip textReactNode-
tooltipPropsTooltip config, see ds-tooltipTooltipProps-

InformationCardTooltip

Displays InformationCard as a tooltip with children node as trigger

PropertyDescriptionTypeDefault
informationCardPropsProps for rendering the InformationCardInformationCardProps-
triggerPropsTrigger props. See rc-triggerPartial<TriggerProps> & { ref?: React.LegacyRef<TriggerHandle> }-
childrentrigger elementReactNode-
1.0.2

4 months ago

1.0.1

4 months ago

1.0.0

4 months ago

1.0.9

2 months ago

1.0.8

3 months ago

1.0.7

3 months ago

1.0.6

3 months ago

1.0.5

3 months ago

1.0.4

3 months ago

1.0.3

3 months ago

1.0.11

2 months ago

1.0.10

2 months ago

1.0.15

1 month ago

1.0.14

1 month ago

1.0.13

1 month ago

1.0.12

1 month ago

0.9.5

4 months ago

0.9.4

4 months ago

0.9.3

5 months ago

0.9.2

5 months ago

0.8.5

5 months ago

0.8.6

5 months ago

0.9.0

5 months ago

0.9.1

5 months ago

0.8.4

5 months ago

0.8.3

5 months ago

0.8.1

5 months ago

0.8.0

5 months ago

0.8.2

5 months ago

0.7.7

6 months ago

0.7.6

6 months ago

0.7.2

7 months ago

0.7.1

8 months ago

0.7.4

7 months ago

0.7.3

7 months ago

0.7.0

8 months ago

0.7.5

7 months ago

0.6.2

8 months ago

0.6.1

8 months ago

0.6.0

8 months ago

0.5.16

9 months ago

0.5.17

9 months ago

0.5.15

9 months ago

0.5.14

9 months ago

0.5.13

9 months ago

0.5.11

10 months ago

0.5.12

9 months ago

0.5.10

10 months ago

0.4.9

1 year ago

0.4.8

1 year ago

0.5.8

10 months ago

0.5.7

10 months ago

0.5.9

10 months ago

0.4.10

1 year ago

0.4.13

1 year ago

0.4.14

12 months ago

0.4.11

1 year ago

0.4.12

1 year ago

0.4.5

1 year ago

0.4.7

1 year ago

0.4.6

1 year ago

0.5.4

11 months ago

0.5.3

11 months ago

0.5.6

10 months ago

0.5.5

11 months ago

0.5.0

12 months ago

0.5.2

11 months ago

0.5.1

12 months ago

0.4.4

1 year ago

0.4.3

1 year ago

0.4.1

1 year ago

0.4.2

1 year ago

0.4.0

1 year ago

0.3.70

1 year ago

0.3.69

1 year ago

0.3.68

1 year ago

0.3.67

1 year ago

0.3.66

1 year ago

0.3.65

1 year ago

0.3.64

1 year ago

0.3.63

1 year ago

0.3.62

1 year ago

0.3.61

1 year ago

0.3.60

1 year ago

0.3.59

1 year ago

0.3.58

1 year ago

0.3.57

1 year ago

0.3.56

1 year ago

0.3.55

1 year ago

0.3.54

1 year ago

0.3.53

1 year ago

0.3.52

1 year ago

0.3.51

2 years ago

0.3.50

2 years ago

0.3.49

2 years ago

0.3.48

2 years ago

0.3.31

2 years ago

0.3.30

2 years ago

0.3.39

2 years ago

0.3.38

2 years ago

0.3.37

2 years ago

0.3.36

2 years ago

0.3.35

2 years ago

0.3.34

2 years ago

0.3.33

2 years ago

0.3.32

2 years ago

0.3.29

2 years ago

0.3.20

2 years ago

0.3.28

2 years ago

0.3.27

2 years ago

0.3.26

2 years ago

0.3.25

2 years ago

0.3.24

2 years ago

0.3.23

2 years ago

0.3.22

2 years ago

0.3.42

2 years ago

0.3.41

2 years ago

0.3.40

2 years ago

0.3.47

2 years ago

0.3.46

2 years ago

0.3.45

2 years ago

0.3.44

2 years ago

0.3.43

2 years ago

0.3.19

2 years ago

0.3.18

2 years ago

0.3.17

2 years ago

0.3.16

2 years ago

0.3.15

2 years ago

0.3.14

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.3.2

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.9

2 years ago

0.3.13

2 years ago

0.3.12

2 years ago

0.3.11

2 years ago

0.3.10

2 years ago

0.3.0

2 years ago

0.2.6

2 years ago

0.3.1

2 years ago

0.2.5

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.32

3 years ago

0.1.33

3 years ago

0.1.34

3 years ago

0.1.35

3 years ago

0.1.36

3 years ago

0.1.37

2 years ago

0.1.30

3 years ago

0.1.31

3 years ago

0.1.27

3 years ago

0.1.28

3 years ago

0.1.29

3 years ago

0.1.24

3 years ago

0.1.25

3 years ago

0.1.26

3 years ago

0.1.12

3 years ago

0.1.13

3 years ago

0.1.14

3 years ago

0.1.15

3 years ago

0.1.20

3 years ago

0.1.21

3 years ago

0.1.22

3 years ago

0.1.23

3 years ago

0.1.16

3 years ago

0.1.18

3 years ago

0.1.19

3 years ago

0.1.11

3 years ago

0.1.10

3 years ago

0.1.9

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.1

3 years ago