reactive-bulma 2.10.0 → 2.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. package/LICENSE +1 -1
  2. package/dist/cjs/index.js +159 -38
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/types/components/molecules/InputControl/index.d.ts +4 -0
  5. package/dist/cjs/types/components/molecules/PanelBlock/index.d.ts +4 -0
  6. package/dist/cjs/types/components/molecules/PanelTabs/index.d.ts +4 -0
  7. package/dist/cjs/types/components/molecules/index.d.ts +3 -0
  8. package/dist/cjs/types/components/organisms/FormField/index.d.ts +4 -0
  9. package/dist/cjs/types/components/organisms/Panel/index.d.ts +4 -0
  10. package/dist/cjs/types/components/organisms/index.d.ts +2 -0
  11. package/dist/cjs/types/functions/generators.d.ts +4 -0
  12. package/dist/cjs/types/functions/parsers.d.ts +0 -8
  13. package/dist/cjs/types/functions/tests/generators.test.d.ts +1 -0
  14. package/dist/cjs/types/index.d.ts +1 -0
  15. package/dist/cjs/types/interfaces/atomProps.d.ts +22 -16
  16. package/dist/cjs/types/interfaces/commonProps.d.ts +1 -1
  17. package/dist/cjs/types/interfaces/functionProps.d.ts +5 -0
  18. package/dist/cjs/types/interfaces/moleculeProps.d.ts +48 -9
  19. package/dist/cjs/types/interfaces/organismProps.d.ts +29 -0
  20. package/dist/cjs/types/types/domTypes.d.ts +3 -2
  21. package/dist/cjs/types/types/styleTypes.d.ts +5 -3
  22. package/dist/esm/index.js +155 -39
  23. package/dist/esm/index.js.map +1 -1
  24. package/dist/esm/types/components/molecules/InputControl/index.d.ts +4 -0
  25. package/dist/esm/types/components/molecules/PanelBlock/index.d.ts +4 -0
  26. package/dist/esm/types/components/molecules/PanelTabs/index.d.ts +4 -0
  27. package/dist/esm/types/components/molecules/index.d.ts +3 -0
  28. package/dist/esm/types/components/organisms/FormField/index.d.ts +4 -0
  29. package/dist/esm/types/components/organisms/Panel/index.d.ts +4 -0
  30. package/dist/esm/types/components/organisms/index.d.ts +2 -0
  31. package/dist/esm/types/functions/generators.d.ts +4 -0
  32. package/dist/esm/types/functions/parsers.d.ts +0 -8
  33. package/dist/esm/types/functions/tests/generators.test.d.ts +1 -0
  34. package/dist/esm/types/index.d.ts +1 -0
  35. package/dist/esm/types/interfaces/atomProps.d.ts +22 -16
  36. package/dist/esm/types/interfaces/commonProps.d.ts +1 -1
  37. package/dist/esm/types/interfaces/functionProps.d.ts +5 -0
  38. package/dist/esm/types/interfaces/moleculeProps.d.ts +48 -9
  39. package/dist/esm/types/interfaces/organismProps.d.ts +29 -0
  40. package/dist/esm/types/types/domTypes.d.ts +3 -2
  41. package/dist/esm/types/types/styleTypes.d.ts +5 -3
  42. package/dist/index.d.ts +110 -26
  43. package/package.json +11 -11
package/dist/index.d.ts CHANGED
@@ -30,16 +30,19 @@ type columnOffsetType = 'is-offset-1' | 'is-offset-2' | 'is-offset-3' | 'is-offs
30
30
  type basicColorType = 'is-white' | 'is-light' | 'is-dark' | 'is-black' | 'is-text' | 'is-ghost' | 'is-primary' | 'is-link' | 'is-info' | 'is-success' | 'is-warning' | 'is-danger';
31
31
  type textColorType = 'has-text-white' | 'has-text-black' | 'has-text-light' | 'has-text-dark' | 'has-text-primary' | 'has-text-link' | 'has-text-info' | 'has-text-success' | 'has-text-warning' | 'has-text-danger';
32
32
  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';
