@julseb-lib/react 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,15 @@
1
- import type { ReactNode, Ref } from "react"
1
+ import type { ReactElement, ReactNode, Ref } from "react"
2
2
  import type {
3
- LibButtonLinkBlank,
4
- LibAllColors,
5
- LibIcon,
6
- LibButtonLinkBlankRequired,
7
- LibSpacers,
8
- LibToastStatus,
9
- ReactChildren,
10
- LibMessageType,
11
- CssFontStyle,
12
- LibColorsHover,
3
+ LibButtonLinkBlank,
4
+ LibAllColors,
5
+ LibIcon,
6
+ LibButtonLinkBlankRequired,
7
+ LibSpacers,
8
+ LibToastStatus,
9
+ ReactChildren,
10
+ LibMessageType,
11
+ CssFontStyle,
12
+ LibColorsHover,
13
13
  } from "./"
14
14
 
15
15
  /**
@@ -21,44 +21,44 @@ import type {
21
21
  * @prop ref?: ForwardedRef<T>
22
22
  */
23
23
  interface LibComponentItemBase<T> {
24
- "data-testid"?: string
25
- className?: string
26
- id?: string
27
- ref?: Ref<T>
24
+ "data-testid"?: string
25
+ className?: string
26
+ id?: string
27
+ ref?: Ref<T>
28
28
  }
29
29
 
30
30
  type ButtonGroupItemsBase = LibComponentItemBase<HTMLButtonElement> &
31
- LibButtonLinkBlank & {
32
- "aria-label"?: string
33
- iconBaseUrl?: string
34
- }
31
+ LibButtonLinkBlank & {
32
+ "aria-label"?: string
33
+ iconBaseUrl?: string
34
+ }
35
35
 
36
36
  type ButtonGroupItemText = ButtonGroupItemsBase & {
37
- text: string
38
- icons?: {
39
- left?: LibIcon
40
- right?: LibIcon
41
- only?: never
42
- }
43
- iconSizes?: {
44
- left?: number
45
- right?: number
46
- only?: never
47
- }
37
+ text: string
38
+ icons?: {
39
+ left?: LibIcon
40
+ right?: LibIcon
41
+ only?: never
42
+ }
43
+ iconSizes?: {
44
+ left?: number
45
+ right?: number
46
+ only?: never
47
+ }
48
48
  }
49
49
 
50
50
  type ButtonGroupItemIcon = ButtonGroupItemsBase & {
51
- text?: never
52
- icons?: {
53
- left?: never
54
- right?: never
55
- only?: LibIcon
56
- }
57
- iconSizes?: {
58
- left?: never
59
- right?: never
60
- only?: number
61
- }
51
+ text?: never
52
+ icons?: {
53
+ left?: never
54
+ right?: never
55
+ only?: LibIcon
56
+ }
57
+ iconSizes?: {
58
+ left?: never
59
+ right?: never
60
+ only?: number
61
+ }
62
62
  }
63
63
 
64
64
  /**
@@ -78,27 +78,27 @@ type ButtonGroupItemIcon = ButtonGroupItemsBase & {
78
78
  export type LibButtonGroupButtonItem = ButtonGroupItemText | ButtonGroupItemIcon
79
79
 
80
80
  interface LibButtonGroupToggleBase
81
- extends LibComponentItemBase<HTMLInputElement> {
82
- id: string
83
- value: boolean
81
+ extends LibComponentItemBase<HTMLInputElement> {
82
+ id: string
83
+ value: boolean
84
84
  }
85
85
 
86
86
  interface ButtonGroupToggleWithIcon extends LibButtonGroupToggleBase {
87
- icon: LibIcon
88
- iconSize?: number
89
- label?: string
90
- tooltip?: string
91
- showTooltip?: boolean
92
- text?: never
87
+ icon: LibIcon
88
+ iconSize?: number
89
+ label?: string
90
+ tooltip?: string
91
+ showTooltip?: boolean
92
+ text?: never
93
93
  }
94
94
 
95
95
  interface ButtonGroupToggleWithText extends LibButtonGroupToggleBase {
96
- icon?: never
97
- iconSize?: never
98
- label?: never
99
- tooltip?: never
100
- showTooltip?: never
101
- text: string
96
+ icon?: never
97
+ iconSize?: never
98
+ label?: never
99
+ tooltip?: never
100
+ showTooltip?: never
101
+ text: string
102
102
  }
103
103
 
104
104
  /**
@@ -116,27 +116,27 @@ interface ButtonGroupToggleWithText extends LibButtonGroupToggleBase {
116
116
  * @prop showTooltip?: boolean => only if text is not defined
117
117
  */
