@julseb-lib/react 1.0.24 → 1.0.25

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.cts CHANGED
@@ -4,7 +4,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ClassNameValue } from 'tailwind-merge';
5
5
  import { MarkdownToJSX } from 'markdown-to-jsx';
6
6
  import { LibMdEditorOptions } from './types/components-items-props.cjs';
7
- export { addDay, addMonth, addYear, calculateAverage, calculateTotalSum, capitalize, convertDate, convertDateShort, convertPrice, convertToEmail, convertYoutube, deleteDuplicates, detectLanguage, disableScroll, emailRegex, enableScroll, filterObject, formatDate, formatHour, generateNumbers, getFirstName, getInitials, getLastName, getNextDay, getPercentage, getRandom, getRandomAvatar, getRandomDate, getRandomNumber, getRandomString, getRandomTime, getTimeNow, getToday, getTomorrow, getYesterday, hexToRgb, passwordRegex, rgbToHex, scrollToTop, slugify, sortByFrequency, stringifyPx, toCamelCase, toConstantCase, toDotCase, toKebabCase, toPascalCase, toPathCase, toSentenceCase, toSnakeCase, toTitleCase, unslugify, uuid } from '@julseb-lib/utils';
7
+ export { addDay, addMonth, addYear, calculateAverage, calculateTotalSum, capitalize, convertDate, convertDateShort, convertPrice, convertToEmail, convertYoutube, deleteDuplicates, emailRegex, filterObject, formatDate, formatHour, generateNumbers, getFirstName, getInitials, getLastName, getNextDay, getPercentage, getRandom, getRandomAvatar, getRandomDate, getRandomNumber, getRandomString, getRandomTime, getTimeNow, getToday, getTomorrow, getYesterday, hexToRgb, passwordRegex, rgbToHex, slugify, sortByFrequency, stringifyPx, toCamelCase, toConstantCase, toDotCase, toKebabCase, toPascalCase, toPathCase, toSentenceCase, toSnakeCase, toTitleCase, unslugify, uuid } from '@julseb-lib/utils';
8
8
  import * as react from 'react';
9
9
  import { RefObject, ChangeEvent, RefCallback, Ref, FC as FC$1 } from 'react';
10
10
  import { ILibText, ILibWrapper, ILibMain, ILibAside, ILibSection, ILibGrid, ILibFlexbox, ILibKey, ILibHighlight, ILibLinkify, ILibHr, ILibSkeleton, ILibSkeletonCard, ILibTooltip, ILibImage, ILibMasonry, ILibBadge, ILibAvatar, ILibLoader, ILibBurger, ILibButton, ILibButtonIcon, ILibButtonGroup, ILibTag, ILibInputContainer, ILibInput, ILibInputImage, ILibInputCheck, ILibInputPhone, ILibInputCounter, ILibInputSlider, ILibSelect, ILibAutocomplete, ILibRating, ILibInputPin, ILibFieldset, ILibForm, ILibListGroup, ILibListGroupTitle, ILibListGroupItem, ILibBreadcrumbs, ILibAccordion, ILibAccordionItem, ILibDropdown, ILibDropdownItem, ILibToast, ILibAlert, ILibModal, ILibDragList, ILibDragListItem, ILibPagination, ILibPaginationButton, ILibPaginator, ILibProgressBar, ILibProgressCircle, ILibTabs, ILibTabsContainer, ILibTabsButtonsContainer, ILibTabsButton, ILibTabContent, ILibSlideshow, ILibCover, ILibTable, ILibPageLoading, ILibSticky, ILibMarkdownEditor, ILibMarkdownContainer, ILibFade, ILibBackToTop, ILibDrawer, ILibHeader, ILibFooter, ILibMeta, ILibPageLayout, ILibSrOnly, ILibCodeContainer } from './types/components-props.cjs';
@@ -72,6 +72,88 @@ declare const libMarkdownEditorOptions: LibMdEditorOptions;
72
72
  declare const genRingColor: Record<LibColorsHover, string>;
73
73
  declare const genRingColorChildren: Record<LibColorsHover, string>;
74
74
 
