reactive-bulma 2.17.0 → 3.0.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 { SectionProps } from '../../../interfaces/moleculeProps';
3
+ declare const Section: React.FC<SectionProps>;
4
+ export default Section;
@@ -16,3 +16,4 @@ export { default as LevelItem } from '../molecules/LevelItem';
16
16
  export { default as TileBox } from './TileBox';
17
17
  export { default as Footer } from './Footer';
18
18
  export { default as Media } from './Media';
19
+ export { default as Section } from './Section';
@@ -1,6 +1,6 @@
1
1
  import { ClickeableProps, ComposedElementProps, ElementProps } from './commonProps';
2
2
  import { BreadcrumbItemProps, ButtonProps, ColumnProps, DeleteProps, DropdownItemProps, IconProps, InputProps, MenuItemProps, PaginationItemProps, TabItemProps, TileProps } from './atomProps';
3
- import { BasicColorType, RightCenteredAlignType, BreadcrumbSeparatorType, ColumnGapType, SizeWithoutNormalType, TabsFormatType } from '../types/styleTypes';
3
+ import { BasicColorType, RightCenteredAlignType, BreadcrumbSeparatorType, ColumnGapType, SizeWithoutNormalType, TabsFormatType, MediumAndLargeSizeType } from '../types/styleTypes';
4
4
  import { ChildrenType, SingleChildType, PanelBlockItemType } from '../types/domTypes';