118
118
  export type LibButtonGroupToggle =
119
- | ButtonGroupToggleWithIcon
120
- | ButtonGroupToggleWithText
119
+ | ButtonGroupToggleWithIcon
120
+ | ButtonGroupToggleWithText
121
121
 
122
122
  // ! DO NOT EXPORT
123
123
 
124
124
  type ListGroupItemBadgeColor = {
125
- backgroundColor?: LibAllColors
126
- contentColor?: LibAllColors
127
- size?: number
125
+ backgroundColor?: LibAllColors
126
+ contentColor?: LibAllColors
127
+ size?: number
128
128
  }
129
129
 
130
130
  type ListGroupItemBadgeIcon = ListGroupItemBadgeColor & {
131
- icon?: LibIcon
132
- iconSize?: number
133
- number?: never
131
+ icon?: LibIcon
132
+ iconSize?: number
133
+ number?: never
134
134
  }
135
135
 
136
136
  type ListGroupItemBadgeNumber = ListGroupItemBadgeColor & {
137
- icon?: never
138
- iconSize?: never
139
- number?: number
137
+ icon?: never
138
+ iconSize?: never
139
+ number?: number
140
140
  }
141
141
 
142
142
  /**
@@ -148,25 +148,25 @@ type ListGroupItemBadgeNumber = ListGroupItemBadgeColor & {
148
148
  * @prop number?: number => only if icon is not defined
149
149
  */
150
150
  type ListGroupItemBadgeExtended =
151
- | ListGroupItemBadgeIcon
152
- | ListGroupItemBadgeNumber
151
+ | ListGroupItemBadgeIcon
152
+ | ListGroupItemBadgeNumber
153
153
 
154
154
  // ! END DO NOT EXPORT
155
155
 
156
156
  type ListGroupItemBase = LibButtonLinkBlank &
157
- LibComponentItemBase<HTMLDivElement> & {
158
- text: string
159
- body?: string
160
- }
157
+ LibComponentItemBase<HTMLDivElement> & {
158
+ text: string
159
+ body?: string
160
+ }
161
161
 
162
162
  type ListGroupItemWithBadge = ListGroupItemBase & {
163
- badge?: boolean | ListGroupItemBadgeExtended
164
- date?: never
163
+ badge?: boolean | ListGroupItemBadgeExtended
164
+ date?: never
165
165
  }
166
166
 
167
167
  type ListGroupItemWithDate = ListGroupItemBase & {
168
- badge?: never
169
- date?: string | Date
168
+ badge?: never
169
+ date?: string | Date
170
170
  }
171
171
 
172
172
  /**
@@ -194,9 +194,9 @@ export type LibListGroupItem = ListGroupItemWithBadge | ListGroupItemWithDate
194
194
  * @prop content?: ReactChildren
195
195
  */
196
196
  export interface LibAccordionItem extends LibComponentItemBase<HTMLDivElement> {
197
- title: string
198
- content?: ReactChildren
199
- defaultOpen?: boolean
197
+ title: string
198
+ content?: ReactChildren
199
+ defaultOpen?: boolean
200
200
  }
201
201
 