75
+ /**
76
+ * @description Detect the user's language preference from localStorage or browser navigator.
77
+ * This function checks for stored language preferences before falling back to browser settings.
78
+ * Note: Only works in browser environments with window and localStorage available.
79
+ *
80
+ * @returns {string | null} The detected language code or null if detection fails
81
+ *
82
+ * @example
83
+ * // With language stored in localStorage
84
+ * detectLanguage() // Returns "fr" (if stored)
85
+ *
86
+ * @example
87
+ * // Fallback to navigator language
88
+ * detectLanguage() // Returns "en-US" (from navigator.language)
89
+ *
90
+ * @example
91
+ * // No language detected
92
+ * detectLanguage() // Returns null (in non-browser environment)
93
+ */
94
+ declare function detectLanguage(): string | null | undefined;
95
+
96
+ /**
97
+ * @description Disable page scrolling by setting body overflow to hidden.
98
+ * This function prevents users from scrolling the page, useful for modal overlays.
99
+ * Note: Only works in browser environments with document.body available.
100
+ *
101
+ * @returns {void}
102
+ *
103
+ * @example
104
+ * // Disable scrolling when opening a modal
105
+ * disableScroll()
106
+ *
107
+ * @example
108
+ * // Use with modal state
109
+ * if (isModalOpen) {
110
+ * disableScroll()
111
+ * }
112
+ */
113
+ declare function disableScroll(): void;
114
+
115
+ /**
116
+ * @description Enable page scrolling by resetting body overflow and height styles.
117
+ * This function restores normal scrolling behavior, typically used after disableScroll().
118
+ * Note: Only works in browser environments with document.body available.
119
+ *
120
+ * @returns {void}
121
+ *
122
+ * @example
123
+ * // Enable scrolling when closing a modal
124
+ * enableScroll()
125
+ *
126
+ * @example
127
+ * // Use with modal state
128
+ * if (!isModalOpen) {
129
+ * enableScroll()
130
+ * }
131
+ */
132
+ declare function enableScroll(): void;
133
+
134
+ /**
135
+ * @description Scroll to the top of the page smoothly.
136
+ * This function scrolls the window to the top position (0, 0).
137
+ * Note: Only works in browser environments where window is available.
138
+ *
139
+ * @returns {void}
140
+ *
141
+ * @example
142
+ * // Scroll to top when button is clicked
143
+ * scrollToTop()
144
+ *
145
+ * @example
146
+ * // Use in event handler
147
+ * button.addEventListener('click', scrollToTop)
148
+ *
149
+ * @example
150
+ * // Conditional scroll to top
151
+ * if (shouldScrollToTop) {
152
+ * scrollToTop()
153
+ * }
154
+ */
155
+ declare function scrollToTop(): void;
156
+
75
157
  type Event = MouseEvent | TouchEvent;
76
158
  /**
77
159
  * Hook to trigger a function when clicking outside a referenced element.
@@ -3249,4 +3331,4 @@ declare const SrOnly: FC$1<ILibSrOnly>;
3249
3331
  */
3250
3332
  declare const CodeContainer: FC$1<ILibCodeContainer>;
3251
3333
 
