reactive-bulma 2.12.0 → 2.13.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -2
- package/dist/cjs/index.js +47 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/atoms/LevelHeader/index.d.ts +4 -0
- package/dist/cjs/types/components/atoms/index.d.ts +1 -0
- package/dist/cjs/types/components/molecules/LevelItem/index.d.ts +4 -0
- package/dist/cjs/types/components/molecules/index.d.ts +1 -0
- package/dist/cjs/types/components/organisms/Level/index.d.ts +4 -0
- package/dist/cjs/types/components/organisms/index.d.ts +1 -0
- package/dist/cjs/types/interfaces/atomProps.d.ts +6 -0
- package/dist/cjs/types/interfaces/moleculeProps.d.ts +6 -0
- package/dist/cjs/types/interfaces/organismProps.d.ts +11 -1
- package/dist/esm/index.js +45 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/atoms/LevelHeader/index.d.ts +4 -0
- package/dist/esm/types/components/atoms/index.d.ts +1 -0
- package/dist/esm/types/components/molecules/LevelItem/index.d.ts +4 -0
- package/dist/esm/types/components/molecules/index.d.ts +1 -0
- package/dist/esm/types/components/organisms/Level/index.d.ts +4 -0
- package/dist/esm/types/components/organisms/index.d.ts +1 -0
- package/dist/esm/types/interfaces/atomProps.d.ts +6 -0
- package/dist/esm/types/interfaces/moleculeProps.d.ts +6 -0
- package/dist/esm/types/interfaces/organismProps.d.ts +11 -1
- package/dist/index.d.ts +29 -1
- package/package.json +1 -1
@@ -20,3 +20,4 @@ export { default as MenuItem } from './MenuItem';
|
|
20
20
|
export { default as Image } from './Image';
|
21
21
|
export { default as PaginationItem } from './PaginationItem';
|
22
22
|
export { default as TabItem } from './TabItem';
|
23
|
+
export { default as LevelHeader } from './LevelHeader';
|
@@ -12,3 +12,4 @@ export { default as Tabs } from './Tabs';
|
|
12
12
|
export { default as InputControl } from './InputControl';
|
13
13
|
export { default as PanelBlock } from './PanelBlock';
|
14
14
|
export { default as PanelTabs } from './PanelTabs';
|
15
|
+
export { default as LevelItem } from '../molecules/LevelItem';
|
@@ -271,3 +271,9 @@ export interface TabItemProps extends ComposedElementProps, ClickeableProps {
|
|
271
271
|
/** `Styling` Used for `Tabs` styling purpose only. Will mark the tab as the one selected among its group */
|
272
272
|
isActive?: boolean;
|
273
273
|
}
|
274
|
+
export interface LevelHeaderProps extends ElementProps {
|
275
|
+
/** `Attribute` `Required` A title in smaller size */
|
276
|
+
header: string;
|
277
|
+
/** `Attribute` `Required` Main value (numeric or text) to be shown in a bigger scale below `header` */
|
278
|
+
value: string | number;
|
279
|
+
}
|
@@ -168,4 +168,10 @@ export interface PanelTabsProps extends ElementProps {
|
|
168
168
|
/** `Attribute` `Required` A list of configuration objects that will render a set of tabs */
|
169
169
|
tabList: PanelTabItem[];
|
170
170
|
}
|
171
|
+
export interface LevelItemProps extends ElementProps {
|
172
|
+
/** `Attribute` `Required` Reffers to the component or string content that will be shown inside the level */
|
173
|
+
content: string | React.ReactElement;
|
174
|
+
/** `Styling` Centers item's content horizontally */
|
175
|
+
isCentered?: boolean;
|
176
|
+
}
|
171
177
|
export {};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ElementProps } from './commonProps';
|
2
|
-
import { InputControlProps, PanelBlockProps, PanelTabsProps } from './moleculeProps';
|
2
|
+
import { InputControlProps, LevelItemProps, PanelBlockProps, PanelTabsProps } from './moleculeProps';
|
3
3
|
import { basicColorType } from '../types/styleTypes';
|
4
4
|
export interface FormFieldHelperProps {
|
5
5
|
text?: string;
|
@@ -27,3 +27,13 @@ export interface PanelProps extends ElementProps {
|
|
27
27
|
/** `Styling` Color based on bulma's text color tokens */
|
28
28
|
color?: basicColorType;
|
29
29
|
}
|
30
|
+
export interface LevelProps extends ElementProps {
|
31
|
+
/** `Attribute` A list of `LevelItem` configurations that will displayed in Level's left side */
|
32
|
+
leftSide?: LevelItemProps[];
|
33
|
+
/** `Attribute` A list of `LevelItem` configurations that will displayed in Level's center */
|
34
|
+
centerSide?: LevelItemProps[];
|
35
|
+
/** `Attribute` A list of `LevelItem` configurations that will displayed in Level's right side */
|
36
|
+
rightSide?: LevelItemProps[];
|
37
|
+
/** `Styling` Will adjust the navigator on horizontal on mobile as well */
|
38
|
+
isMobile?: boolean;
|
39
|
+
}
|
package/dist/esm/index.js
CHANGED
@@ -3284,6 +3284,13 @@ const TabItem = ({ testId = null, containerTestId = null, cssClasses = null, con
|
|
3284
3284
|
React.createElement("span", { "data-testid": tabItemTestId, className: cssClasses !== null && cssClasses !== void 0 ? cssClasses : undefined, style: style !== null && style !== void 0 ? style : undefined }, text)));
|
3285
3285
|
};
|
3286
3286
|
|
3287
|
+
const LevelHeader = ({ testId = null, cssClasses = null, style = null, header, value }) => {
|
3288
|
+
const levelHeaderTestId = testId !== null && testId !== void 0 ? testId : parseTestId({ tag: 'level-header', parsedClasses: cssClasses !== null && cssClasses !== void 0 ? cssClasses : '' });
|
3289
|
+
return (React.createElement("section", { "data-testid": levelHeaderTestId, className: cssClasses !== null && cssClasses !== void 0 ? cssClasses : undefined, style: style !== null && style !== void 0 ? style : undefined },
|
3290
|
+
React.createElement("p", { className: 'heading' }, header),
|
3291
|
+
React.createElement("p", { className: 'title' }, value)));
|
3292
|
+
};
|
3293
|
+
|
3287
3294
|
const generateKey = (max = 5000, min = 1) => {
|
3288
3295
|
max = Math.floor(max);
|
3289
3296
|
min = Math.ceil(min);
|
@@ -3609,6 +3616,29 @@ const PanelTabs = ({ testId = null, cssClasses = null, style = null, tabList })
|
|
3609
3616
|
})));
|
3610
3617
|
};
|
3611
3618
|
|
3619
|
+
const LevelItem = ({ testId = null, cssClasses = null, style = null, content, isCentered = false }) => {
|
3620
|
+
const levelItemClasses = parseClasses([
|
3621
|
+
'level-item',
|
3622
|
+
isCentered ? 'has-text-centered' : null,
|
3623
|
+
cssClasses
|
3624
|
+
]);
|
3625
|
+
const levelItemTestId = testId !== null && testId !== void 0 ? testId : parseTestId({
|
3626
|
+
tag: 'level-item',
|
3627
|
+
parsedClasses: levelItemClasses,
|
3628
|
+
rules: [
|
3629
|
+
{
|
3630
|
+
regExp: /is-|has-/gm,
|
3631
|
+
replacer: '-'
|
3632
|
+
},
|
3633
|
+
{
|
3634
|
+
regExp: /level-item/gm,
|
3635
|
+
replacer: ''
|
3636
|
+
}
|
3637
|
+
]
|
3638
|
+
});
|
3639
|
+
return (React.createElement("section", { "data-testid": levelItemTestId, className: levelItemClasses, style: style !== null && style !== void 0 ? style : undefined }, content));
|
3640
|
+
};
|
3641
|
+
|
3612
3642
|
const renderFieldLabel = (labelText) => labelText ? (React.createElement("label", { "data-testid": 'test-form-field-label', className: 'label' }, labelText)) : null;
|
3613
3643
|
const renderFieldBody = (inputControlConfig, isGrouped) => {
|
3614
3644
|
if (isGrouped) {
|
@@ -3662,5 +3692,19 @@ const Panel = ({ testId = null, cssClasses = null, style = null, headerText, pan
|
|
3662
3692
|
blockList.map(blockConfig => (React.createElement(PanelBlock, Object.assign({ key: `panel-block-item-${generateKey()}` }, blockConfig))))));
|
3663
3693
|
};
|
3664
3694
|
|
3665
|
-
|
3695
|
+
const renderLevelSection = (levelItemList) => levelItemList.map(_levelItemConfig => (React.createElement(LevelItem, Object.assign({ key: `level-item-${generateKey()}` }, _levelItemConfig))));
|
3696
|
+
const Level = ({ testId = null, cssClasses = null, style = null, leftSide = null, centerSide = null, rightSide = null, isMobile = false }) => {
|
3697
|
+
const levelClasses = parseClasses([
|
3698
|
+
'level',
|
3699
|
+
isMobile ? 'is-mobile' : null,
|
3700
|
+
cssClasses
|
3701
|
+
]);
|
3702
|
+
const levelTestId = testId !== null && testId !== void 0 ? testId : parseTestId({ tag: 'level', parsedClasses: levelClasses });
|
3703
|
+
return (React.createElement("nav", { "data-testid": levelTestId, className: levelClasses, style: style !== null && style !== void 0 ? style : undefined },
|
3704
|
+
leftSide ? (React.createElement("section", { className: 'level-left' }, renderLevelSection(leftSide))) : null,
|
3705
|
+
centerSide ? renderLevelSection(centerSide) : null,
|
3706
|
+
rightSide ? (React.createElement("section", { className: 'level-right' }, renderLevelSection(rightSide))) : null));
|
3707
|
+
};
|
3708
|
+
|
3709
|
+
export { Block, Box, BreadcrumbItem, Breadcrumbs, Button, ButtonGroup, CheckBox as Checkbox, Column, ColumnGroup, Delete, Dropdown, DropdownItem, DropdownTrigger, File, FormField, 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, Title };
|
3666
3710
|
//# sourceMappingURL=index.js.map
|