202
202
  /**
@@ -212,12 +212,12 @@ export interface LibAccordionItem extends LibComponentItemBase<HTMLDivElement> {
212
212
  * @prop gap?: LibSpacers
213
213
  */
214
214
  export type LibDropdownItem = LibButtonLinkBlankRequired &
215
- LibComponentItemBase<HTMLButtonElement & HTMLAnchorElement> & {
216
- text: string
217
- icon?: LibIcon
218
- iconSize?: number
219
- gap?: LibSpacers
220
- }
215
+ LibComponentItemBase<HTMLButtonElement & HTMLAnchorElement> & {
216
+ text: string
217
+ icon?: LibIcon
218
+ iconSize?: number
219
+ gap?: LibSpacers
220
+ }
221
221
 
222
222
  /**
223
223
  * @description Props for Toaster component items: https://documentation-components-react.vercel.app/components/toast
@@ -235,21 +235,21 @@ export type LibDropdownItem = LibButtonLinkBlankRequired &
235
235
  * @prop timerBackgroundColor?: Any color from the library
236
236
  */
237
237
  export interface LibToastOptions extends LibComponentItemBase<HTMLDivElement> {
238
- body?: string | ReactChildren
239
- duration?: number
240
- icons?: {
241
- left?: LibIcon
242
- close?: LibIcon
243
- }
244
- iconSizes?: {
245
- left?: number
246
- close?: number
247
- }
248
- iconLeftColor?: LibAllColors
249
- iconsBaseUrl?: string
250
- labelClose?: string
251
- withTimer?: boolean
252
- timerBackgroundColor?: LibAllColors
238
+ body?: string | ReactChildren
239
+ duration?: number
240
+ icons?: {
241
+ left?: LibIcon
242
+ close?: LibIcon
243
+ }
244
+ iconSizes?: {
245
+ left?: number
246
+ close?: number
247
+ }
248
+ iconLeftColor?: LibAllColors
249
+ iconsBaseUrl?: string
250
+ labelClose?: string
251
+ withTimer?: boolean
252
+ timerBackgroundColor?: LibAllColors
253
253
  }
254
254
 
255
255
  /**
@@ -278,10 +278,10 @@ export interface LibToastOptions extends LibComponentItemBase<HTMLDivElement> {
278
278
  * @prop timerBackgroundColor?: Any color from the library
279
279
  */
280
280
  export interface LibToast extends LibComponentItemBase<HTMLDivElement> {
281
- title: string
282
- id?: string
283
- status?: LibToastStatus
284
- options?: LibToastOptions
281
+ title: string
282
+ id?: string
283
+ status?: LibToastStatus
284
+ options?: LibToastOptions
285
285
  }
286
286
 
287
287
  /**
@@ -299,9 +299,9 @@ export interface LibToast extends LibComponentItemBase<HTMLDivElement> {
299
299
  * @prop blank?: boolean => only if to or href are defined
300
300
  */
301
301
  export type LibStep = LibButtonLinkBlank &
302
- LibComponentItemBase<HTMLDivElement> & {
303
- text: string
304
- }
302
+ LibComponentItemBase<HTMLDivElement> & {
303
+ text: string
304
+ }
305
305
 
306
306
  /**
307
307
  * @description Props for Breadcrumbs component items: https://documentation-components-react.vercel.app/components/breadcrumbs
@@ -313,9 +313,9 @@ export type LibStep = LibButtonLinkBlank &
313
313
  * @prop text: string
314
314
  */
315
315
  export type LibBreadcrumbItem = LibButtonLinkBlank &
316
- LibComponentItemBase<HTMLAnchorElement & HTMLSpanElement> & {
317
- text: string | JSX.Element
318
- }
316
+ LibComponentItemBase<HTMLAnchorElement & HTMLSpanElement> & {
317
+ text: string | ReactElement
318
+ }
319
319
 