3252
- export { Accordion, AccordionItem, Alert, Aside, Autocomplete, Avatar, BackToTop, Badge, Breadcrumbs, Burger, Button, ButtonGroup, ButtonIcon, COLORS, CodeContainer, Cover, DROP_SHADOWS, DragList, DragListItem, Drawer, Dropdown, DropdownItem, FONT_FAMILIES, FONT_SIZES, FONT_WEIGHTS, Fade, Fieldset, Flexbox, Footer, Form, Grid, Header, Highlight, Hr, ICON_MULTIPLIER, INPUT_HEIGHT, INSET_SHADOWS, Image, Input, InputCheck, InputContainer, InputCounter, InputImage, InputPhone, InputPin, InputSlider, Key, LAYOUTS, LINE_HEIGHTS, Linkify, ListGroup, ListGroupItem, ListGroupTitle, Loader, MEDIA, Main, MarkdownContainer, MarkdownEditor, Masonry, Meta, Modal, OVERLAYS, PageLayout, PageLoading, Pagination, PaginationButton, Paginator, ProgressBar, ProgressCircle, RADIUSES, Rating, SHADOWS, SPACERS, Section, Select, Skeleton, SkeletonCard, Slideshow, SrOnly, Sticky, TEXT_BASE_CLASSES, TEXT_SHADOWS, TRANSITIONS, Table, Tabs, TabsButton, TabsButtonsContainer, TabsContainer, TabsContent, Tag, Text, ThemeProviderWrapper, Toast, ToastContainer, Tooltip, URL_REGEX, Wrapper, clsx, countries, genAlignContent, genAlignItems, genBgAllColors, genBgAllColorsAndOverlays, genBgColor, genBgColor50, genBgColorGhostHover, genBgColorHover, genBgColorShort, genBgOverlay, genBorderAllColors, genBorderColor, genBorderColorHover, genBorderColorShort, genBorderRadius, genBoxShadow, genButtonColor, genButtonDisabled, genColGap, genGap, genJustifyContent, genJustifyItems, genLinkColor, genMaxWidth, genObjectFit, genRingColor, genRingColorChildren, genRowGap, genTextAlign, genTextAllColor, genTextColor, genTextColorHover, genTextColorShort, genVAlign, libMarkdownEditorOptions, libOptionsMarkdown, linkifyText, toast, useClickOutside, useCopyToClipboard, useDebounce, useExportData, useFetch, useForm, useIsOverflow, useKeyPress, useLibTheme, useMaxWidth, useMergeRefs, useMinWidth, usePaginatedData, usePagination, useTouchScreen, useTranslation };
3334
+ export { Accordion, AccordionItem, Alert, Aside, Autocomplete, Avatar, BackToTop, Badge, Breadcrumbs, Burger, Button, ButtonGroup, ButtonIcon, COLORS, CodeContainer, Cover, DROP_SHADOWS, DragList, DragListItem, Drawer, Dropdown, DropdownItem, FONT_FAMILIES, FONT_SIZES, FONT_WEIGHTS, Fade, Fieldset, Flexbox, Footer, Form, Grid, Header, Highlight, Hr, ICON_MULTIPLIER, INPUT_HEIGHT, INSET_SHADOWS, Image, Input, InputCheck, InputContainer, InputCounter, InputImage, InputPhone, InputPin, InputSlider, Key, LAYOUTS, LINE_HEIGHTS, Linkify, ListGroup, ListGroupItem, ListGroupTitle, Loader, MEDIA, Main, MarkdownContainer, MarkdownEditor, Masonry, Meta, Modal, OVERLAYS, PageLayout, PageLoading, Pagination, PaginationButton, Paginator, ProgressBar, ProgressCircle, RADIUSES, Rating, SHADOWS, SPACERS, Section, Select, Skeleton, SkeletonCard, Slideshow, SrOnly, Sticky, TEXT_BASE_CLASSES, TEXT_SHADOWS, TRANSITIONS, Table, Tabs, TabsButton, TabsButtonsContainer, TabsContainer, TabsContent, Tag, Text, ThemeProviderWrapper, Toast, ToastContainer, Tooltip, URL_REGEX, Wrapper, clsx, countries, detectLanguage, disableScroll, enableScroll, genAlignContent, genAlignItems, genBgAllColors, genBgAllColorsAndOverlays, genBgColor, genBgColor50, genBgColorGhostHover, genBgColorHover, genBgColorShort, genBgOverlay, genBorderAllColors, genBorderColor, genBorderColorHover, genBorderColorShort, genBorderRadius, genBoxShadow, genButtonColor, genButtonDisabled, genColGap, genGap, genJustifyContent, genJustifyItems, genLinkColor, genMaxWidth, genObjectFit, genRingColor, genRingColorChildren, genRowGap, genTextAlign, genTextAllColor, genTextColor, genTextColorHover, genTextColorShort, genVAlign, libMarkdownEditorOptions, libOptionsMarkdown, linkifyText, scrollToTop, toast, useClickOutside, useCopyToClipboard, useDebounce, useExportData, useFetch, useForm, useIsOverflow, useKeyPress, useLibTheme, useMaxWidth, useMergeRefs, useMinWidth, usePaginatedData, usePagination, useTouchScreen, useTranslation };
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ClassNameValue } from 'tailwind-merge';
5
5
  import { MarkdownToJSX } from 'markdown-to-jsx';
