@julseb-lib/react 1.0.23 → 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 };