@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.
@@ -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 {};
@@ -1,4 +1,4 @@
1
- import type { TPrimitive } from '@/types';
1
+ import type { TPrimitive } from '../types';
2
2
  /**
3
3
  * Represents a single form field item, containing its value, element ID, and related helper elements.
4
4
  *
@@ -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 '@/utils/general';
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 '@/utils/general';
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 () {
@@ -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 '@/constants';
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,5 @@
1
+ import type { ReactNode } from 'react';
2
+ export type TChildren = {
3
+ children: ReactNode;
4
+ };
5
+ export type TPrimitive = string | number | boolean;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,2 @@
1
- export type * from './general.d.ts';
2
- export type * from './meta.d.ts';
1
+ export type * from './general';
2
+ export type * from './meta';
@@ -0,0 +1,9 @@
1
+ import type { ApiMeta } from '../utils/api';
2
+ import type { EStatus } from './enum';
3
+ export type TStatus = {
4
+ type?: EStatus.Error | EStatus.Success | EStatus.Info | EStatus.Warning;
5
+ };
6
+ export type TMetaData<T> = {
7
+ meta: ApiMeta;
8
+ data: T;
9
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { TPrimitive } from '@/types';
1
+ import { TPrimitive } from '../types';
2
2
  export type TProgress = {
3
3
  loaded: number;
4
4
  total: number;
@@ -1,4 +1,4 @@
1
- import type { TFieldItem } from '@/hooks/form';
1
+ import type { TFieldItem } from '../hooks/form';
2
2
  /**
3
3
  * Validates a generic input field and updates its associated error element and label styling based on defined rules.
4
4
  *
@@ -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 '@/constants/regex';
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.1",
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",