6
6
  import { LibMdEditorOptions } from './types/components-items-props.js';
7
- export { addDay, addMonth, addYear, calculateAverage, calculateTotalSum, capitalize, convertDate, convertDateShort, convertPrice, convertToEmail, convertYoutube, deleteDuplicates, detectLanguage, disableScroll, emailRegex, enableScroll, filterObject, formatDate, formatHour, generateNumbers, getFirstName, getInitials, getLastName, getNextDay, getPercentage, getRandom, getRandomAvatar, getRandomDate, getRandomNumber, getRandomString, getRandomTime, getTimeNow, getToday, getTomorrow, getYesterday, hexToRgb, passwordRegex, rgbToHex, scrollToTop, slugify, sortByFrequency, stringifyPx, toCamelCase, toConstantCase, toDotCase, toKebabCase, toPascalCase, toPathCase, toSentenceCase, toSnakeCase, toTitleCase, unslugify, uuid } from '@julseb-lib/utils';
7
+ export { addDay, addMonth, addYear, calculateAverage, calculateTotalSum, capitalize, convertDate, convertDateShort, convertPrice, convertToEmail, convertYoutube, deleteDuplicates, emailRegex, filterObject, formatDate, formatHour, generateNumbers, getFirstName, getInitials, getLastName, getNextDay, getPercentage, getRandom, getRandomAvatar, getRandomDate, getRandomNumber, getRandomString, getRandomTime, getTimeNow, getToday, getTomorrow, getYesterday, hexToRgb, passwordRegex, rgbToHex, slugify, sortByFrequency, stringifyPx, toCamelCase, toConstantCase, toDotCase, toKebabCase, toPascalCase, toPathCase, toSentenceCase, toSnakeCase, toTitleCase, unslugify, uuid } from '@julseb-lib/utils';
8
8
  import * as react from 'react';
9
9
  import { RefObject, ChangeEvent, RefCallback, Ref, FC as FC$1 } from 'react';
10
10
  import { ILibText, ILibWrapper, ILibMain, ILibAside, ILibSection, ILibGrid, ILibFlexbox, ILibKey, ILibHighlight, ILibLinkify, ILibHr, ILibSkeleton, ILibSkeletonCard, ILibTooltip, ILibImage, ILibMasonry, ILibBadge, ILibAvatar, ILibLoader, ILibBurger, ILibButton, ILibButtonIcon, ILibButtonGroup, ILibTag, ILibInputContainer, ILibInput, ILibInputImage, ILibInputCheck, ILibInputPhone, ILibInputCounter, ILibInputSlider, ILibSelect, ILibAutocomplete, ILibRating, ILibInputPin, ILibFieldset, ILibForm, ILibListGroup, ILibListGroupTitle, ILibListGroupItem, ILibBreadcrumbs, ILibAccordion, ILibAccordionItem, ILibDropdown, ILibDropdownItem, ILibToast, ILibAlert, ILibModal, ILibDragList, ILibDragListItem, ILibPagination, ILibPaginationButton, ILibPaginator, ILibProgressBar, ILibProgressCircle, ILibTabs, ILibTabsContainer, ILibTabsButtonsContainer, ILibTabsButton, ILibTabContent, ILibSlideshow, ILibCover, ILibTable, ILibPageLoading, ILibSticky, ILibMarkdownEditor, ILibMarkdownContainer, ILibFade, ILibBackToTop, ILibDrawer, ILibHeader, ILibFooter, ILibMeta, ILibPageLayout, ILibSrOnly, ILibCodeContainer } from './types/components-props.js';
@@ -72,6 +72,88 @@ declare const libMarkdownEditorOptions: LibMdEditorOptions;
72
72
  declare const genRingColor: Record<LibColorsHover, string>;
73
73
  declare const genRingColorChildren: Record<LibColorsHover, string>;
74
74
 
