reactive-bulma 2.16.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.js +22 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/molecules/Media/index.d.ts +4 -0
- package/dist/cjs/types/components/molecules/Section/index.d.ts +4 -0
- package/dist/cjs/types/components/molecules/index.d.ts +2 -0
- package/dist/cjs/types/interfaces/moleculeProps.d.ts +16 -2
- package/dist/cjs/types/interfaces/organismProps.d.ts +2 -2
- package/dist/cjs/types/types/domTypes.d.ts +2 -0
- package/dist/cjs/types/types/styleTypes.d.ts +2 -0
- package/dist/esm/index.js +21 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/molecules/Media/index.d.ts +4 -0
- package/dist/esm/types/components/molecules/Section/index.d.ts +4 -0
- package/dist/esm/types/components/molecules/index.d.ts +2 -0
- package/dist/esm/types/interfaces/moleculeProps.d.ts +16 -2
- package/dist/esm/types/interfaces/organismProps.d.ts +2 -2
- package/dist/esm/types/types/domTypes.d.ts +2 -0
- package/dist/esm/types/types/styleTypes.d.ts +2 -0
- package/dist/index.d.ts +23 -3
- package/package.json +6 -6
@@ -15,3 +15,5 @@ export { default as PanelTabs } from './PanelTabs';
|
|
15
15
|
export { default as LevelItem } from '../molecules/LevelItem';
|
16
16
|
export { default as TileBox } from './TileBox';
|
17
17
|
export { default as Footer } from './Footer';
|
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
|
44
|
+
/** `Styling` Set breadcrumb's size on bulma's size tokens */
|
45
45
|
size?: SizeWithoutNormalType;
|
46
46
|
}
|
47
47
|
export interface DropdownProps extends ElementProps {
|
@@ -181,4 +181,18 @@ export interface FooterProps extends ComposedElementProps {
|
|
181
181
|
/** `Styling` Centers footer¿s content horizontally */
|
182
182
|
isContentCentered?: boolean;
|
183
183
|
}
|
184
|
+
export interface MediaProps extends ElementProps {
|
185
|
+
/** `Attribute` Reffers to the component or string content that will be shown inside the component's left side */
|
186
|
+
leftContent?: SingleChildType;
|
187
|
+
/** `Attribute` Reffers to the component or string content that will be shown inside the component's center */
|
188
|
+
centerContent?: SingleChildType;
|
189
|
+
/** `Attribute` Reffers to the component or string content that will be shown inside the component's right side */
|
190
|
+
rightContent?: SingleChildType;
|
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
|
+
}
|
184
198
|
export {};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { ElementProps } from './commonProps';
|
2
2
|
import { InputControlProps, LevelItemProps, PanelBlockProps, PanelTabsProps } from './moleculeProps';
|
3
|
-
import { BasicColorType,
|
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?:
|
50
|
+
size?: SizeWithHeightType;
|
51
51
|
/** `Styling` Color based on bulma's text color tokens */
|
52
52
|
color?: BasicColorType;
|
53
53
|
}
|
@@ -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
@@ -3717,6 +3717,22 @@ const Footer = ({ testId = null, containerTestId = null, cssClasses = null, cont
|
|
3717
3717
|
React.createElement("section", { "data-testid": footerContentTestId, className: footerContentClasses, style: style !== null && style !== void 0 ? style : undefined }, content)));
|
3718
3718
|
};
|
3719
3719
|
|
3720
|
+
const renderMediaSection = (content, position, testId) => content ? (React.createElement("section", { "data-testid": `${testId}-${position}`, className: `media-${position}` }, content)) : null;
|
3721
|
+
const Media = ({ testId = null, cssClasses = null, style = null, leftContent = null, centerContent = null, rightContent = null }) => {
|
3722
|
+
const mediaClasses = parseClasses(['media', cssClasses]);
|
3723
|
+
const mediaTestId = testId !== null && testId !== void 0 ? testId : parseTestId({ tag: 'media', parsedClasses: mediaClasses });
|
3724
|
+
return (React.createElement("article", { "data-testid": mediaTestId, className: mediaClasses, style: style !== null && style !== void 0 ? style : undefined },
|
3725
|
+
renderMediaSection(leftContent, 'left', mediaTestId),
|
3726
|
+
renderMediaSection(centerContent, 'content', mediaTestId),
|
3727
|
+
renderMediaSection(rightContent, 'right', mediaTestId)));
|
3728
|
+
};
|
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
|
+
|
3720
3736
|
const renderFieldLabel = (labelText) => labelText ? (React.createElement("label", { "data-testid": 'test-form-field-label', className: 'label' }, labelText)) : null;
|
3721
3737
|
const renderFieldBody = (inputControlConfig, isGrouped) => {
|
3722
3738
|
if (isGrouped) {
|
@@ -3784,13 +3800,14 @@ const Level = ({ testId = null, cssClasses = null, style = null, leftSide = null
|
|
3784
3800
|
rightSide ? (React.createElement("section", { className: 'level-right' }, renderLevelSection(rightSide))) : null));
|
3785
3801
|
};
|
3786
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;
|
3787
3804
|
const Hero = ({ testId = null, cssClasses = null, style = null, header = null, body, footer = null, color = null, size = null }) => {
|
3788
3805
|
const heroClasses = parseClasses(['hero', color, size, cssClasses]);
|
3789
3806
|
const heroTestId = testId !== null && testId !== void 0 ? testId : parseTestId({ tag: 'hero', parsedClasses: heroClasses });
|
3790
3807
|
return (React.createElement("section", { "data-testid": heroTestId, className: heroClasses, style: style !== null && style !== void 0 ? style : undefined },
|
3791
|
-
|
3792
|
-
|
3793
|
-
|
3808
|
+
renderHeroSection(header, 'head', heroTestId, size),
|
3809
|
+
renderHeroSection(body, 'body', heroTestId, size),
|
3810
|
+
renderHeroSection(footer, 'foot', heroTestId, size)));
|
3794
3811
|
};
|
3795
3812
|
|
3796
3813
|
const TileGroup = ({ testId = null, cssClasses = null, style = null, context = 'is-ancestor', size = null, isVertical = false, groupConfig }) => {
|
@@ -3818,5 +3835,5 @@ const TileGroup = ({ testId = null, cssClasses = null, style = null, context = '
|
|
3818
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))))));
|
3819
3836
|
};
|
3820
3837
|
|
3821
|
-
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, 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 };
|
3822
3839
|
//# sourceMappingURL=index.js.map
|