33
- type basicSizeType = 'is-small' | 'is-normal' | 'is-medium' | 'is-large';
34
- type reducedSizeType = Exclude<basicSizeType, 'is-normal'>;
33
+ type elementSizeType = 'is-small' | 'is-normal' | 'is-medium' | 'is-large';
34
+ type sizeWithoutNormalType = Exclude<elementSizeType, 'is-normal'>;
35
35
  type iconColorModeType = 'light' | 'dark';
36
36
  type columnGapType = 'is-0' | 'is-1' | 'is-2' | 'is-3' | 'is-4' | 'is-5' | 'is-6' | 'is-7' | 'is-8';
37
- type elementAlignType = 'is-centered' | 'is-right';
37
+ type elementAlignType = 'is-centered' | 'is-right' | 'is-left';
38
+ type rightCenteredAlignType = Exclude<elementAlignType, 'is-left'>;
39
+ type rightLeftAlignType = Exclude<elementAlignType, 'is-centered'>;
38
40
  type breadcrumbSeparatorType = 'has-arrow-separator' | 'has-bullet-separator' | 'has-dot-separator' | 'has-succeeds-separator';
39
41
  type tabsFormatType = 'is-boxed' | 'is-toggle';
40
42
 
41
- type inputTypes = 'text' | 'password' | 'email' | 'tel';
43
+ type InputType = 'text' | 'password' | 'email' | 'tel';
42
44
  type DropdownItemType = 'item' | 'link' | 'divider';
45
+ type PanelBlockItemType = 'icon' | 'control' | 'button';
43
46
 
44
47
  interface ColumnProps extends ElementProps, React$1.ComponentPropsWithoutRef<'section'> {
45
48
  /** `Attribute` Reffers to the component or array of components that will be shown inside the column */
@@ -66,14 +69,14 @@ interface ButtonProps extends ElementProps, React$1.ComponentPropsWithoutRef<'bu
66
69
  isOutlined?: boolean;
67
70
  /** `Styling` Will add round borders to button's shape */
68
71
  isRounded?: boolean;
69
- /** `Styling` Will change `text` for a animated spinner, but will remain clickeable */
72
+ /** `Styling` Will change `text` for an animated spinner, but will remain clickeable */
70
73
  isLoading?: boolean;
71
74
  /** `Styling` Similar to `isDisabled`, but will remove any color style */
72
75
  isStatic?: boolean;
73
76
  /** `Styling` Sets the button style when a User selects it (useful for an attached `ButtonGroup`) */
74
77
  isSelected?: boolean;
75
78
  /** `Styling` Set button's size on bulma's size tokens */
76
- size?: basicSizeType;
79
+ size?: elementSizeType;
77
80
  /** `Function` Click function, alone does not nothing, but can be reused for other components */
78
81
  onClick?: () => void;
79
82
  }
@@ -85,8 +88,8 @@ interface ProgressBarProps extends ElementProps, React$1.ComponentPropsWithoutRe
85
88
  /** `Styling` Color based on bulma's color tokens */
86
89
  color?: basicColorType;
87
90
  /** `Styling` Set progress bar's size */
88
- size?: basicSizeType;
89
- /** `Styling` Will change `value` for a animated loading */
91
+ size?: elementSizeType;
92
+ /** `Styling` Will change `value` for an animated loading */
90
93
  isLoading?: boolean;
91
94
  }