75
+ /**
76
+ * @description Detect the user's language preference from localStorage or browser navigator.
77
+ * This function checks for stored language preferences before falling back to browser settings.
78
+ * Note: Only works in browser environments with window and localStorage available.
79
+ *
80
+ * @returns {string | null} The detected language code or null if detection fails
81
+ *
82
+ * @example
83
+ * // With language stored in localStorage
84
+ * detectLanguage() // Returns "fr" (if stored)
85
+ *
86
+ * @example
87
+ * // Fallback to navigator language
88
+ * detectLanguage() // Returns "en-US" (from navigator.language)
89
+ *
90
+ * @example
91
+ * // No language detected
92
+ * detectLanguage() // Returns null (in non-browser environment)
93
+ */
94
+ declare function detectLanguage(): string | null | undefined;
95
+
96
+ /**
97
+ * @description Disable page scrolling by setting body overflow to hidden.
98
+ * This function prevents users from scrolling the page, useful for modal overlays.
99
+ * Note: Only works in browser environments with document.body available.
100
+ *
101
+ * @returns {void}
102
+ *
103
+ * @example
104
+ * // Disable scrolling when opening a modal
105
+ * disableScroll()
106
+ *
107
+ * @example
108
+ * // Use with modal state
109
+ * if (isModalOpen) {
110
+ * disableScroll()
111
+ * }
112
+ */
113
+ declare function disableScroll(): void;
114
+
115
+ /**
116
+ * @description Enable page scrolling by resetting body overflow and height styles.
117
+ * This function restores normal scrolling behavior, typically used after disableScroll().
118
+ * Note: Only works in browser environments with document.body available.
119
+ *
120
+ * @returns {void}
121
+ *
122
+ * @example
123
+ * // Enable scrolling when closing a modal
124
+ * enableScroll()
125
+ *
126
+ * @example
127
+ * // Use with modal state
128
+ * if (!isModalOpen) {
129
+ * enableScroll()
130
+ * }
131
+ */
132
+ declare function enableScroll(): void;
133
+
134
+ /**
135
+ * @description Scroll to the top of the page smoothly.
136
+ * This function scrolls the window to the top position (0, 0).
137
+ * Note: Only works in browser environments where window is available.
138
+ *
139
+ * @returns {void}
140
+ *
141
+ * @example
142
+ * // Scroll to top when button is clicked
143
+ * scrollToTop()
144
+ *
145
+ * @example
146
+ * // Use in event handler
147
+ * button.addEventListener('click', scrollToTop)
148
+ *
149
+ * @example
150
+ * // Conditional scroll to top
151
+ * if (shouldScrollToTop) {
152
+ * scrollToTop()
153
+ * }
154
+ */
155
+ declare function scrollToTop(): void;
156
+
75
157
  type Event = MouseEvent | TouchEvent;
76
158
  /**
77
159
  * Hook to trigger a function when clicking outside a referenced element.
@@ -3249,4 +3331,4 @@ declare const SrOnly: FC$1<ILibSrOnly>;
3249
3331
  */
3250
3332
  declare const CodeContainer: FC$1<ILibCodeContainer>;
3251
3333
 
