@myelmut/design-system 0.1.17 → 0.1.19

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.
@@ -28,12 +28,15 @@ import { ReactComponent as PolaroidThreadIcon } from './polaroid-thread.svg';
28
28
  import { ReactComponent as ProfilIcon } from './profil.svg';
29
29
  import { ReactComponent as QuoteIcon } from './quote.svg';
30
30
  import { RefAttributes } from 'react';
31
+ import { RefObject } from 'react';
31
32
  import { ReactComponent as StarIcon } from './star.svg';
32
33
  import { ReactComponent as SubtractIcon } from './subtract.svg';
33
34
  import { ReactComponent as TiktokIcon } from './Tiktok.svg';
34
35
  import { ReactComponent as TrustpilotIcon } from './trustpilot.svg';
35
36
  import { ReactComponent as UnmuteIcon } from './unmute.svg';
36
37
 
38
+ export declare const accordionAnimation: (e: Event, details: HTMLDetailsElement, content: HTMLElement, delay?: number) => void;
39
+
37
40
  export { ArrowIcon }
38
41
 
39
42
  export { ArrowPlainIcon }
@@ -104,6 +107,8 @@ declare interface ClearButtonProps extends React.ButtonHTMLAttributes<HTMLButton
104
107
  onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
105
108
  }
106
109
 
110
+ export declare const closeOthersAccordions: (details: HTMLDetailsElement) => void;
111
+
107
112
  declare type CommonProps = {
108
113
  variant?: 'primary' | 'secondary' | 'terciary';
109
114
  color?: 'light' | 'dark';
@@ -131,6 +136,10 @@ export { CrossIcon }
131
136
 
132
137
  export { CrossRoundedIcon }
133
138
 
139
+ export declare const debounce: (func: (...args: any[]) => void, wait: number) => (...args: any[]) => void;
140
+
141
+ export declare const disableScroll: () => void;
142
+
134
143
  export declare const Dropdown: ({ label, id, options, placeholder, name, className, error, hasError, disabled, onChange, value, required, searchable }: DropdownProps) => JSX.Element;
135
144
 
136
145
  export declare const DropdownMenu: ({ name, options, value, values, disabled, className, onChange, onChangeMultiple, isOpen, multiple }: DropdownMenuProps) => JSX.Element;
@@ -165,6 +174,8 @@ declare interface EmblemProps {
165
174
  className?: string;
166
175
  }
167
176
 
177
+ export declare const enableScroll: () => void;
178
+
168
179
  export declare const ErrorMessage: ({ message, hasError, className, id }: ErrorMessageProps) => JSX.Element;
169
180
 
170
181
  declare interface ErrorMessageProps {
@@ -399,6 +410,10 @@ declare interface NewsletterProps {
399
410
  error?: string;
400
411
  }
401
412
 
413
+ export declare const onKeyDown: (e: React.KeyboardEvent<HTMLLIElement | HTMLLabelElement | HTMLDivElement>, callback: () => void) => void;
414
+
415
+ export declare const onNumericInput: (e: React.KeyboardEvent<HTMLInputElement>) => void;
416
+
402
417
  export declare const ParagraphTitle: default_2.ForwardRefExoticComponent<Omit<TitleProps, "variant"> & default_2.RefAttributes<HTMLParagraphElement>>;
403
418
 
404
419
  export { PauseIcon }
@@ -669,6 +684,58 @@ declare interface UpCardProps {
669
684
  illustrationClassName?: string;
670
685
  }
671
686
 
687
+ export declare function useArrowNavigation<T extends HTMLElement = HTMLElement>(selector: string): RefObject<T | null>;
688
+
689
+ /**
690
+ * Calls `handler` when a pointer interaction finishes outside the element referenced by `ref`.
691
+ *
692
+ * The hook ensures the most recent `handler` is invoked even if it changes between renders.
693
+ *
694
+ * @param ref - React ref of the element to detect outside interactions for
695
+ * @param handler - Callback invoked with the originating `MouseEvent` or `TouchEvent` when a `pointerup` occurs outside the referenced element
696
+ */
697
+ export declare function useClickOutside<T extends HTMLElement>(ref: React.RefObject<T>, handler: (event: MouseEvent | TouchEvent) => void): void;
698
+
699
+ /**
700
+ * Observes a single element and invokes callbacks when it enters or leaves the viewport threshold.
701
+ *
702
+ * @param ref - RefObject pointing to the target HTMLElement to observe
703
+ * @param onAppear - Callback invoked when the element becomes intersecting
704
+ * @param onDisappear - Callback invoked when the element stops being intersecting
705
+ * @param threshold - Intersection ratio threshold between 0 and 1 that determines when callbacks fire
706
+ */
707
+ export declare function useIntersectionObserver({ ref, onAppear, onDisappear, threshold }: UseSingleObserverOptions): void;
708
+
709
+ export declare function useIsMobile(): boolean;
710
+
711
+ /**
712
+ * Observe all elements matching a CSS selector and invoke a callback for each element when it becomes visible.
713
+ *
714
+ * Observers are created for the currently matched elements and re-created on window resize to account for layout changes; observers are cleaned up on unmount or when inputs change.
715
+ *
716
+ * @param selector - CSS selector used to find elements to observe. If falsy, no observer is created.
717
+ * @param callback - Invoked for each intersecting entry as `callback(entry, element)`, where `entry` is the IntersectionObserverEntry and `element` is the observed HTMLElement.
718
+ * @param root - Optional ancestor element used as the viewport for intersection; `null` means the browser viewport.
719
+ * @param threshold - Intersection ratio at which the callback is triggered (e.g., `0.1`).
720
+ * @param rootMargin - Margin around the root bounding box (e.g., `'0px'`, `'10px 0px'`).
721
+ */
722
+ export declare function useMultiIntersectionObserver({ selector, callback, root, threshold, rootMargin }: UseMultiObserverOptions): void;
723
+
724
+ declare type UseMultiObserverOptions = {
725
+ selector: string;
726
+ callback: (entry: IntersectionObserverEntry, element: HTMLElement) => void;
727
+ root?: Element | null;
728
+ threshold?: number;
729
+ rootMargin?: string;
730
+ };
731
+
732
+ declare type UseSingleObserverOptions = {
733
+ ref: RefObject<HTMLElement>;
734
+ onAppear: () => void;
735
+ onDisappear: () => void;
736
+ threshold?: number;
737
+ };
738
+
672
739
  export declare const VideoPlayer: ({ videoId, alt, className, placeholderImageMobile, hasSound, placeholderImageDesktop, placeholderImageMobile2x, placeholderImageDesktop2x }: VideoPlayerProps) => JSX.Element;
673
740
 
674
741
  declare interface VideoPlayerProps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myelmut/design-system",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "description": "Design system for Elmut project",
5
5
  "repository": {
6
6
  "type": "git",
@@ -102,7 +102,7 @@
102
102
  --radius-table: 1.875rem;
103
103
 
104
104
  /* Custom breakpoints (affect all @md, @lg, etc. utilities) */
105
- --breakpoint-xs: 155;
105
+ --breakpoint-xs: 155px;
106
106
 
107
107
  /* Custom container widths */
108
108
  --container-xs: 100vw;