5
5
  export interface ButtonGroupProps extends ElementProps {
6
6
  /** `Atribute` `Required` Array of `Button` objects that will be shown */
@@ -41,7 +41,7 @@ export interface BreadcrumbsProps extends ComposedElementProps {
41
41
  alignment?: RightCenteredAlignType | null;
42
42
  /** `Styling` Will adjust element position on screen */
43
43
  separator?: BreadcrumbSeparatorType | null;
44
- /** `Styling` Set button's size on bulma's size tokens */
44
+ /** `Styling` Set breadcrumb's size on bulma's size tokens */
45
45
  size?: SizeWithoutNormalType;
46
46
  }
47
47
  export interface DropdownProps extends ElementProps {
@@ -189,4 +189,10 @@ export interface MediaProps extends ElementProps {
189
189
  /** `Attribute` Reffers to the component or string content that will be shown inside the component's right side */
190
190
  rightContent?: SingleChildType;
191
191
  }
192
+ export interface SectionProps extends ElementProps {
193
+ /** `Attribute` `Required` Reffers to the component or string content that will be shown inside the section */
194
+ content: SingleChildType;
195
+ /** `Styling` Set button's size on bulma's size tokens */
196
+ size?: MediumAndLargeSizeType;
197
+ }
192
198
  export {};
@@ -1,6 +1,6 @@
1
1
  import { ElementProps } from './commonProps';
2
2
  import { InputControlProps, LevelItemProps, PanelBlockProps, PanelTabsProps } from './moleculeProps';
3
- import { BasicColorType, SizeWithoutNormalType } from '../types/styleTypes';
3
+ import { BasicColorType, SizeWithHeightType } from '../types/styleTypes';
4
4
  import { ChildrenType } from '../types/domTypes';
5
5
  import { TileProps } from './atomProps';
6
6
  export interface FormFieldHelperProps {
@@ -47,7 +47,7 @@ export interface HeroProps extends ElementProps {
47
47
  /** `Attribute` Designated section for hero's footer, it will be visible only if container's `size` is setted to `is-fullheight` */
48
48
  footer?: ChildrenType;
49
49
  /** `Styling` Set hero's size */
50
- size?: SizeWithoutNormalType | 'is-halfheight' | 'is-fullheight';
50
+ size?: SizeWithHeightType;
51
51
  /** `Styling` Color based on bulma's text color tokens */
52
52
  color?: BasicColorType;
53
53
  }
@@ -11,4 +11,5 @@ export declare enum IconSizeEnum {
11
11
  'is-large' = 48
12
12
  }
13
13
  export type TileContextType = 'is-child' | 'is-parent' | 'is-ancestor';
14
+ export type HeroContentType = 'head' | 'body' | 'foot';
14
15
  export type MediaSectionType = 'left' | 'content' | 'right';
@@ -8,6 +8,8 @@ export type TextColorType = 'has-text-white' | 'has-text-black' | 'has-text-ligh
8
8
  export type FixedImageSizeType = 'is-16x16' | 'is-24x24' | 'is-32x32' | 'is-48x48' | 'is-64x64' | 'is-96x96' | 'is-128x128' | 'is-square' | 'is-1by1' | 'is-5by4' | 'is-4by3' | 'is-3by2' | 'is-5by3' | 'is-16by9' | 'is-2by1' | 'is-3by1' | 'is-4by5' | 'is-3by4' | 'is-2by3' | 'is-3by5' | 'is-9by16' | 'is-1by2' | 'is-1by3';
9
9
  export type ElementSizeType = 'is-small' | 'is-normal' | 'is-medium' | 'is-large';
10
10
  export type SizeWithoutNormalType = Exclude<ElementSizeType, 'is-normal'>;
11
+ export type SizeWithHeightType = SizeWithoutNormalType | 'is-halfheight' | 'is-fullheight';
12
+ export type MediumAndLargeSizeType = Exclude<SizeWithoutNormalType, 'is-small'>;
11
13
  export type IconColorModeType = 'light' | 'dark';
12
14
  export type ColumnGapType = 'is-0' | 'is-1' | 'is-2' | 'is-3' | 'is-4' | 'is-5' | 'is-6' | 'is-7' | 'is-8';
13
15
  export type ElementAlignType = 'is-centered' | 'is-right' | 'is-left';
package/dist/esm/index.js CHANGED
@@ -3727,6 +3727,12 @@ const Media = ({ testId = null, cssClasses = null, style = null, leftContent = n
3727
3727
  renderMediaSection(rightContent, 'right', mediaTestId)));
3728
3728
  };
3729
3729
 
3730
+ const Section = ({ testId = null, cssClasses = null, style = null, content, size = null }) => {
3731
+ const sectionClasses = parseClasses(['section', size, cssClasses]);
3732
+ const sectionTestId = testId !== null && testId !== void 0 ? testId : parseTestId({ tag: 'section', parsedClasses: sectionClasses });
3733
+ return (React.createElement("section", { "data-testid": sectionTestId, className: sectionClasses, style: style !== null && style !== void 0 ? style : undefined }, content));
3734
+ };
3735
+
3730
3736
  const renderFieldLabel = (labelText) => labelText ? (React.createElement("label", { "data-testid": 'test-form-field-label', className: 'label' }, labelText)) : null;
3731
3737
  const renderFieldBody = (inputControlConfig, isGrouped) => {
3732
3738
  if (isGrouped) {
@@ -3794,13 +3800,14 @@ const Level = ({ testId = null, cssClasses = null, style = null, leftSide = null
3794
3800
  rightSide ? (React.createElement("section", { className: 'level-right' }, renderLevelSection(rightSide))) : null));
3795
3801
  };
3796
3802
 
3803
+ const renderHeroSection = (content, type, testId, size) => type === 'body' || size === 'is-fullheight' ? (React.createElement("section", { "data-testid": `${testId}-${type}`, className: `hero-${type}` }, content)) : null;
3797
3804
  const Hero = ({ testId = null, cssClasses = null, style = null, header = null, body, footer = null, color = null, size = null }) => {
3798
3805
  const heroClasses = parseClasses(['hero', color, size, cssClasses]);
3799
3806
  const heroTestId = testId !== null && testId !== void 0 ? testId : parseTestId({ tag: 'hero', parsedClasses: heroClasses });
3800
3807
  return (React.createElement("section", { "data-testid": heroTestId, className: heroClasses, style: style !== null && style !== void 0 ? style : undefined },
3801
- size === 'is-fullheight' ? (React.createElement("section", { "data-testid": `${heroTestId}-head`, className: 'hero-head' }, header)) : null,
3802
- React.createElement("section", { "data-testid": `${heroTestId}-body`, className: 'hero-body' }, body),
3803
- size === 'is-fullheight' ? (React.createElement("section", { "data-testid": `${heroTestId}-foot`, className: 'hero-foot' }, footer)) : null));
3808
+ renderHeroSection(header, 'head', heroTestId, size),
3809
+ renderHeroSection(body, 'body', heroTestId, size),
3810
+ renderHeroSection(footer, 'foot', heroTestId, size)));
3804
3811
  };
3805
3812
 
3806
3813
  const TileGroup = ({ testId = null, cssClasses = null, style = null, context = 'is-ancestor', size = null, isVertical = false, groupConfig }) => {
@@ -3828,5 +3835,5 @@ const TileGroup = ({ testId = null, cssClasses = null, style = null, context = '
3828
3835
  return (React.createElement(Tile, { testId: tileBoxTestId, cssClasses: cssClasses !== null && cssClasses !== void 0 ? cssClasses : undefined, style: style !== null && style !== void 0 ? style : undefined, context: context, size: size !== null && size !== void 0 ? size : undefined, isVertical: isVertical }, groupConfig.map(tileConfig => (React.createElement(Tile, Object.assign({ key: `tile-item-${generateKey()}` }, tileConfig))))));
3829
3836
  };
3830
3837
 
3831
- 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, Notification, Pagination, PaginationItem, Panel, PanelBlock, PanelTabs, ProgressBar, RadioButton, Select, TabItem, Tabs, Tag, TextArea, Tile, TileBox, TileGroup, Title };
3838
+ 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, Notification, Pagination, PaginationItem, Panel, PanelBlock, PanelTabs, ProgressBar, RadioButton, Section, Select, TabItem, Tabs, Tag, TextArea, Tile, TileBox, TileGroup, Title };
3832
3839
  //# sourceMappingURL=index.js.map