3252
- export { Accordion, AccordionItem, Alert, Aside, Autocomplete, Avatar, BackToTop, Badge, Breadcrumbs, Burger, Button, ButtonGroup, ButtonIcon, COLORS, CodeContainer, Cover, DROP_SHADOWS, DragList, DragListItem, Drawer, Dropdown, DropdownItem, FONT_FAMILIES, FONT_SIZES, FONT_WEIGHTS, Fade, Fieldset, Flexbox, Footer, Form, Grid, Header, Highlight, Hr, ICON_MULTIPLIER, INPUT_HEIGHT, INSET_SHADOWS, Image, Input, InputCheck, InputContainer, InputCounter, InputImage, InputPhone, InputPin, InputSlider, Key, LAYOUTS, LINE_HEIGHTS, Linkify, ListGroup, ListGroupItem, ListGroupTitle, Loader, MEDIA, Main, MarkdownContainer, MarkdownEditor, Masonry, Meta, Modal, OVERLAYS, PageLayout, PageLoading, Pagination, PaginationButton, Paginator, ProgressBar, ProgressCircle, RADIUSES, Rating, SHADOWS, SPACERS, Section, Select, Skeleton, SkeletonCard, Slideshow, SrOnly, Sticky, TEXT_BASE_CLASSES, TEXT_SHADOWS, TRANSITIONS, Table, Tabs, TabsButton, TabsButtonsContainer, TabsContainer, TabsContent, Tag, Text, ThemeProviderWrapper, Toast, ToastContainer, Tooltip, URL_REGEX, Wrapper, clsx, countries, genAlignContent, genAlignItems, genBgAllColors, genBgAllColorsAndOverlays, genBgColor, genBgColor50, genBgColorGhostHover, genBgColorHover, genBgColorShort, genBgOverlay, genBorderAllColors, genBorderColor, genBorderColorHover, genBorderColorShort, genBorderRadius, genBoxShadow, genButtonColor, genButtonDisabled, genColGap, genGap, genJustifyContent, genJustifyItems, genLinkColor, genMaxWidth, genObjectFit, genRingColor, genRingColorChildren, genRowGap, genTextAlign, genTextAllColor, genTextColor, genTextColorHover, genTextColorShort, genVAlign, libMarkdownEditorOptions, libOptionsMarkdown, linkifyText, toast, useClickOutside, useCopyToClipboard, useDebounce, useExportData, useFetch, useForm, useIsOverflow, useKeyPress, useLibTheme, useMaxWidth, useMergeRefs, useMinWidth, usePaginatedData, usePagination, useTouchScreen, useTranslation };
3334
+ export { Accordion, AccordionItem, Alert, Aside, Autocomplete, Avatar, BackToTop, Badge, Breadcrumbs, Burger, Button, ButtonGroup, ButtonIcon, COLORS, CodeContainer, Cover, DROP_SHADOWS, DragList, DragListItem, Drawer, Dropdown, DropdownItem, FONT_FAMILIES, FONT_SIZES, FONT_WEIGHTS, Fade, Fieldset, Flexbox, Footer, Form, Grid, Header, Highlight, Hr, ICON_MULTIPLIER, INPUT_HEIGHT, INSET_SHADOWS, Image, Input, InputCheck, InputContainer, InputCounter, InputImage, InputPhone, InputPin, InputSlider, Key, LAYOUTS, LINE_HEIGHTS, Linkify, ListGroup, ListGroupItem, ListGroupTitle, Loader, MEDIA, Main, MarkdownContainer, MarkdownEditor, Masonry, Meta, Modal, OVERLAYS, PageLayout, PageLoading, Pagination, PaginationButton, Paginator, ProgressBar, ProgressCircle, RADIUSES, Rating, SHADOWS, SPACERS, Section, Select, Skeleton, SkeletonCard, Slideshow, SrOnly, Sticky, TEXT_BASE_CLASSES, TEXT_SHADOWS, TRANSITIONS, Table, Tabs, TabsButton, TabsButtonsContainer, TabsContainer, TabsContent, Tag, Text, ThemeProviderWrapper, Toast, ToastContainer, Tooltip, URL_REGEX, Wrapper, clsx, countries, detectLanguage, disableScroll, enableScroll, genAlignContent, genAlignItems, genBgAllColors, genBgAllColorsAndOverlays, genBgColor, genBgColor50, genBgColorGhostHover, genBgColorHover, genBgColorShort, genBgOverlay, genBorderAllColors, genBorderColor, genBorderColorHover, genBorderColorShort, genBorderRadius, genBoxShadow, genButtonColor, genButtonDisabled, genColGap, genGap, genJustifyContent, genJustifyItems, genLinkColor, genMaxWidth, genObjectFit, genRingColor, genRingColorChildren, genRowGap, genTextAlign, genTextAllColor, genTextColor, genTextColorHover, genTextColorShort, genVAlign, libMarkdownEditorOptions, libOptionsMarkdown, linkifyText, scrollToTop, toast, useClickOutside, useCopyToClipboard, useDebounce, useExportData, useFetch, useForm, useIsOverflow, useKeyPress, useLibTheme, useMaxWidth, useMergeRefs, useMinWidth, usePaginatedData, usePagination, useTouchScreen, useTranslation };
package/dist/index.js CHANGED
@@ -1940,6 +1940,44 @@ var genRingColorChildren = {
1940
1940
  white: "[&>*]:focus:ring-1 [&>*]:focus:ring-gray-500"
1941
1941
  };
1942
1942
 
