@vitus-labs/elements 1.2.1 → 1.2.3-alpha.56

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.
Files changed (87) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +279 -66
  3. package/lib/analysis/index.js.html +1 -1
  4. package/lib/analysis/vitus-labs-elements.native.js.html +1 -1
  5. package/lib/index.d.ts +835 -850
  6. package/lib/index.d.ts.map +1 -0
  7. package/lib/index.js +1290 -1160
  8. package/lib/index.js.map +1 -1
  9. package/lib/vitus-labs-elements.native.js +1176 -1060
  10. package/lib/vitus-labs-elements.native.js.map +1 -1
  11. package/package.json +24 -24
  12. package/lib/types/Element/component.d.ts +0 -4
  13. package/lib/types/Element/component.d.ts.map +0 -1
  14. package/lib/types/Element/constants.d.ts +0 -51
  15. package/lib/types/Element/constants.d.ts.map +0 -1
  16. package/lib/types/Element/index.d.ts +0 -7
  17. package/lib/types/Element/index.d.ts.map +0 -1
  18. package/lib/types/Element/types.d.ts +0 -423
  19. package/lib/types/Element/types.d.ts.map +0 -1
  20. package/lib/types/Element/utils.d.ts +0 -5
  21. package/lib/types/Element/utils.d.ts.map +0 -1
  22. package/lib/types/Element/withEqualSizeBeforeAfter.d.ts +0 -8
  23. package/lib/types/Element/withEqualSizeBeforeAfter.d.ts.map +0 -1
  24. package/lib/types/List/component.d.ts +0 -23
  25. package/lib/types/List/component.d.ts.map +0 -1
  26. package/lib/types/List/index.d.ts +0 -7
  27. package/lib/types/List/index.d.ts.map +0 -1
  28. package/lib/types/List/withActiveState.d.ts +0 -11
  29. package/lib/types/List/withActiveState.d.ts.map +0 -1
  30. package/lib/types/Overlay/component.d.ts +0 -52
  31. package/lib/types/Overlay/component.d.ts.map +0 -1
  32. package/lib/types/Overlay/context.d.ts +0 -12
  33. package/lib/types/Overlay/context.d.ts.map +0 -1
  34. package/lib/types/Overlay/index.d.ts +0 -7
  35. package/lib/types/Overlay/index.d.ts.map +0 -1
  36. package/lib/types/Overlay/useOverlay.d.ts +0 -109
  37. package/lib/types/Overlay/useOverlay.d.ts.map +0 -1
  38. package/lib/types/Portal/component.d.ts +0 -20
  39. package/lib/types/Portal/component.d.ts.map +0 -1
  40. package/lib/types/Portal/index.d.ts +0 -5
  41. package/lib/types/Portal/index.d.ts.map +0 -1
  42. package/lib/types/Text/component.d.ts +0 -30
  43. package/lib/types/Text/component.d.ts.map +0 -1
  44. package/lib/types/Text/index.d.ts +0 -5
  45. package/lib/types/Text/index.d.ts.map +0 -1
  46. package/lib/types/Text/styled.d.ts +0 -3
  47. package/lib/types/Text/styled.d.ts.map +0 -1
  48. package/lib/types/Util/component.d.ts +0 -19
  49. package/lib/types/Util/component.d.ts.map +0 -1
  50. package/lib/types/Util/index.d.ts +0 -5
  51. package/lib/types/Util/index.d.ts.map +0 -1
  52. package/lib/types/constants.d.ts +0 -2
  53. package/lib/types/constants.d.ts.map +0 -1
  54. package/lib/types/helpers/Content/component.d.ts +0 -5
  55. package/lib/types/helpers/Content/component.d.ts.map +0 -1
  56. package/lib/types/helpers/Content/index.d.ts +0 -3
  57. package/lib/types/helpers/Content/index.d.ts.map +0 -1
  58. package/lib/types/helpers/Content/styled.d.ts +0 -3
  59. package/lib/types/helpers/Content/styled.d.ts.map +0 -1
  60. package/lib/types/helpers/Content/types.d.ts +0 -31
  61. package/lib/types/helpers/Content/types.d.ts.map +0 -1
  62. package/lib/types/helpers/Iterator/component.d.ts +0 -10
  63. package/lib/types/helpers/Iterator/component.d.ts.map +0 -1
  64. package/lib/types/helpers/Iterator/index.d.ts +0 -5
  65. package/lib/types/helpers/Iterator/index.d.ts.map +0 -1
  66. package/lib/types/helpers/Iterator/types.d.ts +0 -60
  67. package/lib/types/helpers/Iterator/types.d.ts.map +0 -1
  68. package/lib/types/helpers/Wrapper/component.d.ts +0 -5
  69. package/lib/types/helpers/Wrapper/component.d.ts.map +0 -1
  70. package/lib/types/helpers/Wrapper/constants.d.ts +0 -6
  71. package/lib/types/helpers/Wrapper/constants.d.ts.map +0 -1
  72. package/lib/types/helpers/Wrapper/index.d.ts +0 -3
  73. package/lib/types/helpers/Wrapper/index.d.ts.map +0 -1
  74. package/lib/types/helpers/Wrapper/styled.d.ts +0 -3
  75. package/lib/types/helpers/Wrapper/styled.d.ts.map +0 -1
  76. package/lib/types/helpers/Wrapper/types.d.ts +0 -42
  77. package/lib/types/helpers/Wrapper/types.d.ts.map +0 -1
  78. package/lib/types/helpers/Wrapper/utils.d.ts +0 -4
  79. package/lib/types/helpers/Wrapper/utils.d.ts.map +0 -1
  80. package/lib/types/helpers/index.d.ts +0 -4
  81. package/lib/types/helpers/index.d.ts.map +0 -1
  82. package/lib/types/index.d.ts +0 -18
  83. package/lib/types/index.d.ts.map +0 -1
  84. package/lib/types/types.d.ts +0 -51
  85. package/lib/types/types.d.ts.map +0 -1
  86. package/lib/types/utils.d.ts +0 -2
  87. package/lib/types/utils.d.ts.map +0 -1