320
320
  /**
321
321
  * @description Props for Tabs component items: https://documentation-components-react.vercel.app/components/tabs
@@ -327,9 +327,9 @@ export type LibBreadcrumbItem = LibButtonLinkBlank &
327
327
  * @prop content: ReactNode
328
328
  */
329
329
  export interface LibTabItem
330
- extends LibComponentItemBase<HTMLDivElement & HTMLButtonElement> {
331
- title: string
332
- content: ReactNode
330
+ extends LibComponentItemBase<HTMLDivElement & HTMLButtonElement> {
331
+ title: string
332
+ content: ReactNode
333
333
  }
334
334
 
335
335
  /**
@@ -344,10 +344,10 @@ export interface LibTabItem
344
344
  * @prop time?: string
345
345
  */
346
346
  export interface LibMessage extends LibComponentItemBase<HTMLDivElement> {
347
- type: LibMessageType
348
- text: string
349
- date?: Date | string
350
- time?: string
347
+ type: LibMessageType
348
+ text: string
349
+ date?: Date | string
350
+ time?: string
351
351
  }
352
352
 
353
353
  /**
@@ -371,23 +371,23 @@ export interface LibMessage extends LibComponentItemBase<HTMLDivElement> {
371
371
  * @prop editorPreview?: boolean
372
372
  */
373
373
  export interface LibMarkdownEditorOptions {
374
- titles?: boolean
375
- bold?: boolean
376
- italic?: boolean
377
- strikethrough?: boolean
378
- underline?: boolean
379
- ul?: boolean
380
- ol?: boolean
381
- link?: boolean
382
- quote?: boolean
383
- hr?: boolean
384
- code?: boolean
385
- codeBlock?: boolean
386
- comment?: boolean
387
- image?: boolean
388
- editorCode?: boolean
389
- editorLive?: boolean
390
- editorPreview?: boolean
374
+ titles?: boolean
375
+ bold?: boolean
376
+ italic?: boolean
377
+ strikethrough?: boolean
378
+ underline?: boolean
379
+ ul?: boolean
380
+ ol?: boolean
381
+ link?: boolean
382
+ quote?: boolean
383
+ hr?: boolean
384
+ code?: boolean
385
+ codeBlock?: boolean
386
+ comment?: boolean
387
+ image?: boolean
388
+ editorCode?: boolean
389
+ editorLive?: boolean
390
+ editorPreview?: boolean
391
391
  }
392
392
 
393
393
  /**
@@ -401,10 +401,10 @@ export interface LibMarkdownEditorOptions {
401
401
  * @prop end?: boolean => prop from react-router, to render the active class only if path is not further
402
402
  */
403
403
  export type LibHeaderLink = LibButtonLinkBlankRequired &
404
- LibComponentItemBase<HTMLAnchorElement & HTMLButtonElement> & {
405
- text: ReactChildren
406
- end?: boolean
407
- }
404
+ LibComponentItemBase<HTMLAnchorElement & HTMLButtonElement> & {
405
+ text: ReactChildren
406
+ end?: boolean
407
+ }
408
408
 
409
409
  /**
410
410
  * @description Props for Items in IconMenu component items: https://documentation-components-react.vercel.app/icon-menu
@@ -418,11 +418,11 @@ export type LibHeaderLink = LibButtonLinkBlankRequired &
418
418
  * @prop iconSize?: number
419
419
  */
420
420
  export type LibIconMenuItem = LibButtonLinkBlankRequired &
421
- LibComponentItemBase<HTMLButtonElement & HTMLAnchorElement> & {
422
- label: string
423
- icon: LibIcon
424
- iconSize?: number
425
- }
421
+ LibComponentItemBase<HTMLButtonElement & HTMLAnchorElement> & {
422
+ label: string
423
+ icon: LibIcon
424
+ iconSize?: number
425
+ }
426
426
 
427
427
  /**
428
428
  * @description Props for links in Footer component items: https://documentation-components-react.vercel.app/components/footer
@@ -434,36 +434,36 @@ export type LibIconMenuItem = LibButtonLinkBlankRequired &
434
434
  * @prop text: ReactChildren
435
435
  */
436
436
  export type LibFooterLink = LibButtonLinkBlankRequired &
437
- LibComponentItemBase<HTMLAnchorElement & HTMLButtonElement> & {
438
- text: ReactChildren
439
- }
437
+ LibComponentItemBase<HTMLAnchorElement & HTMLButtonElement> & {
438
+ text: ReactChildren
439
+ }
440
440
 
441
441
  type LibDragListItemBase = LibComponentItemBase<HTMLDivElement> & {
442
- id: string
442
+ id: string
443
443
  }
444
444
 
445
445
  interface DragListItemWithContentAndBadge extends LibDragListItemBase {
446
- title: string
447
- body?: string
448
- badge?: boolean | ListGroupItemBadgeExtended
449
- date?: never
450
- element?: never
446
+ title: string
447
+ body?: string
448
+ badge?: boolean | ListGroupItemBadgeExtended
449
+ date?: never
450
+ element?: never
451
451
  }
452
452
 
453
453
  interface DragListItemWithContentAndDate extends LibDragListItemBase {
454
- title: string
455
- body?: string
456
- badge?: never
457
- date?: string | Date
458
- element?: never
454
+ title: string
455
+ body?: string
456
+ badge?: never
457
+ date?: string | Date
458
+ element?: never
459
459
  }
460
460
 
461
461
  interface DragListItemWithElement extends LibDragListItemBase {
462
- title?: never
463
- body?: never
464
- badge?: never
465
- date?: never
466
- element?: JSX.Element
462
+ title?: never
463
+ body?: never
464
+ badge?: never
465
+ date?: never
466
+ element?: ReactElement
467
467
  }
468
468
 
469
469
  /**
@@ -479,33 +479,33 @@ interface DragListItemWithElement extends LibDragListItemBase {
479
479
  * @prop element?: JSX.ELement => only if title and other props are not defined
480
480
  */
481
481
  export type LibDragListItem =
482
- | DragListItemWithContentAndBadge
483
- | DragListItemWithContentAndDate
484
- | DragListItemWithElement
482
+ | DragListItemWithContentAndBadge
483
+ | DragListItemWithContentAndDate
484
+ | DragListItemWithElement
485
485
 
486
486
  interface HelperBottomWithText {
487
- text: string
488
- textColor?: LibAllColors
489
- fontStyle?: CssFontStyle
490
- icon?: LibIcon
491
- iconColor?: LibAllColors
492
- iconSize?: number
493
- element?: never
494
- linkColor?: LibColorsHover
487
+ text: string
488
+ textColor?: LibAllColors
489
+ fontStyle?: CssFontStyle
490
+ icon?: LibIcon
491
+ iconColor?: LibAllColors
492
+ iconSize?: number
493
+ element?: never
494
+ linkColor?: LibColorsHover
495
495
  }
496
496
 
497
497
  interface HelperBottomWithElement {
498
- text?: never
499
- textColor?: never
500
- fontStyle?: never
501
- icon?: never
502
- iconColor?: never
503
- iconSize?: never
504
- element: ReactChildren
505
- linkColor?: LibColorsHover
498
+ text?: never
499
+ textColor?: never
500
+ fontStyle?: never
501
+ icon?: never
502
+ iconColor?: never
503
+ iconSize?: never
504
+ element: ReactChildren
505
+ linkColor?: LibColorsHover
506
506
  }
507
507
 
508
508
  export type LibHelperBottom =
509
- | string
510
- | HelperBottomWithText
511
- | HelperBottomWithElement
509
+ | string
510
+ | HelperBottomWithText
511
+ | HelperBottomWithElement
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@julseb-lib/react",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "scripts": {