92
95
  interface BlockProps extends ElementProps, React$1.ComponentPropsWithoutRef<'section'> {
@@ -109,7 +112,7 @@ interface TagProps extends ComposedElementProps, React$1.ComponentPropsWithoutRe
109
112
  /** `Styling` Will add round borders to tag's shape */
110
113
  isRounded?: boolean;
111
114
  /** `Styling` Set tag's size */
112
- size?: reducedSizeType;
115
+ size?: sizeWithoutNormalType;
113
116
  /** `Styling` Color on tag's addon based on bulma's color tokens */
114
117
  addonColor?: basicColorType;
115
118
  /** `Function` Click function for `delete` option, alone does not nothing, but can be reused for other components */
@@ -118,6 +121,8 @@ interface TagProps extends ComposedElementProps, React$1.ComponentPropsWithoutRe
118
121
  interface ImageProps extends ComposedElementProps, React$1.ComponentPropsWithoutRef<'figure'> {
119
122
  /** `Attribute` `Required` The image source that will be shown */
120
123
  src: string;
124
+ /** `Attribute` A description text for the image, useful for accessibility purposes */
125
+ alt?: string;
121
126
  /** `Styling` Will add round borders to image's shape */
122
127
  fixedSize?: fixedImageSizeType;
123
128
  /** `Styling` Sets image size based on one of fixed ratios/fixed sizes */
@@ -151,17 +156,21 @@ interface IconProps extends ComposedElementProps {
151
156
  /** `Styling` Color based on bulma's text color tokens */
152
157
  color?: textColorType;
153
158
  /** `Styling` Set icons's size */
154
- size?: reducedSizeType;
159
+ size?: sizeWithoutNormalType;
155
160
  /** `Styling` Special usage in case you want to set as dark or light mode */
156
161
  colorMode?: iconColorModeType;
157
162
  /** `Styling` Animates the icon spinning 360° */
158
163
  isSpinning?: boolean;
164
+ /** `Styling` Used for `InputControl` styling purpose only. Will move the Icon itself to control's Input side */
165
+ position?: rightLeftAlignType;
159
166
  }
160
167
  interface InputProps extends ElementProps, ClickeableProps {
161
168
  /** `Attribute` `Required` What type of input will be used */
162
- type: inputTypes;
169
+ type: InputType;
163
170
  /** `Attribute` The value that will be shown on the input */
164
171
  text?: string;
172
+ /** `Attribute` The text that will be shown if the user does not type any value */
173
+ placeholder?: string;
165
174
  /** `Attribute` Will disable the input */
166
175
  isDisabled?: boolean;
167
176
  /** `Attribute` Will show the input as a normal one, but is not editable and has no shadow */
@@ -169,7 +178,7 @@ interface InputProps extends ElementProps, ClickeableProps {
169
178
  /** `Styling` Color based on bulma's text color tokens */
170
179
  color?: basicColorType;
171
180
  /** `Styling` Set input's size */
172
- size?: basicSizeType;
181
+ size?: sizeWithoutNormalType;
173
182
  /** `Styling` Will add round borders to input's shape */
174
183
  isRounded?: boolean;
175
184
  /** `Styling` Will add a specific border when the input is hovered by the user */
@@ -189,7 +198,7 @@ interface TextAreaProps extends Omit<InputProps, 'isRounded' | 'type'> {
189
198
  }
190
199
  interface DeleteProps extends ElementProps, ClickeableProps {
191
200
  /** `Styling` Set icons's size */
192
- size?: reducedSizeType;
201
+ size?: sizeWithoutNormalType;
193
202
  }
194
203
  interface SelectOption {
195
204
  id: string | number;
@@ -206,7 +215,7 @@ interface SelectProps extends ComposedElementProps, ClickeableProps {
206
215
  /** `Styling` Color based on bulma's color tokens */
207
216
  color?: basicColorType;
208
217
  /** `Styling` Set select's size */
209
- size?: basicSizeType;
218
+ size?: elementSizeType;
210
219
  /** `Styling`Will add round borders to input's shape */
211
220
  isRounded?: boolean;
212
221
  /** `Styling`Will add a specific border when the input is hovered by the user */
@@ -230,7 +239,7 @@ interface FileProps extends ComposedElementProps, ClickeableProps {
230
239
  /** `Styling` Color based on bulma's color tokens */
231
240
  color?: basicColorType;
232
241
  /** `Styling` Set button's size */
233
- size?: basicSizeType;
242
+ size?: elementSizeType;
234
243
  }
235
244
  interface CheckBoxProps extends ComposedElementProps {
236
245
  /** `Attribute` Sets checkbox's text that will be shown next to its control */
@@ -289,9 +298,9 @@ interface MenuItemProps extends ElementProps, ClickeableProps {
289
298
  interface PaginationItemProps extends ElementProps, ClickeableProps {
290
299
  /** `Attribute` `Required` Sets the number string that will be shown in the item and in its title when user hovers it */
291
300
  text: string | number;
292
- /** `Attribute` Sets the custom text before the `text` when user hovers the item */
301
+ /** `Attribute` Sets a custom text before the `text` when user hovers the item */
293
302
  labelText?: string;
294
- /** `Attribute` Sets the custom text before the `text` when user hovers the item if is the current one */
303
+ /** `Attribute` Sets a custom text before the `text` when user hovers the item if is the current one */
295
304
  currentLabelText?: string;
296
305
  /** `Styling` Makes the item the selected one, changing its background to blue */
297
306
  isSelected?: boolean;
@@ -301,7 +310,7 @@ interface TabItemProps extends ComposedElementProps, ClickeableProps {
301
310
  text: string;
302
311
  /** `Attribute` Adds an `Icon` component before the text */
303
312
  icon?: IconProps;
304
- /** `Styling` Used for Tabs styling purpose only. Will mark the tab as the one selected among its group */
313
+ /** `Styling` Used for `Tabs` styling purpose only. Will mark the tab as the one selected among its group */
305
314
  isActive?: boolean;
306
315
  }
307
316
 
@@ -385,11 +394,11 @@ interface BreadcrumbsProps extends ComposedElementProps {
385
394
  /** `Atribute` `Required` Array of `BreadcrumbItems` objects that will be shown */
386
395
  items: BreadcrumbItemProps[];
387
396
  /** `Styling` Will adjust element position on screen */
388
- alignment?: elementAlignType | null;
397
+ alignment?: rightCenteredAlignType | null;
389
398
  /** `Styling` Will adjust element position on screen */
390
399
  separator?: breadcrumbSeparatorType | null;
391
400
  /** `Styling` Set button's size on bulma's size tokens */
392
- size?: reducedSizeType;
401
+ size?: sizeWithoutNormalType;
393
402
  }
394
403
  interface DropdownProps extends ElementProps {
395
404
  /** `Atribute` `Required` Sets the name will be shown on the dropdown input */
@@ -409,7 +418,7 @@ interface MessageProps extends ElementProps {
409
418
  /** `Styling` Color based on bulma's color tokens */
410
419
  color?: basicColorType;
411
420
  /** `Styling` Set button's size on bulma's size tokens */
412
- size?: reducedSizeType;
421
+ size?: sizeWithoutNormalType;
413
422
  }
414
423
  interface MenuSubListProps {
415
424
  subListTitle: MenuItemProps;
@@ -452,9 +461,9 @@ interface PaginationProps extends ComposedElementProps {
452
461
  /** `Styling` Will add round borders to each page's shape */
453
462
  isRounded?: boolean;
454
463
  /** `Styling` Set button's size on bulma's size tokens */
455
- size?: reducedSizeType;
464
+ size?: sizeWithoutNormalType;
456
465
  /** `Styling` Will adjust the pages position on screen */
457
- alignment?: elementAlignType | null;
466
+ alignment?: rightCenteredAlignType | null;
458
467
  }
459
468
  interface ModalProps extends ComposedElementProps {
460
469
  /** `Attribute` Reffers to the component or array of components that will be shown inside the column */
@@ -466,9 +475,9 @@ interface TabsProps extends ElementProps {
466
475
  /** `Attribute` `Required` List of tabs that will be shown in order */
467
476
  tabs: TabItemProps[];
468
477
  /** `Styling` Will adjust the tabs position on screen */
469
- alignment?: elementAlignType;
478
+ alignment?: rightCenteredAlignType;
470
479
  /** `Styling` Set tab's size on bulma's size tokens */
471
- size?: reducedSizeType;
480
+ size?: sizeWithoutNormalType;
472
481
  /** `Styling` Set tab's size on bulma's size tokens */
473
482
  format?: tabsFormatType;
474
483
  /** `Styling` Will add round tabs borders. Only visible if `format` is set to `is-toggle` */
@@ -476,6 +485,44 @@ interface TabsProps extends ElementProps {
476
485
  /** `Styling` The whole container will occupy its parent container width */
477
486
  isFullWidth?: boolean;
478
487
  }
488
+ interface InputControlProps extends ElementProps {
489
+ /** `Attribute` `Required` control's input configuration which will be wrapped */
490
+ inputConfig: InputProps;
491
+ /** `Attribute` `Icon` configuration that will be shown in Input's left side */
492
+ leftIcon?: IconProps;
493
+ /** `Attribute` `Icon` configuration that will be shown in Input's right side */
494
+ rightIcon?: IconProps;
495
+ /** `Styling` Set control and its input size on bulma's size tokens */
496
+ size?: sizeWithoutNormalType;
497
+ /** `Styling` Will add an animated spinner on input's right side */
498
+ isLoading?: boolean;
499
+ /** `Styling` Used for `FormField` styling purpose only. Will strech the input and its container in full-width */
500
+ isExpanded?: boolean;
501
+ }
502
+ interface PanelBlockItemProps {
503
+ /** `Attribute` `Required` Indicates to component's parser which type of component will be rendered based on its option */
504
+ type: PanelBlockItemType;
505
+ /** `Attribute` `Required` The component properties that will configure that specific instance */
506
+ props: InputControlProps | IconProps | ButtonProps;
507
+ }
508
+ interface PanelBlockProps extends ComposedElementProps, ClickeableProps {
509
+ /** `Attribute` `Required` Configuration object with a type and a set of props based on the available components that could be rendered in each `PanelBlock` */
510
+ config: PanelBlockItemProps;
511
+ /** `Attribute` Usable when config's U is `icon` only. It will display a text next to mentioned icon (for user purposes) */
512
+ blockText?: string;
513
+ /** `Styling` Used for `PanelBlock` styling purpose only. Will mark its rendered component as the one selected among its group */
514
+ isActive?: boolean;
515
+ }
516
+ interface PanelTabItem extends ClickeableProps {
517
+ /** `Attribute` `Required` Will show the text to the user in shape of tab */
518
+ text: string;
519
+ /** `Styling` Used for `PanelTab` styling purpose only. Will mark its rendered component as the one selected among its group */
520
+ isActive?: boolean;
521
+ }
522
+ interface PanelTabsProps extends ElementProps {
523
+ /** `Attribute` `Required` A list of configuration objects that will render a set of tabs */
524
+ tabList: PanelTabItem[];
525
+ }
479
526
 
480
527
  declare const ButtonGroup: React$1.FC<ButtonGroupProps>;
481
528
 
@@ -499,4 +546,41 @@ declare const Modal: React$1.FC<ModalProps>;
499
546
 
500
547
  declare const Tabs: React$1.FC<TabsProps>;
501
548
 
502
- export { Block, Box, BreadcrumbItem, Breadcrumbs, Button, ButtonGroup, CheckBox as Checkbox, Column, ColumnGroup, Delete, Dropdown, DropdownItem, DropdownTrigger, File, Icon, Image, Input, Menu, MenuItem, MenuList, Message, Modal, Notification, Pagination, PaginationItem, ProgressBar, RadioButton, Select, TabItem, Tabs, Tag, TextArea, Title };
549
+ declare const InputControl: React$1.FC<InputControlProps>;
550
+
551
+ declare const PanelBlock: React$1.FC<PanelBlockProps>;
552
+
553
+ declare const PanelTabs: React$1.FC<PanelTabsProps>;
554
+
555
+ interface FormFieldHelperProps {
556
+ text?: string;
557
+ color?: basicColorType;
558
+ }
559
+ interface FormFieldProps extends ElementProps {
560
+ /** `Attribute` `Required` Single or multiple `InputControlProps` config objects which will be wrapped around the `FormField` */
561
+ inputControlConfig: InputControlProps | InputControlProps[];
562
+ /** `Attribute` Sets a custom text before the wrapped input to indicate its usage */
563
+ labelText?: string;
564
+ /** `Attribute` Adds a helper text below the wrapped paragraph to provide context information */
565
+ helperConfig?: FormFieldHelperProps;
566
+ /** `Styling` Will adjust field's sections (label, input/s and helper) in horizontal position */
567
+ isHorizontal?: boolean;
568
+ /** `Styling` Will group the list of inputs in a same wrapper (useful for several inputs with same usage, as a complex address) */
569
+ isGrouped?: boolean;
570
+ }
571
+ interface PanelProps extends ElementProps {
572
+ /** `Attribute` `Required` Will display Panel's header text */
573
+ headerText: string;
574
+ /** `Attribute` A configuration object that will render a set of tabs based on `PanelTab` component */
575
+ panelTabs?: PanelTabsProps;
576
+ /** `Attribute` `Required` A list of configuration objects that will render a list of block with different components, based on `PanelBlockList` component */
577
+ blockList: PanelBlockProps[];
578
+ /** `Styling` Color based on bulma's text color tokens */
579
+ color?: basicColorType;
580
+ }
581
+
582
+ declare const FormField: React$1.FC<FormFieldProps>;
583
+
584
+ declare const Panel: React$1.FC<PanelProps>;
585
+
586
+ export { Block, Box, BreadcrumbItem, Breadcrumbs, Button, ButtonGroup, CheckBox as Checkbox, Column, ColumnGroup, Delete, Dropdown, DropdownItem, DropdownTrigger, File, FormField, Icon, Image, Input, InputControl, Menu, MenuItem, MenuList, Message, Modal, Notification, Pagination, PaginationItem, Panel, PanelBlock, PanelTabs, ProgressBar, RadioButton, Select, TabItem, Tabs, Tag, TextArea, Title };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reactive-bulma",
3
- "version": "2.10.0",
3
+ "version": "2.12.0",
4
4
  "description": "A component library based on React, Bulma, Typescript and Rollup",
5
5
  "keywords": [
6
6
  "typescript",
@@ -67,14 +67,14 @@
67
67
  "@semantic-release/github": "^9.2.6",
68
68
  "@semantic-release/npm": "^11.0.2",
69
69
  "@semantic-release/release-notes-generator": "^12.1.0",
70
- "@storybook/addon-actions": "^7.6.8",
71
- "@storybook/addon-essentials": "^7.6.8",
72
- "@storybook/addon-interactions": "^7.6.8",
73
- "@storybook/addon-links": "^7.6.8",
74
- "@storybook/addon-mdx-gfm": "^7.6.8",
75
- "@storybook/cli": "^7.6.8",
76
- "@storybook/react": "^7.6.8",
77
- "@storybook/react-webpack5": "^7.6.8",
70
+ "@storybook/addon-actions": "^7.6.10",
71
+ "@storybook/addon-essentials": "^7.6.10",
72
+ "@storybook/addon-interactions": "^7.6.10",
73
+ "@storybook/addon-links": "^7.6.10",
74
+ "@storybook/addon-mdx-gfm": "^7.6.10",
75
+ "@storybook/cli": "^7.6.10",
76
+ "@storybook/react": "^7.6.10",
77
+ "@storybook/react-webpack5": "^7.6.10",
78
78
  "@storybook/testing-library": "^0.2.2",
79
79
  "@testing-library/jest-dom": "^6.2.0",
80
80
  "@testing-library/react": "^14.1.2",
@@ -96,14 +96,14 @@
96
96
  "lint-staged": "^15.2.0",
97
97
  "npm-check-updates": "^16.14.12",
98
98
  "postcss": "^8.4.33",
99
- "prettier": "^3.2.2",
99
+ "prettier": "^3.2.4",
100
100
  "react": "^18.2.0",
101
101
  "react-dom": "^18.2.0",
102
102
  "rollup": "^4.9.5",
103
103
  "rollup-plugin-dts": "^6.1.0",
104
104
  "rollup-plugin-postcss": "^4.0.2",
105
105
  "semantic-release": "^23.0.0",
106
- "storybook": "^7.6.8",
106
+ "storybook": "^7.6.10",
107
107
  "tslib": "^2.6.2",
108
108
  "typescript": "^5.3.3"
109
109
  },