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
package/README.md
CHANGED
@@ -153,8 +153,6 @@ Reactive bulma's documentation, included in this repo in the root directory, is
|
|
153
153
|
|
154
154
|
Learn more about `Storybook` by reading its [documentation](https://storybook.js.org/docs/react/get-started/install).
|
155
155
|
|
156
|
-
Learn more about `Hygen` by reading its [documentation](https://www.hygen.io/docs/quick-start).
|
157
|
-
|
158
156
|
## Usage
|
159
157
|
|
160
158
|
```jsx
|
@@ -178,6 +176,8 @@ After some time, I understood that creating component files is a repetitive and
|
|
178
176
|
- Then, the assistant will ask in which folder you want to create it (based on its type following [Atomic Design hierarchy structure](https://atomicdesign.bradfrost.com/chapter-2/))
|
179
177
|
- At last, the script should create all base files to reduce time and focus on custom implementation.
|
180
178
|
|
179
|
+
Learn more about `Hygen` by reading its [documentation](https://www.hygen.io/docs/quick-start).
|
180
|
+
|
181
181
|
### How to update all dependencies
|
182
182
|
|
183
183
|
In case you wanted to make your own fork, I recommend you to updated at least weekly using a custom command `npm run update`, which will run the following commands in order:
|
package/dist/cjs/index.js
CHANGED
@@ -3286,6 +3286,13 @@ const TabItem = ({ testId = null, containerTestId = null, cssClasses = null, con
|
|
3286
3286
|
React.createElement("span", { "data-testid": tabItemTestId, className: cssClasses !== null && cssClasses !== void 0 ? cssClasses : undefined, style: style !== null && style !== void 0 ? style : undefined }, text)));
|
3287
3287
|
};
|
3288
3288
|
|
3289
|
+
const LevelHeader = ({ testId = null, cssClasses = null, style = null, header, value }) => {
|
3290
|
+
const levelHeaderTestId = testId !== null && testId !== void 0 ? testId : parseTestId({ tag: 'level-header', parsedClasses: cssClasses !== null && cssClasses !== void 0 ? cssClasses : '' });
|
3291
|
+
return (React.createElement("section", { "data-testid": levelHeaderTestId, className: cssClasses !== null && cssClasses !== void 0 ? cssClasses : undefined, style: style !== null && style !== void 0 ? style : undefined },
|
3292
|
+
React.createElement("p", { className: 'heading' }, header),
|
3293
|
+
React.createElement("p", { className: 'title' }, value)));
|
3294
|
+
};
|
3295
|
+
|
3289
3296
|
const generateKey = (max = 5000, min = 1) => {
|
3290
3297
|
max = Math.floor(max);
|
3291
3298
|
min = Math.ceil(min);
|
@@ -3611,6 +3618,29 @@ const PanelTabs = ({ testId = null, cssClasses = null, style = null, tabList })
|
|
3611
3618
|
})));
|
3612
3619
|
};
|
3613
3620
|
|
3621
|
+
const LevelItem = ({ testId = null, cssClasses = null, style = null, content, isCentered = false }) => {
|
3622
|
+
const levelItemClasses = parseClasses([
|
3623
|
+
'level-item',
|
3624
|
+
isCentered ? 'has-text-centered' : null,
|
3625
|
+
cssClasses
|
3626
|
+
]);
|
3627
|
+
const levelItemTestId = testId !== null && testId !== void 0 ? testId : parseTestId({
|
3628
|
+
tag: 'level-item',
|
3629
|
+
parsedClasses: levelItemClasses,
|
3630
|
+
rules: [
|
3631
|
+
{
|
3632
|
+
regExp: /is-|has-/gm,
|
3633
|
+
replacer: '-'
|
3634
|
+
},
|
3635
|
+
{
|
3636
|
+
regExp: /level-item/gm,
|
3637
|
+
replacer: ''
|
3638
|
+
}
|
3639
|
+
]
|
3640
|
+
});
|
3641
|
+
return (React.createElement("section", { "data-testid": levelItemTestId, className: levelItemClasses, style: style !== null && style !== void 0 ? style : undefined }, content));
|
3642
|
+
};
|
3643
|
+
|
3614
3644
|
const renderFieldLabel = (labelText) => labelText ? (React.createElement("label", { "data-testid": 'test-form-field-label', className: 'label' }, labelText)) : null;
|
3615
3645
|
const renderFieldBody = (inputControlConfig, isGrouped) => {
|
3616
3646
|
if (isGrouped) {
|
@@ -3664,6 +3694,20 @@ const Panel = ({ testId = null, cssClasses = null, style = null, headerText, pan
|
|
3664
3694
|
blockList.map(blockConfig => (React.createElement(PanelBlock, Object.assign({ key: `panel-block-item-${generateKey()}` }, blockConfig))))));
|
3665
3695
|
};
|
3666
3696
|
|
3697
|
+
const renderLevelSection = (levelItemList) => levelItemList.map(_levelItemConfig => (React.createElement(LevelItem, Object.assign({ key: `level-item-${generateKey()}` }, _levelItemConfig))));
|
3698
|
+
const Level = ({ testId = null, cssClasses = null, style = null, leftSide = null, centerSide = null, rightSide = null, isMobile = false }) => {
|
3699
|
+
const levelClasses = parseClasses([
|
3700
|
+
'level',
|
3701
|
+
isMobile ? 'is-mobile' : null,
|
3702
|
+
cssClasses
|
3703
|
+
]);
|
3704
|
+
const levelTestId = testId !== null && testId !== void 0 ? testId : parseTestId({ tag: 'level', parsedClasses: levelClasses });
|
3705
|
+
return (React.createElement("nav", { "data-testid": levelTestId, className: levelClasses, style: style !== null && style !== void 0 ? style : undefined },
|
3706
|
+
leftSide ? (React.createElement("section", { className: 'level-left' }, renderLevelSection(leftSide))) : null,
|
3707
|
+
centerSide ? renderLevelSection(centerSide) : null,
|
3708
|
+
rightSide ? (React.createElement("section", { className: 'level-right' }, renderLevelSection(rightSide))) : null));
|
3709
|
+
};
|
3710
|
+
|
3667
3711
|
exports.Block = Block;
|
3668
3712
|
exports.Box = Box;
|
3669
3713
|
exports.BreadcrumbItem = BreadcrumbItem;
|
@@ -3683,6 +3727,9 @@ exports.Icon = Icon;
|
|
3683
3727
|
exports.Image = Image;
|
3684
3728
|
exports.Input = Input;
|
3685
3729
|
exports.InputControl = InputControl;
|
3730
|
+
exports.Level = Level;
|
3731
|
+
exports.LevelHeader = LevelHeader;
|
3732
|
+
exports.LevelItem = LevelItem;
|
3686
3733
|
exports.Menu = Menu;
|
3687
3734
|
exports.MenuItem = MenuItem;
|
3688
3735
|
exports.MenuList = MenuList;
|