@fajarmaulana/komerce-lp-helper 0.2.1 → 0.2.2
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/components/types.d.ts +9 -0
- package/dist/components/types.js +1 -0
- package/dist/hooks/form.d.ts +1 -1
- package/dist/hooks/form.js +1 -1
- package/dist/hooks/sectionObserver.js +1 -1
- package/dist/hooks/slider.js +1 -1
- package/dist/types/general.d.ts +5 -0
- package/dist/types/general.js +1 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/meta.d.ts +9 -0
- package/dist/types/meta.js +1 -0
- package/dist/utils/api.d.ts +1 -1
- package/dist/utils/error-provider.d.ts +1 -1
- package/dist/utils/error-provider.js +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
+
import type { TChildren } from '../types';
|
|
3
|
+
import type { TLazyBackground } from './hooks';
|
|
4
|
+
export type TFormProps = {
|
|
5
|
+
action: (formData: FormData) => void;
|
|
6
|
+
} & ComponentPropsWithRef<'form'> & TChildren;
|
|
7
|
+
export type TLazyBackgroundProps = {
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
} & TLazyBackground & ComponentPropsWithRef<'div'>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/hooks/form.d.ts
CHANGED
package/dist/hooks/form.js
CHANGED
|
@@ -26,7 +26,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
26
26
|
return ar;
|
|
27
27
|
};
|
|
28
28
|
import { useRef } from 'react';
|
|
29
|
-
import { getById } from '
|
|
29
|
+
import { getById } from '../utils/general';
|
|
30
30
|
/**
|
|
31
31
|
* A custom React hook for managing form fields and their associated elements.
|
|
32
32
|
*
|
|
@@ -15,7 +15,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
15
15
|
return ar;
|
|
16
16
|
};
|
|
17
17
|
import { useEffect } from 'react';
|
|
18
|
-
import { getById } from '
|
|
18
|
+
import { getById } from '../utils/general';
|
|
19
19
|
export var useSectionObserver = function (_a) {
|
|
20
20
|
var triggerRef = _a.triggerRef, targetId = _a.targetId, _b = _a.threshold, threshold = _b === void 0 ? 0.8 : _b;
|
|
21
21
|
useEffect(function () {
|
package/dist/hooks/slider.js
CHANGED
|
@@ -16,7 +16,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
16
16
|
};
|
|
17
17
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
18
18
|
import { useMemo, useRef, useState } from 'react';
|
|
19
|
-
import { MOBILE_BOUND } from '
|
|
19
|
+
import { MOBILE_BOUND } from '../constants';
|
|
20
20
|
/**
|
|
21
21
|
* Get slider position from an event, supports mobile touch events.
|
|
22
22
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type * from './general
|
|
2
|
-
export type * from './meta
|
|
1
|
+
export type * from './general';
|
|
2
|
+
export type * from './meta';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/utils/api.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
14
14
|
}
|
|
15
15
|
return ar;
|
|
16
16
|
};
|
|
17
|
-
import { ANY_LOWERCASE, ANY_NUMBER, ANY_SYMBOL, ANY_UPPERCASE, NO_SPACE } from '
|
|
17
|
+
import { ANY_LOWERCASE, ANY_NUMBER, ANY_SYMBOL, ANY_UPPERCASE, NO_SPACE } from '../constants/regex';
|
|
18
18
|
import { getByAny } from './general';
|
|
19
19
|
/**
|
|
20
20
|
* Validates a generic input field and updates its associated error element and label styling based on defined rules.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fajarmaulana/komerce-lp-helper",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Helper functions, hooks, and utils for Komerce LP",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"dist"
|
|
9
9
|
],
|
|
10
10
|
"scripts": {
|
|
11
|
-
"build": "tsc"
|
|
11
|
+
"build": "tsc && tsc-alias"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"react": ">=19",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"globals": "^15.14.0",
|
|
36
36
|
"prettier": "^3.6.2",
|
|
37
37
|
"react-router-dom": "^7.11.0",
|
|
38
|
+
"tsc-alias": "^1.8.16",
|
|
38
39
|
"typescript": "^5.2.0"
|
|
39
40
|
},
|
|
40
41
|
"author": "Fajar Maulana",
|