reactive-bulma 2.1.1 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ColumnGroupProps } from '../../../interfaces/moleculeProps';
3
+ declare const ColumnGroup: React.FC<ColumnGroupProps>;
4
+ export default ColumnGroup;
@@ -1 +1,2 @@
1
1
  export { default as ButtonGroup } from './ButtonGroup';
2
+ export { default as ColumnGroup } from './ColumnGroup';
@@ -1,10 +1,25 @@
1
1
  import { ElementProps } from './commonProps';
2
- import { ButtonProps } from './atomProps';
2
+ import { ButtonProps, ColumnProps } from './atomProps';
3
+ import { columnGapType } from '../types/styleTypes';
3
4
  export interface ButtonGroupProps extends ElementProps {
4
- /** `Atribute` Array of button objects that will be shown */
5
+ /** `Atribute` `Required` Array of `Button` objects that will be shown */
5
6
  buttonList: ButtonProps[];
6
7
  /** `Styling` Will group the list of buttonList in a single line */
7
8
  isAttached?: boolean;
8
9
  /** `Styling` Sets group position on the container */
9
10
  position?: 'left' | 'centered' | 'right';
10
11
  }
12
+ export interface ColumnGroupProps extends ElementProps {
13
+ /** `Atribute` `Required` Array of `Column` objects that will be shown */
14
+ listOfColumns: ColumnProps[];
15
+ /** `Styling` Will adjust column structure display layout in case you want to work on mobiles */
16
+ isMobileLayout?: boolean;
17
+ /** `Styling` Will reorder column display in multiple lines each time exceeds viewport width */
18
+ isMultiline?: boolean;
19
+ /** `Styling` Will center the list of columns vertically */
20
+ isVerticallyCentered?: boolean;
21
+ /** `Styling` Will center the list of columns horizontally */
22
+ isHorizontallyCentered?: boolean;
23
+ /** `Styling` Will adjust the space between the columns. In case to set null, it will remove those gaps */
24
+ gap?: columnGapType | null;
25
+ }
@@ -6,3 +6,4 @@ export type textColorType = 'has-text-white' | 'has-text-black' | 'has-text-ligh
6
6
  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';
7
7
  export type basicSizeType = 'is-small' | 'is-normal' | 'is-medium' | 'is-large';
8
8
  export type iconColorModeType = 'light' | 'dark';
9
+ export type columnGapType = 'is-0' | 'is-1' | 'is-2' | 'is-3' | 'is-4' | 'is-5' | 'is-6' | 'is-7' | 'is-8';
package/dist/esm/index.js CHANGED
@@ -3197,9 +3197,36 @@ const ButtonGroup = ({ testId = null, cssClasses = null, style = null, buttonLis
3197
3197
  const shouldApplyColor = (hasSelectedButton && currentButtonItem.isSelected) ||
3198
3198
  !hasSelectedButton;
3199
3199
  const buttonConfig = Object.assign(Object.assign({}, currentButtonItem), { color: shouldApplyColor ? currentButtonItem.color : undefined });
3200
- return (React.createElement(Button, Object.assign({ key: `button-list-item-${i}` }, buttonConfig)));
3200
+ return (React.createElement(Button, Object.assign({ key: `button-group-item-${i}` }, buttonConfig)));
3201
3201
  })));
3202
3202
  };
3203
3203
 
3204
- export { Block, Box, Button, ButtonGroup, CheckBox as Checkbox, Column, Delete, File, Icon, Input, ProgressBar, RadioButton, Select, Tag, TextArea, Title };
3204
+ const parseGapCssClass = (gapPropValue) => {
3205
+ switch (gapPropValue) {
3206
+ case null:
3207
+ return 'is-gapless';
3208
+ case undefined:
3209
+ return 'is-3';
3210
+ default:
3211
+ return gapPropValue;
3212
+ }
3213
+ };
3214
+ const ColumnGroup = ({ testId = null, cssClasses = null, style = null, listOfColumns, isMobileLayout = null, isMultiline = null, isVerticallyCentered = null, isHorizontallyCentered = null, gap = undefined }) => {
3215
+ const columnGroupClasses = parseClasses([
3216
+ 'columns',
3217
+ isMultiline ? 'is-multiline' : null,
3218
+ isMobileLayout ? 'is-mobile' : null,
3219
+ isVerticallyCentered ? 'is-vcentered' : null,
3220
+ isHorizontallyCentered ? 'is-centered' : null,
3221
+ parseGapCssClass(gap),
3222
+ cssClasses
3223
+ ]);
3224
+ const columnGroupTestId = testId !== null && testId !== void 0 ? testId : parseTestId({
3225
+ tag: 'columns',
3226
+ parsedClasses: columnGroupClasses
3227
+ });
3228
+ return (React.createElement("section", { "data-testid": columnGroupTestId, className: columnGroupClasses, style: style !== null && style !== void 0 ? style : undefined }, listOfColumns.map((_columnItem, i) => (React.createElement(Column, Object.assign({ key: `column-group-item-${i}` }, _columnItem))))));
3229
+ };
3230
+
3231
+ export { Block, Box, Button, ButtonGroup, CheckBox as Checkbox, Column, ColumnGroup, Delete, File, Icon, Input, ProgressBar, RadioButton, Select, Tag, TextArea, Title };
3205
3232
  //# sourceMappingURL=index.js.map