1943
+ // src/lib/utils/detect-language.ts
1944
+ function detectLanguage() {
1945
+ if (window && typeof window !== "undefined") {
1946
+ if (localStorage.getItem("language") !== null) {
1947
+ return localStorage.getItem("language");
1948
+ } else if (localStorage.getItem("lang") !== null) {
1949
+ return localStorage.getItem("lang");
1950
+ } else {
1951
+ if (navigator && typeof navigator !== "undefined") {
1952
+ return navigator.language;
1953
+ }
1954
+ }
1955
+ }
1956
+ }
1957
+
1958
+ // src/lib/utils/disable-scroll.ts
1959
+ function disableScroll() {
1960
+ const body = document.body;
1961
+ body.style.height = "100vh";
1962
+ body.style.overflow = "hidden";
1963
+ return;
1964
+ }
1965
+
1966
+ // src/lib/utils/enable-scroll.ts
1967
+ function enableScroll() {
1968
+ const body = document.body;
1969
+ body.style.height = "";
1970
+ body.style.overflow = "";
1971
+ return;
1972
+ }
1973
+
1974
+ // src/lib/utils/scroll-to-top.ts
1975
+ function scrollToTop() {
1976
+ if (typeof window !== "undefined") {
1977
+ return window.scrollTo(0, 0);
1978
+ }
1979
+ }
1980
+
1943
1981
  // src/lib/index.ts
