reactive-bulma 2.4.0 → 2.5.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 { DropdownItemProps } from '../../../interfaces/atomProps';
3
+ declare const DropdownItem: React.FC<DropdownItemProps>;
4
+ export default DropdownItem;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { DropdownTriggerProps } from '../../../interfaces/atomProps';
3
+ declare const DropdownTrigger: React.FC<DropdownTriggerProps>;
4
+ export default DropdownTrigger;
@@ -14,3 +14,5 @@ export { default as File } from './File';
14
14
  export { default as Checkbox } from './Checkbox';
15
15
  export { default as RadioButton } from './RadioButton';
16
16
  export { default as BreadcrumbItem } from './BreadcrumbItem';
17
+ export { default as DropdownTrigger } from './DropdownTrigger';
18
+ export { default as DropdownItem } from './DropdownItem';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { DropdownProps } from '../../../interfaces/moleculeProps';
3
+ declare const Dropdown: React.FC<DropdownProps>;
4
+ export default Dropdown;
@@ -2,3 +2,4 @@ export { default as ButtonGroup } from './ButtonGroup';
2
2
  export { default as ColumnGroup } from './ColumnGroup';
3
3
  export { default as Notification } from './Notification';
4
4
  export { default as Breadcrumbs } from './Breadcrumbs';
5
+ export { default as Dropdown } from './Dropdown';
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { ElementProps, ComposedElementProps } from './commonProps';
2
+ import { ElementProps, ComposedElementProps, ClickeableProps } from './commonProps';
3
3
  import { basicColorType, columnOffsetType, columnSizeType, fixedImageSizeType, iconColorModeType, basicSizeType, textColorType, titleSizeType } from '../types/styleTypes';
