0.4.4 • Published 5 days ago

@synerise/ds-information-card v0.4.4

Weekly downloads
-
License
ISC
Repository
github
Last release
5 days 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 InformationCard from '@synerise/ds-information-card'
import Popover from 'antd/popover'

<Popover
    defaultVisible={false}
    placement="right"
    content={() => <InformationCard title="Entity full name" subtitle="entity.id"/>}
>Entity short name</Popover>

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 just tooltip or popover.

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| Property | Description | Type | Default |

|-----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|---------| | actionButton | custom jsx element for rendering in action button (bottom-right) | boolean | (() => ReactNode) | - | | actionButtonCallback | default action button callback method | () => void | - | | actionButtonTooltipText | default action button tooltip | string | - | | asTooltip | adjusts the styles to be displayed as a tooltip | boolean | - | | avatarTooltipText | description in a tooltip shown when user (note renderBadge has to be provided) | string | - | | className | custom class name for further styling | string | - | | copyTooltip | subtitle's value to be copied when clicking on the copy button | string | - | | copiedTooltip | feedback to the user once information card's subtitle has been copied | string | - | | descriptionConfig | when information-card's children prop is not provided, defaultTextAreaProps can be used to parametrize default textarea | SubtleTextAreaProps | string | null | - | | footerText | additional feedback info to the user, when set to null - footer is hidden | ReactNode | null | - | | icon | icon (note this needs to be pure SVG icon, it relies on buildBadgeIcon helper) | ReactNode | - | | iconColor | icon color to be applied to icon element | string | - | | notice | additional information shown between subtitle and description section. Can be used for warnings, errors, destructive actions, notices. See buildExtraInfo and alert level there. | ReactNode | - | | renderAdditionalDescription | Render prop for displaying additional content above footer | () => ReactNode | - | | renderBadge | Custom render prop for displaying. If set to null - badge won't be shown. | Function | null | - | | renderFooter | render prop for rendering the bottom part of (by default section with a small text and an optional action button on the right) | () => JSX.Element | - | | subtitle | Second line. Required prop. Can be copied. | string | - | | title | Title of the information-card. Can be copied. | string | - |

0.4.4

5 days ago

0.4.3

10 days ago

0.4.1

13 days ago

0.4.2

13 days ago

0.4.0

21 days ago

0.3.70

24 days ago

0.3.69

29 days ago

0.3.68

1 month ago

0.3.67

2 months ago

0.3.66

2 months ago

0.3.65

2 months ago

0.3.64

2 months ago

0.3.63

2 months ago

0.3.62

2 months ago

0.3.61

3 months ago

0.3.60

3 months ago

0.3.59

3 months ago

0.3.58

3 months ago

0.3.57

3 months ago

0.3.56

3 months ago

0.3.55

4 months ago

0.3.54

4 months ago

0.3.53

4 months ago

0.3.52

4 months ago

0.3.51

5 months ago

0.3.50

5 months ago

0.3.49

5 months ago

0.3.48

6 months ago

0.3.31

9 months ago

0.3.30

9 months ago

0.3.39

8 months ago

0.3.38

8 months ago

0.3.37

8 months ago

0.3.36

8 months ago

0.3.35

8 months ago

0.3.34

9 months ago

0.3.33

9 months ago

0.3.32

9 months ago

0.3.29

9 months ago

0.3.20

11 months ago

0.3.28

10 months ago

0.3.27

10 months ago

0.3.26

10 months ago

0.3.25

10 months ago

0.3.24

10 months ago

0.3.23

10 months ago

0.3.22

10 months ago

0.3.42

7 months ago

0.3.41

7 months ago

0.3.40

8 months ago

0.3.47

6 months ago

0.3.46

6 months ago

0.3.45

7 months ago

0.3.44

7 months ago

0.3.43

7 months ago

0.3.19

11 months ago

0.3.18

11 months ago

0.3.17

12 months ago

0.3.16

12 months ago

0.3.15

12 months ago

0.3.14

1 year ago

0.3.6

1 year ago

0.3.5

1 year ago

0.3.8

1 year ago

0.3.7

1 year ago

0.3.2

1 year ago

0.3.4

1 year ago

0.3.3

1 year ago

0.3.9

1 year ago

0.3.13

1 year ago

0.3.12

1 year ago

0.3.11

1 year ago

0.3.10

1 year ago

0.3.0

1 year ago

0.2.6

1 year ago

0.3.1

1 year ago

0.2.5

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.32

1 year ago

0.1.33

1 year ago

0.1.34

1 year ago

0.1.35

1 year ago

0.1.36

1 year ago

0.1.37

1 year ago

0.1.30

1 year ago

0.1.31

1 year ago

0.1.27

2 years ago

0.1.28

2 years ago

0.1.29

2 years ago

0.1.24

2 years ago

0.1.25

2 years ago

0.1.26

2 years ago

0.1.12

2 years ago

0.1.13

2 years ago

0.1.14

2 years ago

0.1.15

2 years ago

0.1.20

2 years ago

0.1.21

2 years ago

0.1.22

2 years ago

0.1.23

2 years ago

0.1.16

2 years ago

0.1.18

2 years ago

0.1.19

2 years ago

0.1.11

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.1

2 years ago