1944
1982
  import {
1945
1983
  addDay,
@@ -1954,9 +1992,6 @@ import {
1954
1992
  convertToEmail,
1955
1993
  convertYoutube,
1956
1994
  deleteDuplicates,
1957
- detectLanguage as detectLanguage2,
1958
- disableScroll as disableScroll4,
1959
- enableScroll as enableScroll4,
1960
1995
  filterObject,
1961
1996
  formatDate,
1962
1997
  formatHour,
@@ -1980,7 +2015,6 @@ import {
1980
2015
  emailRegex,
1981
2016
  passwordRegex,
1982
2017
  rgbToHex,
1983
- scrollToTop as scrollToTop3,
1984
2018
  slugify as slugify2,
1985
2019
  sortByFrequency,
1986
2020
  stringifyPx as stringifyPx3,
@@ -2247,7 +2281,6 @@ var usePaginatedData = (data, page, defaultLimit = 20) => {
2247
2281
  };
2248
2282
 
2249
2283
  // src/lib/hooks/usePagination.tsx
2250
- import { scrollToTop } from "@julseb-lib/utils";
2251
2284
  var usePagination = ({
2252
2285
  currentPage,
2253
2286
  setCurrentPage,
@@ -2291,7 +2324,6 @@ var useTouchScreen = () => {
2291
2324
 
2292
2325
  // src/lib/hooks/useTranslation.tsx
2293
2326
  import { useState as useState9, useEffect as useEffect7 } from "react";
2294
- import "@julseb-lib/utils";
2295
2327
  var useTranslation = (translations) => {
2296
2328
  const [language, setLanguage] = useState9("en");
2297
2329
  const languages = Object.keys(translations);
@@ -67268,7 +67300,6 @@ var Alert = ({
67268
67300
  // src/lib/components/Modal/Modal.tsx
67269
67301
  import { useRef as useRef12 } from "react";
67270
67302
  import { BiX as BiX4 } from "react-icons/bi";
67271
- import { enableScroll } from "@julseb-lib/utils";
67272
67303
  import { jsx as jsx336, jsxs as jsxs279 } from "react/jsx-runtime";
67273
67304
  var Modal = ({
67274
67305
  className,
@@ -68526,7 +68557,6 @@ var Cover = ({
68526
68557
 
68527
68558
  // src/lib/components/PageLoading/PageLoading.tsx
68528
68559
  import { useEffect as useEffect13 } from "react";
68529
- import { disableScroll } from "@julseb-lib/utils";
68530
68560
  import { jsx as jsx353 } from "react/jsx-runtime";
68531
68561
  var PageLoading = ({
68532
68562
  className,
@@ -69207,7 +69237,6 @@ var Fade = ({
69207
69237
  // src/lib/components/BackToTop/BackToTop.tsx
69208
69238
  import { useEffect as useEffect15, useState as useState26 } from "react";
69209
69239
  import { BiUpArrowAlt } from "react-icons/bi";
69210
- import { scrollToTop as scrollToTop2 } from "@julseb-lib/utils";
69211
69240
  import { jsx as jsx363 } from "react/jsx-runtime";
69212
69241
  var BackToTop = ({
69213
69242
  className,
@@ -69233,7 +69262,7 @@ var BackToTop = ({
69233
69262
  const smoothScroll = () => {
69234
69263
  document.body.classList.add("smooth");
69235
69264
  document.documentElement.classList.add("smooth");
69236
- setTimeout(() => scrollToTop2(), 100);
69265
+ setTimeout(() => scrollToTop(), 100);
69237
69266
  setTimeout(() => {
69238
69267
  document.body.classList.remove("smooth");
69239
69268
  document.documentElement.classList.remove("smooth");
@@ -69270,7 +69299,7 @@ var BackToTop = ({
69270
69299
  // src/lib/components/Drawer/Drawer.tsx
69271
69300
  import { useEffect as useEffect16, useRef as useRef18 } from "react";
69272
69301
  import { BiX as BiX5 } from "react-icons/bi";
69273
- import { disableScroll as disableScroll2, enableScroll as enableScroll2, stringifyPx } from "@julseb-lib/utils";
69302
+ import { stringifyPx } from "@julseb-lib/utils";
69274
69303
  import { jsx as jsx364, jsxs as jsxs291 } from "react/jsx-runtime";
69275
69304
  var Drawer = ({
69276
69305
  className,
@@ -69298,8 +69327,8 @@ var Drawer = ({
69298
69327
  if (!disableEsc && isOpen) setIsOpen(false);
69299
69328
  });
69300
69329
  useEffect16(() => {
69301
- if (!enableScrollingOpen && isOpen) disableScroll2();
69302
- else enableScroll2();
69330
+ if (!enableScrollingOpen && isOpen) disableScroll();
69331
+ else enableScroll();
69303
69332
  }, [enableScrollingOpen, isOpen]);
69304
69333
  return /* @__PURE__ */ jsxs291(
69305
69334
  Element,
@@ -69365,7 +69394,6 @@ var Drawer = ({
69365
69394
 
69366
69395
  // src/lib/components/Header/Header.tsx
69367
69396
  import { useState as useState27, useEffect as useEffect17, useRef as useRef19 } from "react";
69368
- import { enableScroll as enableScroll3, disableScroll as disableScroll3 } from "@julseb-lib/utils";
69369
69397
 
69370
69398
  // src/lib/components/Header/HeaderSearch.tsx
69371
69399
  import "react";
@@ -69448,11 +69476,11 @@ var Header = ({
69448
69476
  const [isOpen, setIsOpen] = useState27(false);
69449
69477
  const [isHidden, setIsHidden] = useState27(false);
69450
69478
  const handleOpen = () => {
69451
- if (!enableScrollingOpen) disableScroll3();
69479
+ if (!enableScrollingOpen) disableScroll();
69452
69480
  setIsOpen(true);
69453
69481
  };
69454
69482
  const handleClose = () => {
69455
- if (!enableScrollingOpen) enableScroll3();
69483
+ if (!enableScrollingOpen) enableScroll();
69456
69484
  setTimeout(() => setIsOpen(false), 10);
69457
69485
  };
69458
69486
  useEffect17(() => {
@@ -69915,10 +69943,10 @@ export {
69915
69943
  countries,
69916
69944
  deleteDuplicates,
69917
69945
  designTokens,
69918
- detectLanguage2 as detectLanguage,
69919
- disableScroll4 as disableScroll,
69946
+ detectLanguage,
69947
+ disableScroll,
69920
69948
  emailRegex,
69921
- enableScroll4 as enableScroll,
69949
+ enableScroll,
69922
69950
  filterObject,
69923
69951
  formatDate,
69924
69952
  formatHour,
@@ -69978,7 +70006,7 @@ export {
69978
70006
  linkifyText,
69979
70007
  passwordRegex,
69980
70008
  rgbToHex,
69981
- scrollToTop3 as scrollToTop,
70009
+ scrollToTop,
69982
70010
  slugify2 as slugify,
69983
70011
  sortByFrequency,
69984
70012
  stringifyPx3 as stringifyPx,