reactive-bulma 2.12.0 → 2.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/index.js +57 -0
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/types/components/atoms/LevelHeader/index.d.ts +4 -0
  5. package/dist/cjs/types/components/atoms/index.d.ts +1 -0
  6. package/dist/cjs/types/components/molecules/LevelItem/index.d.ts +4 -0
  7. package/dist/cjs/types/components/molecules/index.d.ts +1 -0
  8. package/dist/cjs/types/components/organisms/Hero/index.d.ts +4 -0
  9. package/dist/cjs/types/components/organisms/Level/index.d.ts +4 -0
  10. package/dist/cjs/types/components/organisms/index.d.ts +2 -0
  11. package/dist/cjs/types/interfaces/atomProps.d.ts +34 -27
  12. package/dist/cjs/types/interfaces/moleculeProps.d.ts +23 -17
  13. package/dist/cjs/types/interfaces/organismProps.d.ts +27 -4
  14. package/dist/cjs/types/types/componentEnums.d.ts +3 -0
  15. package/dist/cjs/types/types/styleTypes.d.ts +15 -15
  16. package/dist/esm/index.js +54 -1
  17. package/dist/esm/index.js.map +1 -1
  18. package/dist/esm/types/components/atoms/LevelHeader/index.d.ts +4 -0
  19. package/dist/esm/types/components/atoms/index.d.ts +1 -0
  20. package/dist/esm/types/components/molecules/LevelItem/index.d.ts +4 -0
  21. package/dist/esm/types/components/molecules/index.d.ts +1 -0
  22. package/dist/esm/types/components/organisms/Hero/index.d.ts +4 -0
  23. package/dist/esm/types/components/organisms/Level/index.d.ts +4 -0
  24. package/dist/esm/types/components/organisms/index.d.ts +2 -0
  25. package/dist/esm/types/interfaces/atomProps.d.ts +34 -27
  26. package/dist/esm/types/interfaces/moleculeProps.d.ts +23 -17
  27. package/dist/esm/types/interfaces/organismProps.d.ts +27 -4
  28. package/dist/esm/types/types/componentEnums.d.ts +3 -0
  29. package/dist/esm/types/types/styleTypes.d.ts +15 -15
  30. package/dist/index.d.ts +104 -59
  31. 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,29 @@ 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
+
3711
+ const Hero = ({ testId = null, cssClasses = null, style = null, header = null, body, footer = null, color = null, size = null }) => {
3712
+ const heroClasses = parseClasses(['hero', color, size, cssClasses]);
3713
+ const heroTestId = testId !== null && testId !== void 0 ? testId : parseTestId({ tag: 'hero', parsedClasses: heroClasses });
3714
+ return (React.createElement("section", { "data-testid": heroTestId, className: heroClasses, style: style !== null && style !== void 0 ? style : undefined },
3715
+ size === 'is-fullheight' ? (React.createElement("section", { "data-testid": `${heroTestId}-head`, className: 'hero-head' }, header)) : null,
3716
+ React.createElement("section", { "data-testid": `${heroTestId}-body`, className: 'hero-body' }, body),
3717
+ size === 'is-fullheight' ? (React.createElement("section", { "data-testid": `${heroTestId}-foot`, className: 'hero-foot' }, footer)) : null));
3718
+ };
3719
+
3667
3720
  exports.Block = Block;
3668
3721
  exports.Box = Box;
3669
3722
  exports.BreadcrumbItem = BreadcrumbItem;
@@ -3679,10 +3732,14 @@ exports.DropdownItem = DropdownItem;
3679
3732
  exports.DropdownTrigger = DropdownTrigger;
3680
3733
  exports.File = File;
3681
3734
  exports.FormField = FormField;
3735
+ exports.Hero = Hero;
3682
3736
  exports.Icon = Icon;
3683
3737
  exports.Image = Image;
3684
3738
  exports.Input = Input;
3685
3739
  exports.InputControl = InputControl;
3740
+ exports.Level = Level;
3741
+ exports.LevelHeader = LevelHeader;
3742
+ exports.LevelItem = LevelItem;
3686
3743
  exports.Menu = Menu;
3687
3744
  exports.MenuItem = MenuItem;
3688
3745
  exports.MenuList = MenuList;