reactive-bulma 3.1.0 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { CardProps } from '../../../interfaces/organismProps';
3
+ declare const Card: React.FC<CardProps>;
4
+ export default Card;
@@ -4,3 +4,4 @@ export { default as Level } from './Level';
4
4
  export { default as Hero } from './Hero';
5
5
  export { default as TileGroup } from './TileGroup';
6
6
  export { default as NavBar } from './NavBar';
7
+ export { default as Card } from './Card';
@@ -1,8 +1,8 @@
1
- import { ElementProps } from './commonProps';
1
+ import { ClickeableProps, ElementProps } from './commonProps';
2
2
  import { InputControlProps, LevelItemProps, NavBarBrandProps, NavBarDropdownProps, PanelBlockProps, PanelTabsProps } from './moleculeProps';
3
+ import { ImageProps, NavBarItemProps, TileProps } from './atomProps';
3
4
  import { BasicColorType, SizeWithHeightType } from '../types/styleTypes';
4
5
  import { ChildrenType, NavBarFixedPositionType } from '../types/domTypes';
5
- import { NavBarItemProps, TileProps } from './atomProps';
6
6
  export interface FormFieldHelperProps {
7
7
  text?: string;
8
8
  color?: BasicColorType;
@@ -77,3 +77,16 @@ export interface NavBarProps extends ElementProps {
77
77
  /** `Styling` Adds a small shadow on navbar's bottom */
78
78
  hasShadow?: boolean;
79
79
  }
80
+ export interface CardFooterProps extends ClickeableProps {
81
+ text: string;
82
+ }
83
+ export interface CardProps extends ElementProps {
84
+ /** `Attribute` It will shot a text on card's top, just a paragraph */
85
+ headerText?: string;
86
+ /** `Attribute` A single configuration object that will render an `Image` component */
87
+ image?: ImageProps;
88
+ /** `Attribute` `Required` Deisgnated section where you can include a string, a single or list of components (each one separated in its own `content` section) */
89
+ content: ChildrenType;
90
+ /** `Attribute` A list of footer links that will be rendered on card's bottom, below its content */
91
+ footerLinks?: CardFooterProps[];
92
+ }
package/dist/esm/index.js CHANGED
@@ -3959,5 +3959,23 @@ const NavBar = ({ testId = null, cssClasses = null, style = null, brandConfig =
3959
3959
  renderNavBarMenuSection(itemsAtEnd, 'end', navBarTestId))));
3960
3960
  };
3961
3961
 
3962
- export { Block, Box, BreadcrumbItem, Breadcrumbs, Button, ButtonGroup, CheckBox as Checkbox, Column, ColumnGroup, Delete, Dropdown, DropdownItem, DropdownTrigger, File, Footer, FormField, Hero, Icon, Image, Input, InputControl, Level, LevelHeader, LevelItem, Media, Menu, MenuItem, MenuList, Message, Modal, NavBar, NavBarBrand, NavBarDropdown, NavBarItem, Notification, Pagination, PaginationItem, Panel, PanelBlock, PanelTabs, ProgressBar, RadioButton, Section, Select, TabItem, Tabs, Tag, TextArea, Tile, TileBox, TileGroup, Title };
3962
+ const Card = ({ testId = null, cssClasses = null, style = null, headerText = null, image = null, content, footerLinks = null }) => {
3963
+ const cardClasses = parseClasses(['card', cssClasses]);
3964
+ const cardTestId = testId !== null && testId !== void 0 ? testId : parseTestId({ tag: 'card', parsedClasses: cardClasses });
3965
+ return (React.createElement("section", { "data-testid": cardTestId, className: cardClasses, style: style !== null && style !== void 0 ? style : undefined },
3966
+ headerText ? (React.createElement("header", { "data-testid": `${cardTestId}-header`, className: 'card-header' },
3967
+ React.createElement("p", { className: 'card-header-title' }, headerText),
3968
+ React.createElement("button", { className: 'card-header-icon', "aria-label": 'more options' },
3969
+ React.createElement("span", { className: 'icon' },
3970
+ React.createElement("i", { className: 'fas fa-angle-down', "aria-hidden": 'true' }))))) : null,
3971
+ image ? (React.createElement("section", { "data-testid": `${cardTestId}-image`, className: 'card-image' },
3972
+ React.createElement(Image, Object.assign({}, image)))) : null,
3973
+ React.createElement("section", { "data-testid": `${cardTestId}-content`, className: 'card-content' }, Array.isArray(content) ? (content.map((_contentConfig, i) => (React.createElement("section", { key: `card-content-item-${generateKey()}`, "data-testid": `${cardTestId}-content-item-${i}`, className: 'content' }, _contentConfig)))) : (React.createElement("section", { className: 'content' }, content))),
3974
+ footerLinks ? (React.createElement("section", { className: 'card-footer' }, footerLinks.map((_footerConfig, i) => {
3975
+ var _a;
3976
+ return (React.createElement("a", { key: `card-footer-item-${generateKey()}`, "data-testid": `${cardTestId}-footer-item-${i}`, className: 'card-footer-item', "aria-hidden": 'true', onClick: (_a = _footerConfig.onClick) !== null && _a !== void 0 ? _a : undefined }, _footerConfig.text));
3977
+ }))) : null));
3978
+ };
3979
+
3980
+ export { Block, Box, BreadcrumbItem, Breadcrumbs, Button, ButtonGroup, Card, CheckBox as Checkbox, Column, ColumnGroup, Delete, Dropdown, DropdownItem, DropdownTrigger, File, Footer, FormField, Hero, Icon, Image, Input, InputControl, Level, LevelHeader, LevelItem, Media, Menu, MenuItem, MenuList, Message, Modal, NavBar, NavBarBrand, NavBarDropdown, NavBarItem, Notification, Pagination, PaginationItem, Panel, PanelBlock, PanelTabs, ProgressBar, RadioButton, Section, Select, TabItem, Tabs, Tag, TextArea, Tile, TileBox, TileGroup, Title };
3963
3981
  //# sourceMappingURL=index.js.map