everyday-helper 1.2.13 → 1.3.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/README.md +12 -0
- package/{index.d.ts → dist/index.d.ts} +17 -6
- package/{index.js → dist/index.js} +515 -368
- package/package.json +18 -21
- package/styles/_globals.css +0 -0
- package/styles/abstracts/_animation.css +0 -129
- package/styles/abstracts/_globals.css +0 -1
- package/styles/styles/_globals.css +0 -0
- package/styles/styles/abstracts/_animation.css +0 -129
- package/styles/styles/abstracts/_globals.css +0 -1
package/README.md
CHANGED
|
@@ -67,6 +67,18 @@ session.has('temp_data'); // true
|
|
|
67
67
|
const allKeys = session.keys();
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
+
---
|
|
71
|
+
## tinyId - Unique ID Generator
|
|
72
|
+
```tsx
|
|
73
|
+
|
|
74
|
+
import { tinyId, timeId } from 'everyday-helper/lib';
|
|
75
|
+
|
|
76
|
+
console.log('Random ID:', tinyId()); // "V1StGXR8_Z5jdHi6B-myT"
|
|
77
|
+
console.log('Short ID:', tinyId(10)); // "aB3xK9pL2m"
|
|
78
|
+
console.log('Time-based ID:', timeId()); // "m8k3x2aB3xK9pL"
|
|
79
|
+
```
|
|
80
|
+
---
|
|
81
|
+
|
|
70
82
|
---
|
|
71
83
|
|
|
72
84
|
### cn - Class Name Utility
|
|
@@ -170,6 +170,19 @@ interface LazyLoadOptions {
|
|
|
170
170
|
*/
|
|
171
171
|
declare const lazyLoad: (componentMap: LazyComponentMap, options?: LazyLoadOptions) => LazyComponents;
|
|
172
172
|
|
|
173
|
+
/**
|
|
174
|
+
* Generate a unique ID
|
|
175
|
+
* @param {number} size - Length of the ID (default: 21)
|
|
176
|
+
* @returns {string} Random ID
|
|
177
|
+
*/
|
|
178
|
+
declare const tinyId: (size?: number) => string;
|
|
179
|
+
/**
|
|
180
|
+
* Generate a unique ID
|
|
181
|
+
* @param {number} size - Length of the ID (default: 21)
|
|
182
|
+
* @returns {string} Random ID
|
|
183
|
+
*/
|
|
184
|
+
declare const timeId: (size?: number) => string;
|
|
185
|
+
|
|
173
186
|
interface PrintStyle {
|
|
174
187
|
padding?: string;
|
|
175
188
|
maxWidth?: string;
|
|
@@ -187,7 +200,7 @@ declare function useMount(effect: EffectCallback): void;
|
|
|
187
200
|
interface UsePortalOptions {
|
|
188
201
|
id?: string;
|
|
189
202
|
}
|
|
190
|
-
declare const usePortal: ({ id }?: UsePortalOptions) => react.RefObject<HTMLElement>;
|
|
203
|
+
declare const usePortal: ({ id }?: UsePortalOptions) => react.RefObject<HTMLElement | null>;
|
|
191
204
|
|
|
192
205
|
declare const useToggle: () => {
|
|
193
206
|
isActive: boolean;
|
|
@@ -225,11 +238,11 @@ interface WindowSize {
|
|
|
225
238
|
declare function useWindowSize(): WindowSize;
|
|
226
239
|
|
|
227
240
|
declare const useAppLocation: () => {
|
|
228
|
-
pathname: string;
|
|
229
241
|
hash: string;
|
|
230
242
|
search: string;
|
|
231
243
|
isActive: (path: string) => boolean;
|
|
232
244
|
includes: (segment: string) => boolean;
|
|
245
|
+
pathname: string;
|
|
233
246
|
startsWith: (prefix: string) => boolean;
|
|
234
247
|
};
|
|
235
248
|
|
|
@@ -249,9 +262,8 @@ declare function useEventListener<K extends keyof WindowEventMap>(event: K, hand
|
|
|
249
262
|
|
|
250
263
|
declare const useResizeListener: (callback: () => void, active: boolean) => void;
|
|
251
264
|
|
|
252
|
-
declare const isServer: () => boolean;
|
|
253
265
|
declare const isBrowser: () => boolean;
|
|
254
|
-
declare const safeWindow: () => Window & typeof globalThis;
|
|
266
|
+
declare const safeWindow: () => (Window & typeof globalThis) | undefined;
|
|
255
267
|
|
|
256
268
|
/**
|
|
257
269
|
* Configuration for a shared feature endpoint.
|
|
@@ -784,7 +796,6 @@ declare function isString(v: unknown): boolean;
|
|
|
784
796
|
* @returns True if strings are equal (case-insensitive), false otherwise
|
|
785
797
|
*/
|
|
786
798
|
declare function eqIgnoreCase(s1: string, s2: string): boolean;
|
|
787
|
-
declare function removeBlobPrefix(blobUrl: string): string;
|
|
788
799
|
/**
|
|
789
800
|
* Checks if first string includes second string, ignoring case.
|
|
790
801
|
*
|
|
@@ -1238,4 +1249,4 @@ declare const bounceIn: (order?: number, className?: string, style?: CSSProperti
|
|
|
1238
1249
|
style: CSSProperties;
|
|
1239
1250
|
};
|
|
1240
1251
|
|
|
1241
|
-
export { type ClassValue, CookieManager, DateFormats, type DateInput, FormDataBuilder, type PrintStyle, addAsteriskIf, addToDate, animate, areAllValuesComplete, average, bounceIn, capitalize, capitalizeWords, checkArrEquality, chunk, cleanObject, clone, cn, compactArr, compactStr, compareDates, compose, concatIf, constant, convertBase64ToFile, convertFileToBase64, count, countOccurrences, createFormData, createStorage, curry, debounce, deepClone, deepFreeze, deepMerge, delay, difference, endOf, endsWith, entries, eqIgnoreCase, extractBase64FromDataUrl, fadeIn, fileToArrayBuffer, filterObject, first, firstSeveral, flatten, flattenDeep, flip, formatDate, formatDateRange, formatRelativeTime, fromPairs, generateQuery, get, getAge, getDateDifference, getEndpoint, getImageUrl, groupBy, has, hasAzerbaijanCountryCode, identity, includesIgnoreCase, intersection, invert, isBetweenDates, isBrowser, isEmpty, isEqual, isFuture, isLoggedIn, isNotEmpty, isNulOrUndefined, isObject, isPast, isSameDay,
|
|
1252
|
+
export { type ClassValue, CookieManager, DateFormats, type DateInput, FormDataBuilder, type PrintStyle, addAsteriskIf, addToDate, animate, areAllValuesComplete, average, bounceIn, capitalize, capitalizeWords, checkArrEquality, chunk, cleanObject, clone, cn, compactArr, compactStr, compareDates, compose, concatIf, constant, convertBase64ToFile, convertFileToBase64, count, countOccurrences, createFormData, createStorage, curry, debounce, deepClone, deepFreeze, deepMerge, delay, difference, endOf, endsWith, entries, eqIgnoreCase, extractBase64FromDataUrl, fadeIn, fileToArrayBuffer, filterObject, first, firstSeveral, flatten, flattenDeep, flip, formatDate, formatDateRange, formatRelativeTime, fromPairs, generateQuery, get, getAge, getDateDifference, getEndpoint, getImageUrl, groupBy, has, hasAzerbaijanCountryCode, identity, includesIgnoreCase, intersection, invert, isBetweenDates, isBrowser, isEmpty, isEqual, isFuture, isLoggedIn, isNotEmpty, isNulOrUndefined, isObject, isPast, isSameDay, isString, isStringSimilar, isToday, isTomorrow, isValidDate, isYesterday, keys, last, lastSeveral, lazyLoad, local, mapKeys, mapValues, max, memoize, merge, min, negate, noop, normalizePhone, normalizeWhitespace, now, omit, once, padEnd, padStart, parseDate, partial, partition, pick, pushIf, rateLimit, reject, repeat, retry, reverse, reverseArr, safeCall, safeWindow, sample, sampleSize, scaleIn, session, set, shuffle, slideInDown, slideInLeft, slideInRight, slideInUp, slugify, sortBy, startOf, startsWith, subtractFromDate, sum, throttle, timeId, tinyId, toCamelCase, toISOString, toKebabCase, toPascalCase, toSnakeCase, toUnixTimestamp, toUpperSnakeCase, trim, trimEnd, trimStart, truncate, tryCatch, tryCatchAsync, unflatten, union, unique, uniqueBy, useAppLocation, useDebounce, useDownloadFile, useEscapeKey, useEventListener, useInterval, useMediaQuery, useMount, useOnlineStatus, useOutsideClick, usePortal, usePrevious, usePrint, useResizeListener, useScrollLock, useToggle, useUnmount, useUpdateEffect, useWindowSize, values, withAzerbaijanCountryCode, without, zip };
|