4
- import { inputTypes } from '../types/domTypes';
4
+ import { DropdownItemType, inputTypes } from '../types/domTypes';
5
5
  export interface ColumnProps extends ElementProps, React.ComponentPropsWithoutRef<'section'> {
6
6
  /** `Attribute` Reffers to the component or array of components that will be shown inside the column */
7
7
  children?: string | React.ReactElement | React.ReactElement[];
@@ -118,7 +118,7 @@ export interface IconProps extends ComposedElementProps {
118
118
  /** `Styling` Animates the icon spinning 360° */
119
119
  isSpinning?: boolean;
120
120
  }
121
- export interface InputProps extends ElementProps {
121
+ export interface InputProps extends ElementProps, ClickeableProps {
122
122
  /** `Attribute` `Required` What type of input will be used */
123
123
  type: inputTypes;
124
124
  /** `Attribute` The value that will be shown on the input */
@@ -137,8 +137,6 @@ export interface InputProps extends ElementProps {
137
137
  isHovered?: boolean;
138
138
  /** `Styling` Will add a specific border when the input is focused by the user */
139
139
  isFocused?: boolean;
140
- /** `Function` Click function. Alone does not nothing, but can be reused for other components */
141
- onClick?: () => void;
142
140
  /** `Function` Reffers to each time the user press a key. Alone does not nothing, but can be reused for other components */
143
141
  onChange?: () => void;
144
142
  }
@@ -150,18 +148,16 @@ export interface TextAreaProps extends Omit<InputProps, 'isRounded' | 'type'> {
150
148
  /** `Styling` Will disable characteristic sizable property by removing its control on bottom-right corner */
151
149
  isFixedSize?: boolean;
152
150
  }
153
- export interface DeleteProps extends ElementProps {
151
+ export interface DeleteProps extends ElementProps, ClickeableProps {
154
152
  /** `Styling` Set icons's size */
155
153
  size?: Exclude<basicSizeType, 'is-normal'>;
156
- /** `Function` Click function. Alone does not nothing, but can be reused for other components */
157
- onClick?: () => void;
158
154
  }
159
155
  export interface SelectOption {
160
156
  id: string | number;
161
157
  name: string;
162
158
  selected?: boolean;
163
159
  }
164
- export interface SelectProps extends ComposedElementProps {
160
+ export interface SelectProps extends ComposedElementProps, ClickeableProps {
165
161
  /** `Attribute` Indicates the options contained on the select */
166
162
  options?: SelectOption[];
167
163
  /** `Attribute` Indicates how many options will be shown at first glance (before looking for the whole list */
@@ -178,10 +174,8 @@ export interface SelectProps extends ComposedElementProps {
178
174
  isHovered?: boolean;
179
175
  /** `Styling`Will add a specific border when the input is focused by the user */
180
176
  isFocused?: boolean;
181
- /** `Function` Click function. Alone does not nothing, but can be reused for other components */
182
- onClick?: () => void;
183
177
  }
184
- export interface FileProps extends ComposedElementProps {
178
+ export interface FileProps extends ComposedElementProps, ClickeableProps {
185
179
  /** `Attribute` The name of the file to be uploaded */
186
180
  fileName?: string;
187
181
  /** `Attribute` The icon displayed in file's button" */
@@ -198,8 +192,6 @@ export interface FileProps extends ComposedElementProps {
198
192
  color?: basicColorType;
199
193
  /** `Styling` Set button's size */
200
194
  size?: basicSizeType;
201
- /** `Function` Click function, alone does not nothing, but can be reused for other components */
202
- onClick?: () => void;
203
195
  }
204
196
  export interface CheckBoxProps extends ComposedElementProps {
205
197
  /** `Attribute` Sets checkbox's text that will be shown next to its control */
@@ -229,11 +221,23 @@ export interface RadioButtonProps extends ComposedElementProps {
229
221
  /** `Function` Click function, alone does not nothing, but can be reused for other components */
230
222
  onChange?: () => void;
231
223
  }
232
- export interface BreadcrumbItemProps extends ComposedElementProps {
224
+ export interface BreadcrumbItemProps extends ComposedElementProps, ClickeableProps {
233
225
  /** `Attribute` `Required` Indicates item text that will be shown */
234
226
  text: string;
235
227
  /** `Styling` Marks the item as the one where user is located (based on breadcrumb hierarchy) */
236
228
  isActiveItem?: boolean;
237
- /** `Function` Click function, alone does not nothing, but can be reused for other components */
238
- onClick?: () => void;
229
+ }
230
+ export interface DropdownTriggerProps extends ComposedElementProps, ClickeableProps {
231
+ /** `Attribute` `Required` Sets the name will be shown on the dropdown input */
232
+ menuText: string;
233
+ /** `Attribute` Sets a relationship between trigger's button and dropdown's menu to toggle display */
234
+ dropdownPointer?: string;
235
+ }
236
+ export interface DropdownItemProps extends ElementProps, ClickeableProps {
237
+ /** `Attribute` `Required` Sets the name will be shown on the item */
238
+ itemText: string;
239
+ /** `Attribute` Changes item's composition into a `<hr>`, a `<a>` or a `<div>` depending its type */
240
+ type?: DropdownItemType;
241
+ /** `Styling` Marks the item as the one where user is located (based on dropdown hierarchy) */
242
+ isActiveItem?: boolean;
239
243
  }
@@ -17,3 +17,7 @@ export interface ElementProps {
17
17
  }
18
18
  export interface ComposedElementProps extends ElementProps, ContainerProps {
19
19
  }
20
+ export interface ClickeableProps {
21
+ /** `Function` Click function, alone does not nothing, but can be reused for other components */
22
+ onClick?: () => void;
23
+ }
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ComposedElementProps, ElementProps } from './commonProps';
3
- import { BreadcrumbItemProps, ButtonProps, ColumnProps, DeleteProps } from './atomProps';
3
+ import { BreadcrumbItemProps, ButtonProps, ColumnProps, DeleteProps, DropdownItemProps } from './atomProps';
4
4
  import { basicColorType, basicSizeType, breadcrumbAlignType, breadcrumbSeparatorType, columnGapType } from '../types/styleTypes';
5
5
  export interface ButtonGroupProps extends ElementProps {
6
6
  /** `Atribute` `Required` Array of `Button` objects that will be shown */
@@ -44,3 +44,11 @@ export interface BreadcrumbsProps extends ComposedElementProps {
44
44
  /** `Styling` Set button's size on bulma's size tokens */
45
45
  size?: Exclude<basicSizeType, 'is-normal'>;
46
46
  }
47
+ export interface DropdownProps extends ElementProps {
48
+ /** `Atribute` `Required` Sets the name will be shown on the dropdown input */
49
+ inputText: string;
50
+ /** `Attribute` Sets a relationship between dropdown trigger's button and dropdown's menu to toggle display */
51
+ dropdownPointer?: string;
52
+ /** `Atribute` `Required` Array of `DropdownItem` objects that will be shown on its menu */
53
+ listOfItems: DropdownItemProps[];
54
+ }
@@ -1,2 +1,3 @@
1
1
  export type buttonType = 'submit' | 'reset' | 'button';
2
2
  export type inputTypes = 'text' | 'password' | 'email' | 'tel';
3
+ export type DropdownItemType = 'item' | 'link' | 'divider';
package/dist/index.d.ts CHANGED
@@ -19,6 +19,10 @@ interface ElementProps {
19
19
  }
20
20
  interface ComposedElementProps extends ElementProps, ContainerProps {
21
21
  }
22
+ interface ClickeableProps {
23
+ /** `Function` Click function, alone does not nothing, but can be reused for other components */
24
+ onClick?: () => void;
25
+ }
22
26
 
23
27
  type columnSizeType = 'is-three-quarters' | 'is-two-thirds' | 'is-half' | 'is-one-third' | 'is-one-quarter' | 'is-full' | 'is-four-fifths' | 'is-three-fifths' | 'is-two-fifths' | 'is-one-fifth' | 'is-1' | 'is-2' | 'is-3' | 'is-4' | 'is-5' | 'is-6' | 'is-7' | 'is-8' | 'is-9' | 'is-10' | 'is-11' | 'is-12';
24
28
  type titleSizeType = 'is-1' | 'is-2' | 'is-3' | 'is-4' | 'is-5' | 'is-6';
@@ -32,6 +36,7 @@ type breadcrumbAlignType = 'is-centered' | 'is-right';
32
36
  type breadcrumbSeparatorType = 'has-arrow-separator' | 'has-bullet-separator' | 'has-dot-separator' | 'has-succeeds-separator';
33
37
 
34
38
  type inputTypes = 'text' | 'password' | 'email' | 'tel';
39
+ type DropdownItemType = 'item' | 'link' | 'divider';
35
40
 
36
41
  interface ColumnProps extends ElementProps, React$1.ComponentPropsWithoutRef<'section'> {
37
42
  /** `Attribute` Reffers to the component or array of components that will be shown inside the column */
@@ -141,7 +146,7 @@ interface IconProps extends ComposedElementProps {
141
146
  /** `Styling` Animates the icon spinning 360° */
142
147
  isSpinning?: boolean;
143
148
  }
144
- interface InputProps extends ElementProps {
149
+ interface InputProps extends ElementProps, ClickeableProps {
145
150
  /** `Attribute` `Required` What type of input will be used */
146
151
  type: inputTypes;
147
152
  /** `Attribute` The value that will be shown on the input */
@@ -160,8 +165,6 @@ interface InputProps extends ElementProps {
160
165
  isHovered?: boolean;
161
166
  /** `Styling` Will add a specific border when the input is focused by the user */
162
167
  isFocused?: boolean;
163
- /** `Function` Click function. Alone does not nothing, but can be reused for other components */
164
- onClick?: () => void;
165
168
  /** `Function` Reffers to each time the user press a key. Alone does not nothing, but can be reused for other components */
166
169
  onChange?: () => void;
167
170
  }
@@ -173,18 +176,16 @@ interface TextAreaProps extends Omit<InputProps, 'isRounded' | 'type'> {
173
176
  /** `Styling` Will disable characteristic sizable property by removing its control on bottom-right corner */
174
177
  isFixedSize?: boolean;
175
178
  }
176
- interface DeleteProps extends ElementProps {
179
+ interface DeleteProps extends ElementProps, ClickeableProps {
177
180
  /** `Styling` Set icons's size */
178
181
  size?: Exclude<basicSizeType, 'is-normal'>;
179
- /** `Function` Click function. Alone does not nothing, but can be reused for other components */
180
- onClick?: () => void;
181
182
  }
182
183
  interface SelectOption {
183
184
  id: string | number;
184
185
  name: string;
185
186
  selected?: boolean;
186
187
  }
187
- interface SelectProps extends ComposedElementProps {
188
+ interface SelectProps extends ComposedElementProps, ClickeableProps {
188
189
  /** `Attribute` Indicates the options contained on the select */
189
190
  options?: SelectOption[];
190
191
  /** `Attribute` Indicates how many options will be shown at first glance (before looking for the whole list */
@@ -201,10 +202,8 @@ interface SelectProps extends ComposedElementProps {
201
202
  isHovered?: boolean;
202
203
  /** `Styling`Will add a specific border when the input is focused by the user */
203
204
  isFocused?: boolean;
204
- /** `Function` Click function. Alone does not nothing, but can be reused for other components */
205
- onClick?: () => void;
206
205
  }
207
- interface FileProps extends ComposedElementProps {
206
+ interface FileProps extends ComposedElementProps, ClickeableProps {
208
207
  /** `Attribute` The name of the file to be uploaded */
209
208
  fileName?: string;
210
209
  /** `Attribute` The icon displayed in file's button" */
@@ -221,8 +220,6 @@ interface FileProps extends ComposedElementProps {
221
220
  color?: basicColorType;
222
221
  /** `Styling` Set button's size */
223
222
  size?: basicSizeType;
224
- /** `Function` Click function, alone does not nothing, but can be reused for other components */
225
- onClick?: () => void;
226
223
  }
227
224
  interface CheckBoxProps extends ComposedElementProps {
228
225
  /** `Attribute` Sets checkbox's text that will be shown next to its control */
@@ -252,13 +249,25 @@ interface RadioButtonProps extends ComposedElementProps {
252
249
  /** `Function` Click function, alone does not nothing, but can be reused for other components */
253
250
  onChange?: () => void;
254
251
  }
255
- interface BreadcrumbItemProps extends ComposedElementProps {
252
+ interface BreadcrumbItemProps extends ComposedElementProps, ClickeableProps {
256
253
  /** `Attribute` `Required` Indicates item text that will be shown */
257
254
  text: string;
258
255
  /** `Styling` Marks the item as the one where user is located (based on breadcrumb hierarchy) */
259
256
  isActiveItem?: boolean;
260
- /** `Function` Click function, alone does not nothing, but can be reused for other components */
261
- onClick?: () => void;
257
+ }
258
+ interface DropdownTriggerProps extends ComposedElementProps, ClickeableProps {
259
+ /** `Attribute` `Required` Sets the name will be shown on the dropdown input */
260
+ menuText: string;
261
+ /** `Attribute` Sets a relationship between trigger's button and dropdown's menu to toggle display */
262
+ dropdownPointer?: string;
263
+ }
264
+ interface DropdownItemProps extends ElementProps, ClickeableProps {
265
+ /** `Attribute` `Required` Sets the name will be shown on the item */
266
+ itemText: string;
267
+ /** `Attribute` Changes item's composition into a `<hr>`, a `<a>` or a `<div>` depending its type */
268
+ type?: DropdownItemType;
269
+ /** `Styling` Marks the item as the one where user is located (based on dropdown hierarchy) */
270
+ isActiveItem?: boolean;
262
271
  }
263
272
 
264
273
  declare const Button: React$1.FC<ButtonProps>;
@@ -293,6 +302,10 @@ declare const RadioButton: React$1.FC<RadioButtonProps>;
293
302
 
294
303
  declare const BreadcrumbItem: React$1.FC<BreadcrumbItemProps>;
295
304
 
305
+ declare const DropdownTrigger: React$1.FC<DropdownTriggerProps>;
306
+
307
+ declare const DropdownItem: React$1.FC<DropdownItemProps>;
308
+
296
309
  interface ButtonGroupProps extends ElementProps {
297
310
  /** `Atribute` `Required` Array of `Button` objects that will be shown */
298
311
  buttonList: ButtonProps[];
@@ -335,6 +348,14 @@ interface BreadcrumbsProps extends ComposedElementProps {
335
348
  /** `Styling` Set button's size on bulma's size tokens */
336
349
  size?: Exclude<basicSizeType, 'is-normal'>;
337
350
  }
351
+ interface DropdownProps extends ElementProps {
352
+ /** `Atribute` `Required` Sets the name will be shown on the dropdown input */
353
+ inputText: string;
354
+ /** `Attribute` Sets a relationship between dropdown trigger's button and dropdown's menu to toggle display */
355
+ dropdownPointer?: string;
356
+ /** `Atribute` `Required` Array of `DropdownItem` objects that will be shown on its menu */
357
+ listOfItems: DropdownItemProps[];
358
+ }
338
359
 
339
360
  declare const ButtonGroup: React$1.FC<ButtonGroupProps>;
340
361
 
@@ -344,4 +365,6 @@ declare const Notification: React$1.FC<NotificationProps>;
344
365
 
345
366
  declare const Breadcrumbs: React$1.FC<BreadcrumbsProps>;
346
367
 
347
- export { Block, Box, BreadcrumbItem, Breadcrumbs, Button, ButtonGroup, CheckBox as Checkbox, Column, ColumnGroup, Delete, File, Icon, Input, Notification, ProgressBar, RadioButton, Select, Tag, TextArea, Title };
368
+ declare const Dropdown: React$1.FC<DropdownProps>;
369
+
370
+ export { Block, Box, BreadcrumbItem, Breadcrumbs, Button, ButtonGroup, CheckBox as Checkbox, Column, ColumnGroup, Delete, Dropdown, DropdownItem, DropdownTrigger, File, Icon, Input, Notification, ProgressBar, RadioButton, Select, Tag, TextArea, Title };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reactive-bulma",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "A component library based on React, Bulma, Typescript and Rollup",
5
5
  "keywords": [
6
6
  "typescript",
@@ -63,32 +63,33 @@
63
63
  "@semantic-release/github": "^9.2.1",
64
64
  "@semantic-release/npm": "^11.0.0",
65
65
  "@semantic-release/release-notes-generator": "^12.0.0",
66
- "@storybook/addon-actions": "^7.4.6",
67
- "@storybook/addon-essentials": "^7.4.6",
68
- "@storybook/addon-interactions": "^7.4.6",
69
- "@storybook/addon-links": "^7.4.6",
70
- "@storybook/addon-mdx-gfm": "^7.4.6",
71
- "@storybook/cli": "^7.4.6",
72
- "@storybook/react": "^7.4.6",
73
- "@storybook/react-webpack5": "^7.4.6",
66
+ "@storybook/addon-actions": "^7.5.1",
67
+ "@storybook/addon-essentials": "^7.5.1",
68
+ "@storybook/addon-interactions": "^7.5.1",
69
+ "@storybook/addon-links": "^7.5.1",
70
+ "@storybook/addon-mdx-gfm": "^7.5.1",
71
+ "@storybook/cli": "^7.5.1",
72
+ "@storybook/react": "^7.5.1",
73
+ "@storybook/react-webpack5": "^7.5.1",
74
74
  "@storybook/testing-library": "^0.2.2",
75
75
  "@testing-library/jest-dom": "^6.1.4",
76
76
  "@testing-library/react": "^14.0.0",
77
- "@types/jest": "^29.5.5",
78
- "@types/react": "^18.2.28",
79
- "@typescript-eslint/eslint-plugin": "^6.7.5",
80
- "@typescript-eslint/parser": "^6.7.5",
77
+ "@testing-library/user-event": "^14.5.1",
78
+ "@types/jest": "^29.5.6",
79
+ "@types/react": "^18.2.31",
80
+ "@typescript-eslint/eslint-plugin": "^6.8.0",
81
+ "@typescript-eslint/parser": "^6.8.0",
81
82
  "babel-jest": "^29.7.0",
82
83
  "babel-loader": "^9.1.3",
83
84
  "bulma": "^0.9.4",
84
- "eslint": "^8.51.0",
85
+ "eslint": "^8.52.0",
85
86
  "eslint-config-prettier": "^9.0.0",
86
87
  "eslint-plugin-react": "^7.33.2",
87
88
  "husky": "^8.0.3",
88
89
  "hygen": "^6.2.11",
89
90
  "jest": "^29.7.0",
90
91
  "jest-environment-jsdom": "^29.7.0",
91
- "lint-staged": "^15.0.1",
92
+ "lint-staged": "^15.0.2",
92
93
  "postcss": "^8.4.31",
93
94
  "prettier": "^3.0.3",
94
95
  "react": "^18.2.0",
@@ -97,7 +98,7 @@
97
98
  "rollup-plugin-dts": "^6.1.0",
98
99
  "rollup-plugin-postcss": "^4.0.2",
99
100
  "semantic-release": "^22.0.5",
100
- "storybook": "^7.4.6",
101
+ "storybook": "^7.5.1",
101
102
  "tslib": "^2.6.2",
102
103
  "typescript": "^5.2.2"
103
104
  },