@julseb-lib/react 1.0.24 → 1.0.26
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.cjs +145 -112
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +84 -2
- package/dist/index.d.ts +84 -2
- package/dist/index.js +49 -20
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
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,
|
|
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,
|
|
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);
|
|
@@ -3454,6 +3486,7 @@ var Avatar = ({
|
|
|
3454
3486
|
}) => {
|
|
3455
3487
|
const Element = element;
|
|
3456
3488
|
const avatarProps = {
|
|
3489
|
+
element,
|
|
3457
3490
|
className,
|
|
3458
3491
|
ref,
|
|
3459
3492
|
children,
|
|
@@ -67268,7 +67301,6 @@ var Alert = ({
|
|
|
67268
67301
|
// src/lib/components/Modal/Modal.tsx
|
|
67269
67302
|
import { useRef as useRef12 } from "react";
|
|
67270
67303
|
import { BiX as BiX4 } from "react-icons/bi";
|
|
67271
|
-
import { enableScroll } from "@julseb-lib/utils";
|
|
67272
67304
|
import { jsx as jsx336, jsxs as jsxs279 } from "react/jsx-runtime";
|
|
67273
67305
|
var Modal = ({
|
|
67274
67306
|
className,
|
|
@@ -68526,7 +68558,6 @@ var Cover = ({
|
|
|
68526
68558
|
|
|
68527
68559
|
// src/lib/components/PageLoading/PageLoading.tsx
|
|
68528
68560
|
import { useEffect as useEffect13 } from "react";
|
|
68529
|
-
import { disableScroll } from "@julseb-lib/utils";
|
|
68530
68561
|
import { jsx as jsx353 } from "react/jsx-runtime";
|
|
68531
68562
|
var PageLoading = ({
|
|
68532
68563
|
className,
|
|
@@ -69207,7 +69238,6 @@ var Fade = ({
|
|
|
69207
69238
|
// src/lib/components/BackToTop/BackToTop.tsx
|
|
69208
69239
|
import { useEffect as useEffect15, useState as useState26 } from "react";
|
|
69209
69240
|
import { BiUpArrowAlt } from "react-icons/bi";
|
|
69210
|
-
import { scrollToTop as scrollToTop2 } from "@julseb-lib/utils";
|
|
69211
69241
|
import { jsx as jsx363 } from "react/jsx-runtime";
|
|
69212
69242
|
var BackToTop = ({
|
|
69213
69243
|
className,
|
|
@@ -69233,7 +69263,7 @@ var BackToTop = ({
|
|
|
69233
69263
|
const smoothScroll = () => {
|
|
69234
69264
|
document.body.classList.add("smooth");
|
|
69235
69265
|
document.documentElement.classList.add("smooth");
|
|
69236
|
-
setTimeout(() =>
|
|
69266
|
+
setTimeout(() => scrollToTop(), 100);
|
|
69237
69267
|
setTimeout(() => {
|
|
69238
69268
|
document.body.classList.remove("smooth");
|
|
69239
69269
|
document.documentElement.classList.remove("smooth");
|
|
@@ -69270,7 +69300,7 @@ var BackToTop = ({
|
|
|
69270
69300
|
// src/lib/components/Drawer/Drawer.tsx
|
|
69271
69301
|
import { useEffect as useEffect16, useRef as useRef18 } from "react";
|
|
69272
69302
|
import { BiX as BiX5 } from "react-icons/bi";
|
|
69273
|
-
import {
|
|
69303
|
+
import { stringifyPx } from "@julseb-lib/utils";
|
|
69274
69304
|
import { jsx as jsx364, jsxs as jsxs291 } from "react/jsx-runtime";
|
|
69275
69305
|
var Drawer = ({
|
|
69276
69306
|
className,
|
|
@@ -69298,8 +69328,8 @@ var Drawer = ({
|
|
|
69298
69328
|
if (!disableEsc && isOpen) setIsOpen(false);
|
|
69299
69329
|
});
|
|
69300
69330
|
useEffect16(() => {
|
|
69301
|
-
if (!enableScrollingOpen && isOpen)
|
|
69302
|
-
else
|
|
69331
|
+
if (!enableScrollingOpen && isOpen) disableScroll();
|
|
69332
|
+
else enableScroll();
|
|
69303
69333
|
}, [enableScrollingOpen, isOpen]);
|
|
69304
69334
|
return /* @__PURE__ */ jsxs291(
|
|
69305
69335
|
Element,
|
|
@@ -69365,7 +69395,6 @@ var Drawer = ({
|
|
|
69365
69395
|
|
|
69366
69396
|
// src/lib/components/Header/Header.tsx
|
|
69367
69397
|
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
69398
|
|
|
69370
69399
|
// src/lib/components/Header/HeaderSearch.tsx
|
|
69371
69400
|
import "react";
|
|
@@ -69448,11 +69477,11 @@ var Header = ({
|
|
|
69448
69477
|
const [isOpen, setIsOpen] = useState27(false);
|
|
69449
69478
|
const [isHidden, setIsHidden] = useState27(false);
|
|
69450
69479
|
const handleOpen = () => {
|
|
69451
|
-
if (!enableScrollingOpen)
|
|
69480
|
+
if (!enableScrollingOpen) disableScroll();
|
|
69452
69481
|
setIsOpen(true);
|
|
69453
69482
|
};
|
|
69454
69483
|
const handleClose = () => {
|
|
69455
|
-
if (!enableScrollingOpen)
|
|
69484
|
+
if (!enableScrollingOpen) enableScroll();
|
|
69456
69485
|
setTimeout(() => setIsOpen(false), 10);
|
|
69457
69486
|
};
|
|
69458
69487
|
useEffect17(() => {
|
|
@@ -69915,10 +69944,10 @@ export {
|
|
|
69915
69944
|
countries,
|
|
69916
69945
|
deleteDuplicates,
|
|
69917
69946
|
designTokens,
|
|
69918
|
-
|
|
69919
|
-
|
|
69947
|
+
detectLanguage,
|
|
69948
|
+
disableScroll,
|
|
69920
69949
|
emailRegex,
|
|
69921
|
-
|
|
69950
|
+
enableScroll,
|
|
69922
69951
|
filterObject,
|
|
69923
69952
|
formatDate,
|
|
69924
69953
|
formatHour,
|
|
@@ -69978,7 +70007,7 @@ export {
|
|
|
69978
70007
|
linkifyText,
|
|
69979
70008
|
passwordRegex,
|
|
69980
70009
|
rgbToHex,
|
|
69981
|
-
|
|
70010
|
+
scrollToTop,
|
|
69982
70011
|
slugify2 as slugify,
|
|
69983
70012
|
sortByFrequency,
|
|
69984
70013
|
stringifyPx3 as stringifyPx,
|