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.
- package/dist/cjs/index.js +11 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/molecules/Section/index.d.ts +4 -0
- package/dist/cjs/types/components/molecules/index.d.ts +1 -0
- package/dist/cjs/types/interfaces/moleculeProps.d.ts +8 -2
- package/dist/cjs/types/interfaces/organismProps.d.ts +2 -2
- package/dist/cjs/types/types/domTypes.d.ts +1 -0
- package/dist/cjs/types/types/styleTypes.d.ts +2 -0
- package/dist/esm/index.js +11 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/molecules/Section/index.d.ts +4 -0
- package/dist/esm/types/components/molecules/index.d.ts +1 -0
- package/dist/esm/types/interfaces/moleculeProps.d.ts +8 -2
- package/dist/esm/types/interfaces/organismProps.d.ts +2 -2
- package/dist/esm/types/types/domTypes.d.ts +1 -0
- package/dist/esm/types/types/styleTypes.d.ts +2 -0
- package/dist/index.d.ts +13 -3
- package/package.json +6 -6
@@ -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 {
|
@@ -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,
|
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
@@ -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
|
-
|
3802
|
-
|
3803
|
-
|
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
|