@vacano/ui 1.9.0 → 1.10.0

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.
package/dist/index.d.ts CHANGED
@@ -9,6 +9,8 @@ import { ReactPortal } from 'react';
9
9
  import { Ref } from 'react';
10
10
  import { TextareaHTMLAttributes } from 'react';
11
11
 
12
+ export declare const alpha: (hexColor: string, percentage: number) => string;
13
+
12
14
  export declare const Autocomplete: ({ className, classnames, disabled, fullWidth, label, ref, size, variant, value, onChange, onSearch, debounceMs, minChars, noResultsMessage, ...rest }: AutocompleteProps) => JSX.Element;
13
15
 
14
16
  export declare type AutocompleteClassNames = {
@@ -44,6 +46,18 @@ export declare type AutocompleteValue = {
44
46
 
45
47
  export declare type AutocompleteVariant = 'normal' | 'error';
46
48
 
49
+ declare type Breakpoint = keyof typeof BREAKPOINTS;
50
+
51
+ export declare const BREAKPOINTS: {
52
+ readonly sm: 640;
53
+ readonly md: 768;
54
+ readonly lg: 1024;
55
+ readonly xl: 1280;
56
+ readonly '2xl': 1536;
57
+ };
58
+
59
+ export declare type Browser = 'chrome' | 'firefox' | 'safari' | 'edge' | 'opera' | 'unknown';
60
+
47
61
  export declare const Button: ({ children, className, classnames, disabled, fullWidth, icon, loading, onClick, ref, keyBindings, size, type, variant, ...rest }: ButtonProps) => JSX.Element;
48
62
 
49
63
  export declare type ButtonClassNames = {
@@ -153,6 +167,18 @@ export declare type ChipProps = VacanoComponentProps<HTMLSpanElement, ChipClassN
153
167
 
154
168
  export declare type ChipVariant = 'gray' | 'red' | 'blue' | 'black';
155
169
 
170
+ export declare const COLORS: {
171
+ readonly black: "#212529";
172
+ readonly white: "#ffffff";
173
+ readonly red: "#C1121F";
174
+ readonly green: "#16a34a";
175
+ readonly yellow: "#ffb703";
176
+ readonly gray: "#e5e7eb";
177
+ readonly 'steel-blue': "#0582ca";
178
+ readonly 'iron-grey': "#495057";
179
+ readonly 'baltic-blue': "#1e6091";
180
+ };
181
+
156
182
  export declare type ConfirmationContextValue = {
157
183
  show: (message: ReactNode, onConfirm: () => void | Promise<void>, onCancel?: () => void, options?: ConfirmationOptions) => void;
158
184
  hide: () => void;
@@ -325,6 +351,12 @@ export declare type FieldMessageVariant = 'normal' | 'error' | 'success' | 'warn
325
351
  */
326
352
  export declare const formatDateGo: (date: Date, format: string, locale?: string) => string;
327
353
 
354
+ export declare const getBrowser: () => Browser;
355
+
356
+ export declare const getKeySymbols: (keys?: KeyboardEventKey[]) => string[];
357
+
358
+ export declare const getOperatingSystem: () => OperatingSystem;
359
+
328
360
  export declare const GlobalStyle: () => JSX.Element;
329
361
 
330
362
  export declare const ImageCropper: ({ allowedTypes, applyLabel, buttonLabel, cancelLabel, className, classnames, compression, maxFileSize, onCrop, onError, outputSize, portalSize, previewSize, ref, type, value, ...rest }: ImageCropperProps) => JSX.Element;
@@ -377,11 +409,117 @@ export declare type InputProps = VacanoComponentProps<HTMLInputElement, InputCla
377
409
 
378
410
  export declare type InputVariant = 'normal' | 'error';
379
411
 
412
+ export declare const isValid: (hexColor: string) => boolean;
413
+
414
+ export declare const KEY_SYMBOLS: Partial<Record<KeyboardEventKey, {
415
+ mac: string;
416
+ other: string;
417
+ }>>;
418
+
380
419
  /**
381
420
  * Keyboard key values based on KeyboardEvent.key
382
421
  * @see https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values
383
422
  */
384
- declare type KeyboardEventKey = 'Meta' | 'Control' | 'Alt' | 'Shift' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z' | '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'F1' | 'F2' | 'F3' | 'F4' | 'F5' | 'F6' | 'F7' | 'F8' | 'F9' | 'F10' | 'F11' | 'F12' | 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight' | 'Home' | 'End' | 'PageUp' | 'PageDown' | ' ' | 'Enter' | 'Tab' | 'Backspace' | 'Delete' | 'Insert' | 'Escape' | '`' | '-' | '=' | '[' | ']' | '\\' | ';' | "'" | ',' | '.' | '/' | 'NumLock' | 'NumpadEnter' | 'NumpadAdd' | 'NumpadSubtract' | 'NumpadMultiply' | 'NumpadDivide' | 'NumpadDecimal' | 'Numpad0' | 'Numpad1' | 'Numpad2' | 'Numpad3' | 'Numpad4' | 'Numpad5' | 'Numpad6' | 'Numpad7' | 'Numpad8' | 'Numpad9' | 'CapsLock' | 'ScrollLock' | 'Pause' | 'PrintScreen' | 'ContextMenu';
423
+ export declare type KeyboardEventKey = 'Meta' | 'Control' | 'Alt' | 'Shift' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z' | '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'F1' | 'F2' | 'F3' | 'F4' | 'F5' | 'F6' | 'F7' | 'F8' | 'F9' | 'F10' | 'F11' | 'F12' | 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight' | 'Home' | 'End' | 'PageUp' | 'PageDown' | ' ' | 'Enter' | 'Tab' | 'Backspace' | 'Delete' | 'Insert' | 'Escape' | '`' | '-' | '=' | '[' | ']' | '\\' | ';' | "'" | ',' | '.' | '/' | 'NumLock' | 'NumpadEnter' | 'NumpadAdd' | 'NumpadSubtract' | 'NumpadMultiply' | 'NumpadDivide' | 'NumpadDecimal' | 'Numpad0' | 'Numpad1' | 'Numpad2' | 'Numpad3' | 'Numpad4' | 'Numpad5' | 'Numpad6' | 'Numpad7' | 'Numpad8' | 'Numpad9' | 'CapsLock' | 'ScrollLock' | 'Pause' | 'PrintScreen' | 'ContextMenu';
424
+
425
+ export declare const KEYFRAMES: {
426
+ rotate: {
427
+ name: string;
428
+ styles: string;
429
+ anim: 1;
430
+ toString: () => string;
431
+ } & string;
432
+ fadeIn: {
433
+ name: string;
434
+ styles: string;
435
+ anim: 1;
436
+ toString: () => string;
437
+ } & string;
438
+ fadeOut: {
439
+ name: string;
440
+ styles: string;
441
+ anim: 1;
442
+ toString: () => string;
443
+ } & string;
444
+ slideInLeft: {
445
+ name: string;
446
+ styles: string;
447
+ anim: 1;
448
+ toString: () => string;
449
+ } & string;
450
+ slideOutLeft: {
451
+ name: string;
452
+ styles: string;
453
+ anim: 1;
454
+ toString: () => string;
455
+ } & string;
456
+ slideInRight: {
457
+ name: string;
458
+ styles: string;
459
+ anim: 1;
460
+ toString: () => string;
461
+ } & string;
462
+ slideOutRight: {
463
+ name: string;
464
+ styles: string;
465
+ anim: 1;
466
+ toString: () => string;
467
+ } & string;
468
+ slideInTop: {
469
+ name: string;
470
+ styles: string;
471
+ anim: 1;
472
+ toString: () => string;
473
+ } & string;
474
+ slideOutTop: {
475
+ name: string;
476
+ styles: string;
477
+ anim: 1;
478
+ toString: () => string;
479
+ } & string;
480
+ slideInBottom: {
481
+ name: string;
482
+ styles: string;
483
+ anim: 1;
484
+ toString: () => string;
485
+ } & string;
486
+ slideOutBottom: {
487
+ name: string;
488
+ styles: string;
489
+ anim: 1;
490
+ toString: () => string;
491
+ } & string;
492
+ scaleIn: {
493
+ name: string;
494
+ styles: string;
495
+ anim: 1;
496
+ toString: () => string;
497
+ } & string;
498
+ slideInTopFade: {
499
+ name: string;
500
+ styles: string;
501
+ anim: 1;
502
+ toString: () => string;
503
+ } & string;
504
+ slideOutTopFade: {
505
+ name: string;
506
+ styles: string;
507
+ anim: 1;
508
+ toString: () => string;
509
+ } & string;
510
+ slideInBottomFade: {
511
+ name: string;
512
+ styles: string;
513
+ anim: 1;
514
+ toString: () => string;
515
+ } & string;
516
+ slideOutBottomFade: {
517
+ name: string;
518
+ styles: string;
519
+ anim: 1;
520
+ toString: () => string;
521
+ } & string;
522
+ };
385
523
 
386
524
  export declare const KeysBindings: ({ className, classnames, keys, ref, variant, ...rest }: KeysBindingsProps) => JSX.Element | null;
387
525
 
@@ -405,6 +543,12 @@ export declare type KeySymbolProps = VacanoComponentProps<HTMLSpanElement> & {
405
543
 
406
544
  export declare type KeySymbolVariant = 'dark' | 'light';
407
545
 
546
+ export declare const mediaBetween: (min: Breakpoint, max: Breakpoint) => string;
547
+
548
+ export declare const mediaDown: (bp: Breakpoint) => string;
549
+
550
+ export declare const mediaUp: (bp: Breakpoint) => string;
551
+
408
552
  export declare const Modal: ({ animated, children, className, classnames, open, ref, width, ...rest }: ModalProps) => ReactPortal | null;
409
553
 
410
554
  export declare type ModalClassNames = {
@@ -455,6 +599,8 @@ export declare type MultiSelectProps = VacanoComponentProps<HTMLDivElement, Mult
455
599
 
456
600
  export declare type MultiSelectVariant = 'normal' | 'error';
457
601
 
602
+ export declare const newClassNameGetter: (name: string) => (element: string, ...classNames: Array<string | undefined>) => string;
603
+
458
604
  declare type Notification_2 = {
459
605
  id: string;
460
606
  message: ReactNode;
@@ -486,6 +632,8 @@ export declare type NotificationState = {
486
632
 
487
633
  export declare type NotificationVariant = 'default' | 'success' | 'warning' | 'danger' | 'info';
488
634
 
635
+ export declare type OperatingSystem = 'windows' | 'macos' | 'linux' | 'ios' | 'android' | 'unknown';
636
+
489
637
  export declare const OtpCode: ({ autoFocus, className, classnames, disabled, label, length, onChange, ref, size, value, variant, ...rest }: OtpCodeProps) => JSX.Element;
490
638
 
491
639
  export declare type OtpCodeClassNames = {
@@ -804,6 +952,8 @@ export declare type ToastState = {
804
952
 
805
953
  export declare type ToastVariant = 'default' | 'success' | 'warning' | 'danger';
806
954
 
955
+ export declare const toHEX: (n: number) => string;
956
+
807
957
  export declare const Tooltip: ({ children, className, classnames, content, delay, placement, portalRenderNode, ref, variant, ...rest }: TooltipProps) => JSX.Element;
808
958
 
809
959
  export declare type TooltipClassNames = {
@@ -844,21 +994,36 @@ export declare type UseImageCropperReturn = {
844
994
  open: () => void;
845
995
  };
846
996
 
997
+ export declare const useKeyBinding: (keys: KeyboardEventKey[], cb?: () => void) => void;
998
+
847
999
  export declare const useNotification: () => NotificationContextValue;
848
1000
 
849
1001
  export declare const useSaveProgress: () => SaveProgressContextValue;
850
1002
 
851
1003
  export declare const useToast: () => ToastContextValue;
852
1004
 
853
- declare type VacanoComponentClassNames<T> = T;
1005
+ export declare type VacanoComponentClassNames<T> = T;
854
1006
 
855
- declare type VacanoComponentProps<E extends HTMLElement | null, T extends Record<string, string> = Record<string, never>> = {
1007
+ export declare type VacanoComponentProps<E extends HTMLElement | null, T extends Record<string, string> = Record<string, never>> = {
856
1008
  'data-test-id'?: string;
857
1009
  className?: string;
858
1010
  classnames?: VacanoComponentClassNames<T>;
859
1011
  ref?: Ref<E>;
860
1012
  };
861
1013
 
862
- declare type VacanoComponentSize = 'compact' | 'default';
1014
+ export declare type VacanoComponentSize = 'compact' | 'default';
1015
+
1016
+ export declare type VacanoInteractiveElementState = {
1017
+ active?: string;
1018
+ disabled?: string;
1019
+ hover?: string;
1020
+ static?: string;
1021
+ };
1022
+
1023
+ export declare type VacanoValueItem = {
1024
+ value: string;
1025
+ label: string;
1026
+ disabled?: boolean;
1027
+ };
863
1028
 
864
1029
  export { }