package/lib/index.d.ts CHANGED
@@ -1,850 +1,835 @@
1
- import type { BreakpointKeys } from '@vitus-labs/core';
2
- import type { ComponentType } from 'react';
3
- import { config } from '@vitus-labs/core';
4
- import { Context } from './context';
5
- import { FC } from 'react';
6
- import type { ForwardedRef } from 'react';
7
- import type { ForwardRefExoticComponent } from 'react';
8
- import { HTMLTags } from '@vitus-labs/core';
9
- import type { HTMLTextTags } from '@vitus-labs/core';
10
- import type { PropsWithoutRef } from 'react';
11
- import { Provider } from '@vitus-labs/unistyle';
12
- import { ReactNode } from 'react';
13
- import type { RefAttributes } from 'react';
14
- import { RefObject } from 'react';
15
- import { render } from '@vitus-labs/core';
16
-
17
- declare type Align = 'bottom' | 'top' | 'left' | 'right';
18
-
19
- declare type Align_2 = 'bottom' | 'top' | 'left' | 'right';
20
-
21
- export declare type AlignX = ContentAlignX | ContentAlignX[] | Partial<Record<BreakpointKeys, ContentAlignX>>;
22
-
23
- declare type AlignX_2 = 'left' | 'center' | 'right';
24
-
25
- declare type AlignX_3 = 'left' | 'center' | 'right';
26
-
27
- export declare type AlignY = ContentAlignY | ContentAlignY[] | Partial<Record<BreakpointKeys, ContentAlignY>>;
28
-
29
- declare type AlignY_2 = 'bottom' | 'top' | 'center';
30
-
31
- declare type AlignY_3 = 'bottom' | 'top' | 'center';
32
-
33
- export declare type Content = Parameters<typeof render>['0'];
34
-
35
- declare type ContentAlignX = 'left' | 'center' | 'right' | 'spaceBetween' | 'spaceAround' | 'block';
36
-
37
- declare type ContentAlignY = 'top' | 'center' | 'bottom' | 'spaceBetween' | 'spaceAround' | 'block';
38
-
39
- export declare type ContentBoolean = boolean;
40
-
41
- declare type ContentDirection = 'inline' | 'rows' | 'reverseInline' | 'reverseRows';
42
-
43
- declare type ContentRenderer = (props: Partial<{
44
- active: boolean;
45
- showContent: () => void;
46
- hideContent: () => void;
47
- align: Align_2;
48
- alignX: AlignX_3;
49
- alignY: AlignY_3;
50
- }>) => ReactNode;
51
-
52
- declare type ContentSimpleValue = string | number;
53
-
54
- declare interface Context_2 {
55
- blocked: boolean;
56
- setBlocked: () => void;
57
- setUnblocked: () => void;
58
- }
59
-
60
- declare type Css = CssCallback | string;
61
-
62
- declare type CssCallback = (css: typeof config.css) => ReturnType<typeof css>;
63
-
64
- export declare type Direction = ContentDirection | ContentDirection[] | Partial<Record<BreakpointKeys, ContentDirection>>;
65
-
66
- declare const Element_2: VLElement;
67
- export { Element_2 as Element }
68
-
69
- export declare type ElementProps = Partial<{
70
- /**
71
- * Valid HTML Tag
72
- */
73
- tag: HTMLTags;
74
- /**
75
- * React `ref`, the prop is alternative to `ref` prop without need to wrap component to `forwardRef`
76
- */
77
- innerRef: InnerRef;
78
- /**
79
- * Valid React `children`
80
- */
81
- children: Content;
82
- /**
83
- * Alternative prop to React `children`
84
- * It is recommended to pass only one of `children`, `content` or `label` props
85
- *
86
- * The prioritization of rendering is following: `children` `content` → `label`
87
- */
88
- content: Content;
89
- /**
90
- * Alternative prop to React `children`
91
- * It is recommended to pass only one of `children`, `content` or `label` props
92
- *
93
- * The prioritization of rendering is following: `children` `content` → `label`
94
- */
95
- label: Content;
96
- /**
97
- * Valid React `children` to be rendered inside _beforeContent_ wrapper
98
- *
99
- * In a case, where at least one of `beforeContent` or `afterContent` is defined,
100
- * **Element** component will render additional inner wrapper helpers to
101
- * attach `beforeContent` **before** any of `children`, `context` or `label`
102
- * props.
103
- *
104
- * Together with prop `direction` can be the **Element** component aligned
105
- * vertically or horizontally.
106
- *
107
- * To attach any react node _after_, use `afterContent`
108
- */
109
- beforeContent: Content;
110
- /**
111
- * Valid React `children` to be rendered inside _afterContent_ wrapper
112
- *
113
- * In a case, where at least one of `beforeContent` or `afterContent` is defined,
114
- * **Element** component will render additional inner wrapper helpers to
115
- * attach `afterContent` **after** any of `children`, `context` or `label`
116
- * props.
117
- *
118
- * Together with prop `direction` can be the **Element** component aligned
119
- * vertically or horizontally.
120
- *
121
- * To attach any react node _before_, use `beforeContent`
122
- */
123
- afterContent: Content;
124
- /**
125
- * A boolean type to define whether **Element** should behave
126
- * as an inline or block element (`flex` vs. `inline-flex`)
127
- */
128
- block: ResponsiveBoolType;
129
- /**
130
- * A boolean type to define whether inner wrappers should be equal
131
- * (have the same width or height)
132
- */
133
- equalCols: ResponsiveBoolType;
134
- /**
135
- * Defines a `gap` spacing between inner wrappers between `beforeContent` and `children`
136
- * and `children` and `afterContent`
137
- */
138
- gap: Responsive;
139
- /**
140
- * Defines a `gap` spacing between inner wrappers between `beforeContent`,
141
- * `children` and `afterContent`
142
- */
143
- direction: Direction;
144
- /**
145
- * Defines flow of `children` elements within it's inner wrapper.
146
- *
147
- * Can be one of the following **flex** values `inline` | `rows` | `reverseInline` | `reverseRows`
148
- */
149
- contentDirection: Direction;
150
- /**
151
- * Defines flow of `beforeContent` elements within it's inner wrapper.
152
- *
153
- * Can be one of the following **flex** values `inline` | `rows` | `reverseInline` | `reverseRows`
154
- */
155
- beforeContentDirection: Direction;
156
- /**
157
- * Defines flow of `afterContent` elements within it's inner wrapper.
158
- *
159
- * Can be one of the following **flex** values `inline` | `rows` | `reverseInline` | `reverseRows`
160
- */
161
- afterContentDirection: Direction;
162
- /**
163
- * Define alignment of `beforeContent`, `content`, and `afterContent`
164
- * with respect to root element **horizontally**.
165
- *
166
- * Can be one of the following **flex** values `left` | `center` | `right` | `spaceBetween` |
167
- * `spaceAround` | `block`
168
- */
169
- alignX: AlignX;
170
- /**
171
- * Defines how `content` children (`children`, `content` or `label` props)
172
- * are aligned within it's inner wrapper **horizontally**.
173
- *
174
- * Can be one of the following **flex** values `left` | `center` | `right` | `spaceBetween` |
175
- * `spaceAround` | `block`
176
- */
177
- contentAlignX: AlignX;
178
- /**
179
- * Defines how `beforeContent` children are aligned within it's inner wrapper **horizontally**.
180
- *
181
- * Can be one of the following **flex** values `left` | `center` | `right` | `spaceBetween` |
182
- * `spaceAround` | `block`
183
- */
184
- beforeContentAlignX: AlignX;
185
- /**
186
- * Defines how `afterContent` children are aligned within it's inner wrapper **horizontally**.
187
- *
188
- * Can be one of the following **flex** values `left` | `center` | `right` | `spaceBetween` |
189
- * `spaceAround` | `block`
190
- */
191
- afterContentAlignX: AlignX;
192
- /**
193
- * Define alignment of `beforeContent`, `content`, and `afterContent`
194
- * with respect to root element **vertically**.
195
- *
196
- * Can be one of the following **flex** values `top` | `center` | `bottom` | `spaceBetween` |
197
- * `spaceAround` | `block`
198
- */
199
- alignY: AlignY;
200
- /**
201
- * Defines how `content` children (`children`, `content` or `label` props)
202
- * are aligned within it's inner wrapper **vertically**.
203
- *
204
- * Can be one of the following **flex** values `top` | `center` | `bottom` | `spaceBetween` |
205
- * `spaceAround` | `block`
206
- */
207
- contentAlignY: AlignY;
208
- /**
209
- * Defines how `beforeContent` children are aligned within it's inner wrapper **vertically**.
210
- *
211
- * Can be one of the following **flex** values `top` | `center` | `bottom` | `spaceBetween` |
212
- * `spaceAround` | `block`
213
- */
214
- beforeContentAlignY: AlignY;
215
- /**
216
- * Defines how `afterContent` children are aligned within it's inner wrapper **vertically**.
217
- *
218
- * Can be one of the following **flex** values `top` | `center` | `bottom` | `spaceBetween` |
219
- * `spaceAround` | `block`
220
- */
221
- afterContentAlignY: AlignY;
222
- /**
223
- * React `dangerouslySetInnerHTML` prop. For more details follow the link:
224
- *
225
- * https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml
226
- */
227
- dangerouslySetInnerHTML: {
228
- __html: string;
229
- };
230
- /**
231
- * An additional prop for extending styling of the **root** wrapper element
232
- *
233
- * #### [A] Template literals
234
- *
235
- * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
236
- *
237
- * ```jsx
238
- * export default () => (
239
- * <Element
240
- * label="This is an element"
241
- * css={`
242
- * text-color: red;
243
- * `}
244
- * />
245
- * )
246
- * ```
247
- *
248
- * #### [B] String
249
- *
250
- * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
251
- *
252
- * ```jsx
253
- * export default () => (
254
- * <Element
255
- * label="This is an element"
256
- * css="text-color: red;"
257
- * />
258
- * )
259
- * ```
260
- *
261
- * #### [C] Css Function
262
- *
263
- * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
264
- *
265
- * ```jsx
266
- * import { css } from 'styled-components'
267
- *
268
- * export default () => (
269
- * <Element
270
- * label="This is an element"
271
- * css={css`
272
- * text-color: red;
273
- * `}
274
- * />
275
- * )
276
- * ```
277
- *
278
- * #### [D] Css Callback
279
- *
280
- * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
281
- *
282
- * ```jsx
283
- * export default () => (
284
- * <Element
285
- * label="This is an element"
286
- * css={css => css`
287
- * text-color: red;
288
- * `}
289
- * />
290
- * )
291
- * ```
292
- */
293
- css: ExtendCss;
294
- /**
295
- * An additional prop for extending styling of the **content** wrapper element
296
- *
297
- * #### [A] Template literals
298
- *
299
- * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
300
- *
301
- * ```jsx
302
- * export default () => (
303
- * <Element
304
- * label="This is an element"
305
- * css={`
306
- * text-color: red;
307
- * `}
308
- * />
309
- * )
310
- * ```
311
- *
312
- * #### [B] String
313
- *
314
- * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
315
- *
316
- * ```jsx
317
- * export default () => (
318
- * <Element
319
- * label="This is an element"
320
- * css="text-color: red;"
321
- * />
322
- * )
323
- * ```
324
- *
325
- * #### [C] Css Function
326
- *
327
- * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
328
- *
329
- * ```jsx
330
- * import { css } from 'styled-components'
331
- *
332
- * export default () => (
333
- * <Element
334
- * label="This is an element"
335
- * css={css`
336
- * text-color: red;
337
- * `}
338
- * />
339
- * )
340
- * ```
341
- *
342
- * #### [D] Css Callback
343
- *
344
- * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
345
- *
346
- * ```jsx
347
- * export default () => (
348
- * <Element
349
- * label="This is an element"
350
- * css={css => css`
351
- * text-color: red;
352
- * `}
353
- * />
354
- * )
355
- * ```
356
- */
357
- contentCss: ExtendCss;
358
- /**
359
- * An additional prop for extending styling of the **beforeContent** wrapper element
360
- *
361
- * #### [A] Template literals
362
- *
363
- * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
364
- *
365
- * ```jsx
366
- * export default () => (
367
- * <Element
368
- * label="This is an element"
369
- * css={`
370
- * text-color: red;
371
- * `}
372
- * />
373
- * )
374
- * ```
375
- *
376
- * #### [B] String
377
- *
378
- * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
379
- *
380
- * ```jsx
381
- * export default () => (
382
- * <Element
383
- * label="This is an element"
384
- * css="text-color: red;"
385
- * />
386
- * )
387
- * ```
388
- *
389
- * #### [C] Css Function
390
- *
391
- * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
392
- *
393
- * ```jsx
394
- * import { css } from 'styled-components'
395
- *
396
- * export default () => (
397
- * <Element
398
- * label="This is an element"
399
- * css={css`
400
- * text-color: red;
401
- * `}
402
- * />
403
- * )
404
- * ```
405
- *
406
- * #### [D] Css Callback
407
- *
408
- * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
409
- *
410
- * ```jsx
411
- * export default () => (
412
- * <Element
413
- * label="This is an element"
414
- * css={css => css`
415
- * text-color: red;
416
- * `}
417
- * />
418
- * )
419
- * ```
420
- */
421
- beforeContentCss: ExtendCss;
422
- /**
423
- * An additional prop for extending styling of the **afterContent** wrapper element
424
- *
425
- * #### [A] Template literals
426
- *
427
- * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
428
- *
429
- * ```jsx
430
- * export default () => (
431
- * <Element
432
- * label="This is an element"
433
- * css={`
434
- * text-color: red;
435
- * `}
436
- * />
437
- * )
438
- * ```
439
- *
440
- * #### [B] String
441
- *
442
- * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
443
- *
444
- * ```jsx
445
- * export default () => (
446
- * <Element
447
- * label="This is an element"
448
- * css="text-color: red;"
449
- * />
450
- * )
451
- * ```
452
- *
453
- * #### [C] Css Function
454
- *
455
- * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
456
- *
457
- * ```jsx
458
- * import { css } from 'styled-components'
459
- *
460
- * export default () => (
461
- * <Element
462
- * label="This is an element"
463
- * css={css`
464
- * text-color: red;
465
- * `}
466
- * />
467
- * )
468
- * ```
469
- *
470
- * #### [D] Css Callback
471
- *
472
- * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
473
- *
474
- * ```jsx
475
- * export default () => (
476
- * <Element
477
- * label="This is an element"
478
- * css={css => css`
479
- * text-color: red;
480
- * `}
481
- * />
482
- * )
483
- * ```
484
- */
485
- afterContentCss: ExtendCss;
486
- }>;
487
-
488
- export declare type ElementType<T extends Record<string, unknown> = any> = ComponentType<T> | ForwardRefExoticComponent<T> | HTMLTags;
489
-
490
- export declare type ExtendCss = Css | Css[] | Partial<Record<BreakpointKeys, Css>>;
491
-
492
- export declare type ExtendedProps = {
493
- index: number;
494
- first: boolean;
495
- last: boolean;
496
- odd: boolean;
497
- even: boolean;
498
- position: number;
499
- };
500
-
501
- declare type ExtractNullableKeys<T> = {
502
- [P in keyof T as T[P] extends null | undefined ? never : P]: T[P];
503
- };
504
-
505
- declare type Id<T> = T extends infer U ? {
506
- [K in keyof U]: U[K];
507
- } : never;
508
-
509
- export declare type InnerRef = ForwardedRef<any>;
510
-
511
- export declare type IteratorProps = Partial<{
512
- /**
513
- * Valid React `children`
514
- */
515
- children: ReactNode;
516
- /**
517
- * Array of data passed to `component` prop
518
- */
519
- data: Array<SimpleValue | ObjectValue | MaybeNull>;
520
- /**
521
- * A React component to be rendered within list
522
- */
523
- component: ElementType;
524
- /**
525
- * Defines name of the prop to be passed to the iteration component
526
- * when **data** prop is type of `string[]`, `number[]` or combination
527
- * of both. Otherwise ignored.
528
- */
529
- valueName: string;
530
- /**
531
- * A React component to be rendered within list. `wrapComponent`
532
- * wraps `component`. Therefore it can be used to enhance the behavior
533
- * of the list component
534
- */
535
- wrapComponent: ElementType;
536
- /**
537
- * Extension of **item** `component` props to be passed
538
- */
539
- itemProps: PropsCallback;
540
- /**
541
- * Extension of **item** `wrapComponent` props to be passed
542
- */
543
- wrapProps?: PropsCallback;
544
- /**
545
- * Extension of **item** `wrapComponent` props to be passed
546
- */
547
- itemKey?: keyof ObjectValue | ((item: SimpleValue | Omit<ObjectValue, 'component'>, index: number) => SimpleValue);
548
- }>;
549
-
550
- declare type Key = string | number;
551
-
552
- export declare const List: VLElement<ListProps>;
553
-
554
- export declare type ListProps = MergeTypes<[IteratorProps, ListProps_2]>;
555
-
556
- declare type ListProps_2 = {
557
- /**
558
- * A boolean value. When set to `false`, component returns `React.Fragment`
559
- * When set to `true`, component returns as the **root** element `Element`
560
- * component.
561
- */
562
- rootElement?: boolean;
563
- /**
564
- * Label prop from `Element` component is being ignored.
565
- */
566
- label: never;
567
- /**
568
- * Content prop from `Element` component is being ignored.
569
- */
570
- content: never;
571
- };
572
-
573
- declare type MaybeNull = undefined | null;
574
-
575
- declare type MergeTypes<A extends readonly [...any]> = ExtractNullableKeys<Spread<A>>;
576
-
577
- export declare type ObjectValue = Partial<{
578
- id: SimpleValue;
579
- key: SimpleValue;
580
- itemId: SimpleValue;
581
- component: ElementType;
582
- }> & Record<string, unknown>;
583
-
584
- export declare const Overlay: VLComponent<OverlayProps>;
585
-
586
- export declare type OverlayProps = {
587
- /**
588
- * Children to be rendered within **Overlay** component when Overlay is active.
589
- */
590
- children: ContentRenderer | Content;
591
- /**
592
- * React component to be used as a trigger (e.g. `Button` for opening
593
- * dropdowns). Component must acept accept `ref` or any other prop name
594
- * defined in `triggerRefName` prop.
595
- */
596
- trigger: TriggerRenderer | Content;
597
- /**
598
- * Defines a HTML DOM where children to be appended. Component uses JavaScript
599
- * [`Node.appendChild`](https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild)
600
- *
601
- * For more information follow [Portal](https://vitus-labs.com/docs/ui-system/elements/portal)
602
- * component.
603
- */
604
- DOMLocation?: HTMLElement;
605
- /**
606
- * Defines a prop name to be used for passing `ref` for **trigger**. By default,
607
- * the value is `ref`.
608
- */
609
- triggerRefName?: string;
610
- /**
611
- * Defines a prop name to be used for passing `ref` for **content** (passed `children`).
612
- * By default, the value is `ref`.
613
- */
614
- contentRefName?: string;
615
- } & UseOverlayProps;
616
-
617
- export declare const OverlayProvider: FC<Context_2 & {
618
- children: ReactNode;
619
- }>;
620
-
621
- export declare const Portal: VLComponent<PortalProps>;
622
-
623
- export declare interface PortalProps {
624
- /**
625
- * Defines a HTML DOM where children to be appended. Component uses JavaScript
626
- * [`Node.appendChild`](https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild)
627
- */
628
- DOMLocation?: HTMLElement;
629
- /**
630
- * Children to be rendered within **Portal** component.
631
- */
632
- children: ReactNode;
633
- /**
634
- * Valid HTML Tag
635
- */
636
- tag?: string;
637
- }
638
-
639
- declare type Props = ElementProps & Partial<{
640
- equalBeforeAfter: boolean;
641
- }>;
642
-
643
- declare interface Props_2 {
644
- type?: 'single' | 'multi';
645
- activeItemRequired?: boolean;
646
- activeItems?: Key | (string | number)[];
647
- itemProps?: Record<string, unknown> | ((props: Record<string, unknown>) => Record<string, unknown>);
648
- }
649
-
650
- export declare type PropsCallback = TObj | ((itemProps: Record<string, never> | Record<string, SimpleValue> | ObjectValue, extendedProps: ExtendedProps) => TObj);
651
-
652
- export { Provider }
653
-
654
- export declare type Responsive = ContentSimpleValue | ContentSimpleValue[] | Partial<Record<BreakpointKeys, number | string>>;
655
-
656
- export declare type ResponsiveBoolType = ContentBoolean | ContentBoolean[] | Partial<Record<BreakpointKeys, ContentBoolean>>;
657
-
658
- declare type SimpleHoc<P extends Record<string, unknown> = {}> = (WrappedComponent: ComponentType<P>) => ComponentType<P>;
659
-
660
- declare type SimpleValue = string | number;
661
-
662
- declare type Spread<A extends readonly [...any]> = A extends [infer L, ...infer R] ? SpreadTwo<L, Spread<R>> : unknown;
663
-
664
- declare type SpreadTwo<L, R> = Id<Pick<L, Exclude<keyof L, keyof R>> & R>;
665
-
666
- declare const Text_2: VLForwardedComponent<TextProps> & {
667
- isText?: true;
668
- };
669
- export { Text_2 as Text }
670
-
671
- export declare type TextProps = Partial<{
672
- /**
673
- * Label can be used instead of children for inline syntax. But **children** prop takes a precedence
674
- */
675
- label: ReactNode;
676
- /**
677
- * Children to be rendered within **Text** component.
678
- */
679
- children: ReactNode;
680
- /**
681
- * Defines whether should behave as a block text element. Automatically adds **p** HTML tag
682
- */
683
- paragraph: boolean;
684
- /**
685
- * Defines what kind of HTML tag should be rendered
686
- */
687
- tag: HTMLTextTags;
688
- /**
689
- * If an additional styling needs to be added, it can be do so via injecting styles using this property.
690
- */
691
- css: ExtendCss;
692
- }>;
693
-
694
- declare type TObj = Record<string, unknown>;
695
-
696
- declare type TriggerRenderer = (props: Partial<{
697
- active: boolean;
698
- showContent: () => void;
699
- hideContent: () => void;
700
- }>) => ReactNode;
701
-
702
- export declare const useOverlay: ({ isOpen, openOn, closeOn, type, position, align, alignX, alignY, offsetX, offsetY, throttleDelay, parentContainer, closeOnEsc, disabled, onOpen, onClose, }?: Partial<UseOverlayProps>) => {
703
- triggerRef: RefObject<HTMLElement | null>;
704
- contentRef: (node: HTMLElement) => void;
705
- active: boolean;
706
- align: Align;
707
- alignX: "left" | "right" | "center";
708
- alignY: "bottom" | "top" | "center";
709
- showContent: () => void;
710
- hideContent: () => void;
711
- blocked: boolean;
712
- setBlocked: () => void;
713
- setUnblocked: () => void;
714
- Provider: FC<Context & {
715
- children: ReactNode;
716
- }>;
717
- };
718
-
719
- export declare type UseOverlayProps = Partial<{
720
- /**
721
- * Defines default state whether **Overlay** component should be active.
722
- * @defaultValue `false`
723
- */
724
- isOpen: boolean;
725
- /**
726
- * Defines `event` when **Overlay** is supposed to be open.
727
- *
728
- * When `manual` is set, callbacks needs to be applied to make it working.
729
- * @defaultValue `click`
730
- */
731
- openOn: 'click' | 'hover' | 'manual';
732
- /**
733
- * Defines `event` when **Overlay** is supposed to be closed.
734
- * @defaultValue `click`
735
- */
736
- closeOn: 'click' | 'clickOnTrigger' | 'clickOutsideContent' | 'hover' | 'manual';
737
- /**
738
- * Defines what type of **Overlay** will be created. Type `modal`
739
- * has different positioning calculations than others.
740
- * @defaultValue `dropdown`
741
- */
742
- type: 'dropdown' | 'tooltip' | 'popover' | 'modal' | 'custom';
743
- /**
744
- * Defines how `content` is treated regarding CSS positioning.
745
- * @defaultValue `fixed`
746
- */
747
- position: 'absolute' | 'fixed' | 'relative' | 'static';
748
- /**
749
- * Defines from which side is `content` aligned to `trigger` (top, left, bottom, right).
750
- * For more specific alignment configuration can be used `alignX` and/or `alignY` prop.
751
- * @defaultValue `bottom`
752
- */
753
- align: Align;
754
- /**
755
- * Defines how `content` is aligned to `trigger` on axis X
756
- * @defaultValue `left`
757
- */
758
- alignX: AlignX_2;
759
- /**
760
- * Defines how `content` is aligned to `trigger` on axis Y
761
- * @defaultValue `bottom`
762
- */
763
- alignY: AlignY_2;
764
- /**
765
- * Defines `margin` from trigger on axis X.
766
- * @defaultValue `0`
767
- */
768
- offsetX: number;
769
- /**
770
- * Defines `margin` from trigger on axis Y.
771
- * @defaultValue `0`
772
- */
773
- offsetY: number;
774
- /**
775
- * Performance helper. Value defined in milliseconds for `throttling`
776
- * recalculations
777
- * @defaultValue `200`
778
- */
779
- throttleDelay: number;
780
- /**
781
- * A valid HTML element. Prop can be used for ability to handle properly
782
- * scrolling inside custom scrollable HTML element.
783
- */
784
- parentContainer: HTMLElement | null;
785
- /**
786
- * Defines whether active **Overlay** is supposed to be closed on pressing
787
- * `ESC` key.
788
- * @defaultValue `true`
789
- */
790
- closeOnEsc: boolean;
791
- /**
792
- * When set to `true`, **Overlay** is automatically closed and is blocked for
793
- * being opened.
794
- */
795
- disabled: boolean;
796
- /**
797
- * A callback hook to be called when **Overlay** is being opened. Does not
798
- * accept any arguments.
799
- */
800
- onOpen: () => void;
801
- /**
802
- * A callback hook to be called when **Overlay** is being closed. Does not
803
- * accept any arguments.
804
- */
805
- onClose: () => void;
806
- }>;
807
-
808
- export declare const Util: VLComponent<UtilProps>;
809
-
810
- export declare interface UtilProps {
811
- /**
812
- * Children to be rendered within **Util** component.
813
- */
814
- children: ReactNode;
815
- /**
816
- * Class name(s) to be added to children component.
817
- */
818
- className?: string | string[];
819
- /**
820
- * Style property to extend children component inline styles
821
- */
822
- style?: Record<string, unknown>;
823
- }
824
-
825
- declare type VLComponent<P extends Record<string, any> = {}> = FC<P> & VLStatic;
826
-
827
- declare type VLElement<P extends Record<string, unknown> = {}> = ForwardRefExoticComponent<PropsWithoutRef<ElementProps & P> & RefAttributes<any>> & VLStatic;
828
-
829
- declare type VLForwardedComponent<P extends Record<string, unknown> = {}> = ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<any>> & VLStatic;
830
-
831
- declare interface VLStatic {
832
- /**
833
- * React displayName
834
- */
835
- displayName?: string | undefined;
836
- /**
837
- * package name
838
- */
839
- pkgName?: string;
840
- /**
841
- * component name
842
- */
843
- VITUS_LABS__COMPONENT?: `@vitus-labs/${string}`;
844
- }
845
-
846
- export declare const withActiveState: SimpleHoc<Props_2>;
847
-
848
- export declare const withEqualSizeBeforeAfter: SimpleHoc<Props>;
849
-
850
- export { }
1
+ import { Provider } from "@vitus-labs/unistyle";
2
+ import { BreakpointKeys, HTMLTags, HTMLTextTags, config, render } from "@vitus-labs/core";
3
+ import * as react0 from "react";
4
+ import { ComponentType, FC, ForwardRefExoticComponent, ForwardedRef, PropsWithoutRef, ReactNode, Ref, RefAttributes } from "react";
5
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
6
+
7
+ //#region src/types.d.ts
8
+
9
+ type ExtractNullableKeys<T> = { [P in keyof T as T[P] extends null | undefined ? never : P]: T[P] };
10
+ type Id<T> = T extends infer U ? { [K in keyof U]: U[K] } : never;
11
+ type SpreadTwo<L, R> = Id<Pick<L, Exclude<keyof L, keyof R>> & R>;
12
+ type Spread<A extends readonly [...any]> = A extends [infer L, ...infer R] ? SpreadTwo<L, Spread<R>> : unknown;
13
+ type MergeTypes<A extends readonly [...any]> = ExtractNullableKeys<Spread<A>>;
14
+ type SimpleHoc<P extends Record<string, unknown> = {}> = (WrappedComponent: ComponentType<P>) => ComponentType<P>;
15
+ type InnerRef = ForwardedRef<any>;
16
+ type CssCallback = (css: typeof config.css) => ReturnType<typeof css>;
17
+ type Css = CssCallback | ReturnType<typeof config.css> | string;
18
+ type Content = Parameters<typeof render>['0'];
19
+ type ContentAlignX = 'left' | 'center' | 'right' | 'spaceBetween' | 'spaceAround' | 'block';
20
+ type ContentAlignY = 'top' | 'center' | 'bottom' | 'spaceBetween' | 'spaceAround' | 'block';
21
+ type ContentDirection = 'inline' | 'rows' | 'reverseInline' | 'reverseRows';
22
+ type ContentBoolean = boolean;
23
+ type ContentSimpleValue = string | number;
24
+ type AlignY = ContentAlignY | ContentAlignY[] | Partial<Record<BreakpointKeys, ContentAlignY>>;
25
+ type AlignX = ContentAlignX | ContentAlignX[] | Partial<Record<BreakpointKeys, ContentAlignX>>;
26
+ type Direction = ContentDirection | ContentDirection[] | Partial<Record<BreakpointKeys, ContentDirection>>;
27
+ type ResponsiveBoolType = ContentBoolean | ContentBoolean[] | Partial<Record<BreakpointKeys, ContentBoolean>>;
28
+ type Responsive = ContentSimpleValue | ContentSimpleValue[] | Partial<Record<BreakpointKeys, number | string>>;
29
+ type ExtendCss = Css | Css[] | Partial<Record<BreakpointKeys, Css>>;
30
+ type VLForwardedComponent<P extends Record<string, unknown> = {}> = ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<any>> & VLStatic;
31
+ type VLComponent<P extends Record<string, any> = {}> = FC<P> & VLStatic;
32
+ interface VLStatic {
33
+ /**
34
+ * React displayName
35
+ */
36
+ displayName?: string | undefined;
37
+ /**
38
+ * package name
39
+ */
40
+ pkgName?: string;
41
+ /**
42
+ * component name
43
+ */
44
+ VITUS_LABS__COMPONENT?: `@vitus-labs/${string}`;
45
+ }
46
+ //#endregion
47
+ //#region src/Element/types.d.ts
48
+ type Props = Partial<{
49
+ /**
50
+ * Valid HTML Tag
51
+ */
52
+ tag: HTMLTags;
53
+ /**
54
+ * React `ref`, the prop is alternative to `ref` prop without need to wrap component to `forwardRef`
55
+ */
56
+ innerRef: InnerRef;
57
+ /**
58
+ * Valid React `children`
59
+ */
60
+ children: Content;
61
+ /**
62
+ * Alternative prop to React `children`
63
+ * It is recommended to pass only one of `children`, `content` or `label` props
64
+ *
65
+ * The prioritization of rendering is following: `children` → `content` → `label`
66
+ */
67
+ content: Content;
68
+ /**
69
+ * Alternative prop to React `children`
70
+ * It is recommended to pass only one of `children`, `content` or `label` props
71
+ *
72
+ * The prioritization of rendering is following: `children` → `content` → `label`
73
+ */
74
+ label: Content;
75
+ /**
76
+ * Valid React `children` to be rendered inside _beforeContent_ wrapper
77
+ *
78
+ * In a case, where at least one of `beforeContent` or `afterContent` is defined,
79
+ * **Element** component will render additional inner wrapper helpers to
80
+ * attach `beforeContent` **before** any of `children`, `context` or `label`
81
+ * props.
82
+ *
83
+ * Together with prop `direction` can be the **Element** component aligned
84
+ * vertically or horizontally.
85
+ *
86
+ * To attach any react node _after_, use `afterContent`
87
+ */
88
+ beforeContent: Content;
89
+ /**
90
+ * Valid React `children` to be rendered inside _afterContent_ wrapper
91
+ *
92
+ * In a case, where at least one of `beforeContent` or `afterContent` is defined,
93
+ * **Element** component will render additional inner wrapper helpers to
94
+ * attach `afterContent` **after** any of `children`, `context` or `label`
95
+ * props.
96
+ *
97
+ * Together with prop `direction` can be the **Element** component aligned
98
+ * vertically or horizontally.
99
+ *
100
+ * To attach any react node _before_, use `beforeContent`
101
+ */
102
+ afterContent: Content;
103
+ /**
104
+ * A boolean type to define whether **Element** should behave
105
+ * as an inline or block element (`flex` vs. `inline-flex`)
106
+ */
107
+ block: ResponsiveBoolType;
108
+ /**
109
+ * A boolean type to define whether inner wrappers should be equal
110
+ * (have the same width or height)
111
+ */
112
+ equalCols: ResponsiveBoolType;
113
+ /**
114
+ * Defines a `gap` spacing between inner wrappers between `beforeContent` and `children`
115
+ * and `children` and `afterContent`
116
+ */
117
+ gap: Responsive;
118
+ /**
119
+ * Defines a `gap` spacing between inner wrappers between `beforeContent`,
120
+ * `children` and `afterContent`
121
+ */
122
+ direction: Direction;
123
+ /**
124
+ * Defines flow of `children` elements within it's inner wrapper.
125
+ *
126
+ * Can be one of the following **flex** values `inline` | `rows` | `reverseInline` | `reverseRows`
127
+ */
128
+ contentDirection: Direction;
129
+ /**
130
+ * Defines flow of `beforeContent` elements within it's inner wrapper.
131
+ *
132
+ * Can be one of the following **flex** values `inline` | `rows` | `reverseInline` | `reverseRows`
133
+ */
134
+ beforeContentDirection: Direction;
135
+ /**
136
+ * Defines flow of `afterContent` elements within it's inner wrapper.
137
+ *
138
+ * Can be one of the following **flex** values `inline` | `rows` | `reverseInline` | `reverseRows`
139
+ */
140
+ afterContentDirection: Direction;
141
+ /**
142
+ * Define alignment of `beforeContent`, `content`, and `afterContent`
143
+ * with respect to root element **horizontally**.
144
+ *
145
+ * Can be one of the following **flex** values `left` | `center` | `right` | `spaceBetween` |
146
+ * `spaceAround` | `block`
147
+ */
148
+ alignX: AlignX;
149
+ /**
150
+ * Defines how `content` children (`children`, `content` or `label` props)
151
+ * are aligned within it's inner wrapper **horizontally**.
152
+ *
153
+ * Can be one of the following **flex** values `left` | `center` | `right` | `spaceBetween` |
154
+ * `spaceAround` | `block`
155
+ */
156
+ contentAlignX: AlignX;
157
+ /**
158
+ * Defines how `beforeContent` children are aligned within it's inner wrapper **horizontally**.
159
+ *
160
+ * Can be one of the following **flex** values `left` | `center` | `right` | `spaceBetween` |
161
+ * `spaceAround` | `block`
162
+ */
163
+ beforeContentAlignX: AlignX;
164
+ /**
165
+ * Defines how `afterContent` children are aligned within it's inner wrapper **horizontally**.
166
+ *
167
+ * Can be one of the following **flex** values `left` | `center` | `right` | `spaceBetween` |
168
+ * `spaceAround` | `block`
169
+ */
170
+ afterContentAlignX: AlignX;
171
+ /**
172
+ * Define alignment of `beforeContent`, `content`, and `afterContent`
173
+ * with respect to root element **vertically**.
174
+ *
175
+ * Can be one of the following **flex** values `top` | `center` | `bottom` | `spaceBetween` |
176
+ * `spaceAround` | `block`
177
+ */
178
+ alignY: AlignY;
179
+ /**
180
+ * Defines how `content` children (`children`, `content` or `label` props)
181
+ * are aligned within it's inner wrapper **vertically**.
182
+ *
183
+ * Can be one of the following **flex** values `top` | `center` | `bottom` | `spaceBetween` |
184
+ * `spaceAround` | `block`
185
+ */
186
+ contentAlignY: AlignY;
187
+ /**
188
+ * Defines how `beforeContent` children are aligned within it's inner wrapper **vertically**.
189
+ *
190
+ * Can be one of the following **flex** values `top` | `center` | `bottom` | `spaceBetween` |
191
+ * `spaceAround` | `block`
192
+ */
193
+ beforeContentAlignY: AlignY;
194
+ /**
195
+ * Defines how `afterContent` children are aligned within it's inner wrapper **vertically**.
196
+ *
197
+ * Can be one of the following **flex** values `top` | `center` | `bottom` | `spaceBetween` |
198
+ * `spaceAround` | `block`
199
+ */
200
+ afterContentAlignY: AlignY;
201
+ /**
202
+ * React `dangerouslySetInnerHTML` prop. For more details follow the link:
203
+ *
204
+ * https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml
205
+ */
206
+ dangerouslySetInnerHTML: {
207
+ __html: string;
208
+ };
209
+ /**
210
+ * An additional prop for extending styling of the **root** wrapper element
211
+ *
212
+ * #### [A] Template literals
213
+ *
214
+ * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
215
+ *
216
+ * ```jsx
217
+ * export default () => (
218
+ * <Element
219
+ * label="This is an element"
220
+ * css={`
221
+ * text-color: red;
222
+ * `}
223
+ * />
224
+ * )
225
+ * ```
226
+ *
227
+ * #### [B] String
228
+ *
229
+ * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
230
+ *
231
+ * ```jsx
232
+ * export default () => (
233
+ * <Element
234
+ * label="This is an element"
235
+ * css="text-color: red;"
236
+ * />
237
+ * )
238
+ * ```
239
+ *
240
+ * #### [C] Css Function
241
+ *
242
+ * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
243
+ *
244
+ * ```jsx
245
+ * import { css } from 'styled-components'
246
+ *
247
+ * export default () => (
248
+ * <Element
249
+ * label="This is an element"
250
+ * css={css`
251
+ * text-color: red;
252
+ * `}
253
+ * />
254
+ * )
255
+ * ```
256
+ *
257
+ * #### [D] Css Callback
258
+ *
259
+ * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
260
+ *
261
+ * ```jsx
262
+ * export default () => (
263
+ * <Element
264
+ * label="This is an element"
265
+ * css={css => css`
266
+ * text-color: red;
267
+ * `}
268
+ * />
269
+ * )
270
+ * ```
271
+ */
272
+ css: ExtendCss;
273
+ /**
274
+ * An additional prop for extending styling of the **content** wrapper element
275
+ *
276
+ * #### [A] Template literals
277
+ *
278
+ * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
279
+ *
280
+ * ```jsx
281
+ * export default () => (
282
+ * <Element
283
+ * label="This is an element"
284
+ * css={`
285
+ * text-color: red;
286
+ * `}
287
+ * />
288
+ * )
289
+ * ```
290
+ *
291
+ * #### [B] String
292
+ *
293
+ * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
294
+ *
295
+ * ```jsx
296
+ * export default () => (
297
+ * <Element
298
+ * label="This is an element"
299
+ * css="text-color: red;"
300
+ * />
301
+ * )
302
+ * ```
303
+ *
304
+ * #### [C] Css Function
305
+ *
306
+ * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
307
+ *
308
+ * ```jsx
309
+ * import { css } from 'styled-components'
310
+ *
311
+ * export default () => (
312
+ * <Element
313
+ * label="This is an element"
314
+ * css={css`
315
+ * text-color: red;
316
+ * `}
317
+ * />
318
+ * )
319
+ * ```
320
+ *
321
+ * #### [D] Css Callback
322
+ *
323
+ * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
324
+ *
325
+ * ```jsx
326
+ * export default () => (
327
+ * <Element
328
+ * label="This is an element"
329
+ * css={css => css`
330
+ * text-color: red;
331
+ * `}
332
+ * />
333
+ * )
334
+ * ```
335
+ */
336
+ contentCss: ExtendCss;
337
+ /**
338
+ * An additional prop for extending styling of the **beforeContent** wrapper element
339
+ *
340
+ * #### [A] Template literals
341
+ *
342
+ * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
343
+ *
344
+ * ```jsx
345
+ * export default () => (
346
+ * <Element
347
+ * label="This is an element"
348
+ * css={`
349
+ * text-color: red;
350
+ * `}
351
+ * />
352
+ * )
353
+ * ```
354
+ *
355
+ * #### [B] String
356
+ *
357
+ * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
358
+ *
359
+ * ```jsx
360
+ * export default () => (
361
+ * <Element
362
+ * label="This is an element"
363
+ * css="text-color: red;"
364
+ * />
365
+ * )
366
+ * ```
367
+ *
368
+ * #### [C] Css Function
369
+ *
370
+ * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
371
+ *
372
+ * ```jsx
373
+ * import { css } from 'styled-components'
374
+ *
375
+ * export default () => (
376
+ * <Element
377
+ * label="This is an element"
378
+ * css={css`
379
+ * text-color: red;
380
+ * `}
381
+ * />
382
+ * )
383
+ * ```
384
+ *
385
+ * #### [D] Css Callback
386
+ *
387
+ * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
388
+ *
389
+ * ```jsx
390
+ * export default () => (
391
+ * <Element
392
+ * label="This is an element"
393
+ * css={css => css`
394
+ * text-color: red;
395
+ * `}
396
+ * />
397
+ * )
398
+ * ```
399
+ */
400
+ beforeContentCss: ExtendCss;
401
+ /**
402
+ * An additional prop for extending styling of the **afterContent** wrapper element
403
+ *
404
+ * #### [A] Template literals
405
+ *
406
+ * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
407
+ *
408
+ * ```jsx
409
+ * export default () => (
410
+ * <Element
411
+ * label="This is an element"
412
+ * css={`
413
+ * text-color: red;
414
+ * `}
415
+ * />
416
+ * )
417
+ * ```
418
+ *
419
+ * #### [B] String
420
+ *
421
+ * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
422
+ *
423
+ * ```jsx
424
+ * export default () => (
425
+ * <Element
426
+ * label="This is an element"
427
+ * css="text-color: red;"
428
+ * />
429
+ * )
430
+ * ```
431
+ *
432
+ * #### [C] Css Function
433
+ *
434
+ * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
435
+ *
436
+ * ```jsx
437
+ * import { css } from 'styled-components'
438
+ *
439
+ * export default () => (
440
+ * <Element
441
+ * label="This is an element"
442
+ * css={css`
443
+ * text-color: red;
444
+ * `}
445
+ * />
446
+ * )
447
+ * ```
448
+ *
449
+ * #### [D] Css Callback
450
+ *
451
+ * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)
452
+ *
453
+ * ```jsx
454
+ * export default () => (
455
+ * <Element
456
+ * label="This is an element"
457
+ * css={css => css`
458
+ * text-color: red;
459
+ * `}
460
+ * />
461
+ * )
462
+ * ```
463
+ */
464
+ afterContentCss: ExtendCss;
465
+ }>;
466
+ type VLElement<P extends Record<string, unknown> = {}> = ForwardRefExoticComponent<PropsWithoutRef<Props & P> & RefAttributes<any>> & VLStatic;
467
+ //# sourceMappingURL=types.d.ts.map
468
+ //#endregion
469
+ //#region src/Element/component.d.ts
470
+ declare const Component: VLElement;
471
+ //#endregion
472
+ //#region src/Element/withEqualSizeBeforeAfter.d.ts
473
+ type Props$8 = Props & Partial<{
474
+ equalBeforeAfter: boolean;
475
+ ref: Ref<HTMLElement>;
476
+ }>;
477
+ declare const withEqualBeforeAfter: (WrappedComponent: any) => {
478
+ ({
479
+ equalBeforeAfter,
480
+ direction,
481
+ afterContent,
482
+ beforeContent,
483
+ ref,
484
+ ...rest
485
+ }: Props$8): react_jsx_runtime0.JSX.Element;
486
+ displayName: string;
487
+ };
488
+ //#endregion
489
+ //#region src/helpers/Iterator/types.d.ts
490
+ type MaybeNull = undefined | null;
491
+ type TObj = Record<string, unknown>;
492
+ type SimpleValue = string | number;
493
+ type ObjectValue = Partial<{
494
+ id: SimpleValue;
495
+ key: SimpleValue;
496
+ itemId: SimpleValue;
497
+ component: ElementType;
498
+ }> & Record<string, unknown>;
499
+ type ElementType<T extends Record<string, unknown> = any> = ComponentType<T> | ForwardRefExoticComponent<T> | HTMLTags;
500
+ type ExtendedProps = {
501
+ index: number;
502
+ first: boolean;
503
+ last: boolean;
504
+ odd: boolean;
505
+ even: boolean;
506
+ position: number;
507
+ };
508
+ type PropsCallback = TObj | ((itemProps: Record<string, never> | Record<string, SimpleValue> | ObjectValue, extendedProps: ExtendedProps) => TObj);
509
+ type Props$1 = Partial<{
510
+ /**
511
+ * Valid React `children`
512
+ */
513
+ children: ReactNode;
514
+ /**
515
+ * Array of data passed to `component` prop
516
+ */
517
+ data: Array<SimpleValue | ObjectValue | MaybeNull>;
518
+ /**
519
+ * A React component to be rendered within list
520
+ */
521
+ component: ElementType;
522
+ /**
523
+ * Defines name of the prop to be passed to the iteration component
524
+ * when **data** prop is type of `string[]`, `number[]` or combination
525
+ * of both. Otherwise ignored.
526
+ */
527
+ valueName: string;
528
+ /**
529
+ * A React component to be rendered within list. `wrapComponent`
530
+ * wraps `component`. Therefore it can be used to enhance the behavior
531
+ * of the list component
532
+ */
533
+ wrapComponent: ElementType;
534
+ /**
535
+ * Extension of **item** `component` props to be passed
536
+ */
537
+ itemProps: PropsCallback;
538
+ /**
539
+ * Extension of **item** `wrapComponent` props to be passed
540
+ */
541
+ wrapProps?: PropsCallback;
542
+ /**
543
+ * Extension of **item** `wrapComponent` props to be passed
544
+ */
545
+ itemKey?: keyof ObjectValue | ((item: SimpleValue | Omit<ObjectValue, 'component'>, index: number) => SimpleValue);
546
+ }>;
547
+ //# sourceMappingURL=types.d.ts.map
548
+ //#endregion
549
+ //#region src/List/component.d.ts
550
+ type ListProps = {
551
+ /**
552
+ * A boolean value. When set to `false`, component returns `React.Fragment`
553
+ * When set to `true`, component returns as the **root** element `Element`
554
+ * component.
555
+ */
556
+ rootElement?: boolean;
557
+ /**
558
+ * Label prop from `Element` component is being ignored.
559
+ */
560
+ label: never;
561
+ /**
562
+ * Content prop from `Element` component is being ignored.
563
+ */
564
+ content: never;
565
+ };
566
+ type Props$2 = MergeTypes<[Props$1, ListProps]>;
567
+ declare const Component$1: VLElement<Props$2>;
568
+ //#endregion
569
+ //#region src/List/withActiveState.d.ts
570
+ type Key = string | number;
571
+ interface Props$7 {
572
+ type?: 'single' | 'multi';
573
+ activeItemRequired?: boolean;
574
+ activeItems?: Key | (string | number)[];
575
+ itemProps?: Record<string, unknown> | ((props: Record<string, unknown>) => Record<string, unknown>);
576
+ }
577
+ declare const component: SimpleHoc<Props$7>;
578
+ //#endregion
579
+ //#region src/Overlay/context.d.ts
580
+ interface Context {
581
+ blocked: boolean;
582
+ setBlocked: () => void;
583
+ setUnblocked: () => void;
584
+ }
585
+ declare const Component$3: FC<Context & {
586
+ children: ReactNode;
587
+ }>;
588
+ //#endregion
589
+ //#region src/Overlay/useOverlay.d.ts
590
+ /**
591
+ * Core hook powering the Overlay component. Manages open/close state, DOM
592
+ * event listeners (click, hover, scroll, resize, ESC key), and dynamic
593
+ * positioning of overlay content relative to its trigger. Supports dropdown,
594
+ * tooltip, popover, and modal types with automatic edge-of-viewport flipping.
595
+ * Event handlers are throttled for performance, and nested overlay blocking
596
+ * is coordinated through the overlay context.
597
+ */
598
+ type Align$1 = 'bottom' | 'top' | 'left' | 'right';
599
+ type AlignX$2 = 'left' | 'center' | 'right';
600
+ type AlignY$2 = 'bottom' | 'top' | 'center';
601
+ type UseOverlayProps = Partial<{
602
+ /**
603
+ * Defines default state whether **Overlay** component should be active.
604
+ * @defaultValue `false`
605
+ */
606
+ isOpen: boolean;
607
+ /**
608
+ * Defines `event` when **Overlay** is supposed to be open.
609
+ *
610
+ * When `manual` is set, callbacks needs to be applied to make it working.
611
+ * @defaultValue `click`
612
+ */
613
+ openOn: 'click' | 'hover' | 'manual';
614
+ /**
615
+ * Defines `event` when **Overlay** is supposed to be closed.
616
+ * @defaultValue `click`
617
+ */
618
+ closeOn: 'click' | 'clickOnTrigger' | 'clickOutsideContent' | 'hover' | 'manual';
619
+ /**
620
+ * Defines what type of **Overlay** will be created. Type `modal`
621
+ * has different positioning calculations than others.
622
+ * @defaultValue `dropdown`
623
+ */
624
+ type: 'dropdown' | 'tooltip' | 'popover' | 'modal' | 'custom';
625
+ /**
626
+ * Defines how `content` is treated regarding CSS positioning.
627
+ * @defaultValue `fixed`
628
+ */
629
+ position: 'absolute' | 'fixed' | 'relative' | 'static';
630
+ /**
631
+ * Defines from which side is `content` aligned to `trigger` (top, left, bottom, right).
632
+ * For more specific alignment configuration can be used `alignX` and/or `alignY` prop.
633
+ * @defaultValue `bottom`
634
+ */
635
+ align: Align$1;
636
+ /**
637
+ * Defines how `content` is aligned to `trigger` on axis X
638
+ * @defaultValue `left`
639
+ */
640
+ alignX: AlignX$2;
641
+ /**
642
+ * Defines how `content` is aligned to `trigger` on axis Y
643
+ * @defaultValue `bottom`
644
+ */
645
+ alignY: AlignY$2;
646
+ /**
647
+ * Defines `margin` from trigger on axis X.
648
+ * @defaultValue `0`
649
+ */
650
+ offsetX: number;
651
+ /**
652
+ * Defines `margin` from trigger on axis Y.
653
+ * @defaultValue `0`
654
+ */
655
+ offsetY: number;
656
+ /**
657
+ * Performance helper. Value defined in milliseconds for `throttling`
658
+ * recalculations
659
+ * @defaultValue `200`
660
+ */
661
+ throttleDelay: number;
662
+ /**
663
+ * A valid HTML element. Prop can be used for ability to handle properly
664
+ * scrolling inside custom scrollable HTML element.
665
+ */
666
+ parentContainer: HTMLElement | null;
667
+ /**
668
+ * Defines whether active **Overlay** is supposed to be closed on pressing
669
+ * `ESC` key.
670
+ * @defaultValue `true`
671
+ */
672
+ closeOnEsc: boolean;
673
+ /**
674
+ * When set to `true`, **Overlay** is automatically closed and is blocked for
675
+ * being opened.
676
+ */
677
+ disabled: boolean;
678
+ /**
679
+ * A callback hook to be called when **Overlay** is being opened. Does not
680
+ * accept any arguments.
681
+ */
682
+ onOpen: () => void;
683
+ /**
684
+ * A callback hook to be called when **Overlay** is being closed. Does not
685
+ * accept any arguments.
686
+ */
687
+ onClose: () => void;
688
+ }>;
689
+ declare const useOverlay: ({
690
+ isOpen,
691
+ openOn,
692
+ closeOn,
693
+ type,
694
+ position,
695
+ align,
696
+ alignX,
697
+ alignY,
698
+ offsetX,
699
+ offsetY,
700
+ throttleDelay,
701
+ parentContainer,
702
+ closeOnEsc,
703
+ disabled,
704
+ onOpen,
705
+ onClose
706
+ }?: Partial<UseOverlayProps>) => {
707
+ triggerRef: react0.RefObject<HTMLElement | null>;
708
+ contentRef: (node: HTMLElement) => void;
709
+ active: boolean;
710
+ align: Align$1;
711
+ alignX: "left" | "right" | "center";
712
+ alignY: "bottom" | "top" | "center";
713
+ showContent: () => void;
714
+ hideContent: () => void;
715
+ blocked: boolean;
716
+ setBlocked: () => void;
717
+ setUnblocked: () => void;
718
+ Provider: react0.FC<Context & {
719
+ children: react0.ReactNode;
720
+ }>;
721
+ };
722
+ //#endregion
723
+ //#region src/Overlay/component.d.ts
724
+ type Align = 'bottom' | 'top' | 'left' | 'right';
725
+ type AlignX$1 = 'left' | 'center' | 'right';
726
+ type AlignY$1 = 'bottom' | 'top' | 'center';
727
+ type TriggerRenderer = (props: Partial<{
728
+ active: boolean;
729
+ showContent: () => void;
730
+ hideContent: () => void;
731
+ }>) => ReactNode;
732
+ type ContentRenderer = (props: Partial<{
733
+ active: boolean;
734
+ showContent: () => void;
735
+ hideContent: () => void;
736
+ align: Align;
737
+ alignX: AlignX$1;
738
+ alignY: AlignY$1;
739
+ }>) => ReactNode;
740
+ type Props$3 = {
741
+ /**
742
+ * Children to be rendered within **Overlay** component when Overlay is active.
743
+ */
744
+ children: ContentRenderer | Content;
745
+ /**
746
+ * React component to be used as a trigger (e.g. `Button` for opening
747
+ * dropdowns). Component must acept accept `ref` or any other prop name
748
+ * defined in `triggerRefName` prop.
749
+ */
750
+ trigger: TriggerRenderer | Content;
751
+ /**
752
+ * Defines a HTML DOM where children to be appended. Component uses JavaScript
753
+ * [`Node.appendChild`](https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild)
754
+ *
755
+ * For more information follow [Portal](https://vitus-labs.com/docs/ui-system/elements/portal)
756
+ * component.
757
+ */
758
+ DOMLocation?: HTMLElement;
759
+ /**
760
+ * Defines a prop name to be used for passing `ref` for **trigger**. By default,
761
+ * the value is `ref`.
762
+ */
763
+ triggerRefName?: string;
764
+ /**
765
+ * Defines a prop name to be used for passing `ref` for **content** (passed `children`).
766
+ * By default, the value is `ref`.
767
+ */
768
+ contentRefName?: string;
769
+ } & UseOverlayProps;
770
+ declare const Component$2: VLComponent<Props$3>;
771
+ //#endregion
772
+ //#region src/Portal/component.d.ts
773
+ interface Props$4 {
774
+ /**
775
+ * Defines a HTML DOM where children to be appended. Component uses JavaScript
776
+ * [`Node.appendChild`](https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild)
777
+ */
778
+ DOMLocation?: HTMLElement;
779
+ /**
780
+ * Children to be rendered within **Portal** component.
781
+ */
782
+ children: ReactNode;
783
+ /**
784
+ * Valid HTML Tag
785
+ */
786
+ tag?: string;
787
+ }
788
+ declare const Component$4: VLComponent<Props$4>;
789
+ //#endregion
790
+ //#region src/Text/component.d.ts
791
+ type Props$5 = Partial<{
792
+ /**
793
+ * Label can be used instead of children for inline syntax. But **children** prop takes a precedence
794
+ */
795
+ label: ReactNode;
796
+ /**
797
+ * Children to be rendered within **Text** component.
798
+ */
799
+ children: ReactNode;
800
+ /**
801
+ * Defines whether should behave as a block text element. Automatically adds **p** HTML tag
802
+ */
803
+ paragraph: boolean;
804
+ /**
805
+ * Defines what kind of HTML tag should be rendered
806
+ */
807
+ tag: HTMLTextTags;
808
+ /**
809
+ * If an additional styling needs to be added, it can be do so via injecting styles using this property.
810
+ */
811
+ css: ExtendCss;
812
+ }>;
813
+ declare const Component$5: VLForwardedComponent<Props$5> & {
814
+ isText?: true;
815
+ };
816
+ //#endregion
817
+ //#region src/Util/component.d.ts
818
+ interface Props$6 {
819
+ /**
820
+ * Children to be rendered within **Util** component.
821
+ */
822
+ children: ReactNode;
823
+ /**
824
+ * Class name(s) to be added to children component.
825
+ */
826
+ className?: string | string[];
827
+ /**
828
+ * Style property to extend children component inline styles
829
+ */
830
+ style?: Record<string, unknown>;
831
+ }
832
+ declare const Component$6: VLComponent<Props$6>;
833
+ //#endregion
834
+ export { type AlignX, type AlignY, type Content, type ContentBoolean, type Direction, Component as Element, type Props as ElementProps, type ElementType, type ExtendCss, type ExtendedProps, type InnerRef, type Props$1 as IteratorProps, Component$1 as List, type Props$2 as ListProps, type ObjectValue, Component$2 as Overlay, type Props$3 as OverlayProps, Component$3 as OverlayProvider, Component$4 as Portal, type Props$4 as PortalProps, type PropsCallback, Provider, type Responsive, type ResponsiveBoolType, Component$5 as Text, type Props$5 as TextProps, type UseOverlayProps, Component$6 as Util, type Props$6 as UtilProps, type VLStatic, useOverlay, component as withActiveState, withEqualBeforeAfter as withEqualSizeBeforeAfter };
835
+ //# sourceMappingURL=index.d.d.ts.map