spotlibs-components 0.1.11 → 0.1.13

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.
Files changed (50) hide show
  1. package/dist/{components/atoms → atoms}/icons/index.mjs +2 -2
  2. package/dist/{components/index.d.mts → index.d.mts} +1 -1
  3. package/dist/{components/index.mjs → index.mjs} +490 -678
  4. package/dist/index.mjs.map +1 -0
  5. package/dist/{components/mui → mui}/index.mjs +1 -1
  6. package/dist/{types-BkrxwBFm.d.mts → types-D1akE7ak.d.mts} +87 -149
  7. package/dist/types.d.mts +4 -0
  8. package/dist/utils/index.d.mts +104 -184
  9. package/package.json +3 -2
  10. package/src/utils/admin-kuota-nasional/constant.d.ts +23 -0
  11. package/src/utils/asset.d.ts +1 -0
  12. package/src/utils/booleanUtils.d.ts +2 -0
  13. package/src/utils/briguna-digital/constant.d.ts +2 -0
  14. package/src/utils/compress.d.ts +2 -0
  15. package/src/utils/compressImage.d.ts +6 -0
  16. package/src/utils/constants.d.ts +5 -0
  17. package/src/utils/cookies.d.ts +19 -0
  18. package/src/utils/crypto.d.ts +5 -0
  19. package/src/utils/decodeString.d.ts +1 -0
  20. package/src/utils/disableFormElements.d.ts +5 -0
  21. package/src/utils/excelUtils.d.ts +25 -0
  22. package/src/utils/exception.d.ts +19 -0
  23. package/src/utils/formatString.d.ts +25 -0
  24. package/src/utils/formatters/account.d.ts +2 -0
  25. package/src/utils/formatters/currency.d.ts +20 -0
  26. package/src/utils/formatters/date.d.ts +12 -0
  27. package/src/utils/formatters/index.d.ts +47 -0
  28. package/src/utils/formatters/string.d.ts +6 -0
  29. package/src/utils/generateImportExcel.d.ts +35 -0
  30. package/src/utils/generateTimestamp.d.ts +1 -0
  31. package/src/utils/handleApiError.d.ts +1 -0
  32. package/src/utils/index.d.ts +104 -0
  33. package/src/utils/json.d.ts +4 -0
  34. package/src/utils/localStorage.d.ts +1 -0
  35. package/src/utils/logger.d.ts +4 -0
  36. package/src/utils/schema/globalSchema.d.ts +8 -0
  37. package/src/utils/signature.d.ts +10 -0
  38. package/src/utils/specifics/korporasi/prakarsaKorporasiUtils.d.ts +5 -0
  39. package/src/utils/specifics/mikro/validationMaintenanceAgunanUtils.d.ts +2 -0
  40. package/src/utils/status.d.ts +37 -0
  41. package/src/utils/stringUtils.d.ts +22 -0
  42. package/src/utils/tipeBank.d.ts +3 -0
  43. package/dist/components/index.mjs.map +0 -1
  44. package/dist/components/types.d.mts +0 -4
  45. /package/dist/{components/atoms → atoms}/icons/index.d.mts +0 -0
  46. /package/dist/{components/atoms → atoms}/icons/index.mjs.map +0 -0
  47. /package/dist/{components/mui → mui}/index.d.mts +0 -0
  48. /package/dist/{components/mui → mui}/index.mjs.map +0 -0
  49. /package/dist/{components/types.mjs → types.mjs} +0 -0
  50. /package/dist/{components/types.mjs.map → types.mjs.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import '../../chunk-YOSPWY5K.mjs';
2
+ import '../chunk-YOSPWY5K.mjs';
3
3
  export { default as Box } from '@mui/material/Box';
4
4
  export { default as Stack } from '@mui/material/Stack';
5
5
  export { default as Grid } from '@mui/material/Grid';
@@ -243,7 +243,7 @@ declare const SpacingToken: {
243
243
  spacing10: string;
244
244
  };
245
245
 
246
- declare const CONTENT_SPACING_TOKENS: {
246
+ declare const CONTENT_SPACING_TOKENS: {
247
247
  spacing_1: {
248
248
  mobile: string;
249
249
  tablet: string;
@@ -258,41 +258,41 @@ declare const CONTENT_SPACING_TOKENS: {
258
258
  mobile: string;
259
259
  tablet: string;
260
260
  web: string;
261
- };
262
- };
263
-
264
- interface ResponsiveSpacingValue {
265
- mobile?: string;
266
- tablet?: string;
267
- web?: string;
268
- [key: string]: string | undefined;
269
- }
270
-
271
- type SpacingSizeValue = keyof typeof SpacingToken | string | number;
272
-
273
- type ContentSpacingSizeValue =
274
- | keyof typeof CONTENT_SPACING_TOKENS
275
- | ResponsiveSpacingValue;
276
-
277
- interface SpacingProps {
278
- size?: SpacingSizeValue;
279
- axis?: "vertical" | "horizontal";
280
- as?: React.ElementType;
281
- className?: string;
282
- style?: React.CSSProperties;
283
- children?: React.ReactNode;
284
- [key: string]: unknown;
285
- }
286
-
287
- interface ContentSpacingProps {
288
- size?: ContentSpacingSizeValue;
289
- breakpoint?: "mobile" | "tablet" | "web";
290
- as?: React.ElementType;
291
- className?: string;
292
- style?: React.CSSProperties;
293
- children?: React.ReactNode;
294
- [key: string]: unknown;
295
- }
261
+ };
262
+ };
263
+
264
+ interface ResponsiveSpacingValue {
265
+ mobile?: string;
266
+ tablet?: string;
267
+ web?: string;
268
+ [key: string]: string | undefined;
269
+ }
270
+
271
+ type SpacingSizeValue = keyof typeof SpacingToken | string | number;
272
+
273
+ type ContentSpacingSizeValue =
274
+ | keyof typeof CONTENT_SPACING_TOKENS
275
+ | ResponsiveSpacingValue;
276
+
277
+ interface SpacingProps {
278
+ size?: SpacingSizeValue;
279
+ axis?: "vertical" | "horizontal";
280
+ as?: React.ElementType;
281
+ className?: string;
282
+ style?: React.CSSProperties;
283
+ children?: React.ReactNode;
284
+ [key: string]: unknown;
285
+ }
286
+
287
+ interface ContentSpacingProps {
288
+ size?: ContentSpacingSizeValue;
289
+ breakpoint?: "mobile" | "tablet" | "web";
290
+ as?: React.ElementType;
291
+ className?: string;
292
+ style?: React.CSSProperties;
293
+ children?: React.ReactNode;
294
+ [key: string]: unknown;
295
+ }
296
296
 
297
297
  declare const Spacing: React.FC<SpacingProps>;
298
298
 
@@ -380,52 +380,6 @@ interface BaseButtonProps {
380
380
 
381
381
  declare function BaseButton(props: BaseButtonProps): React.ReactElement;
382
382
 
383
- interface BaseSkeletonProps {
384
- /**
385
- * Skeleton shape variant.
386
- * - `text` — single line of text placeholder
387
- * - `rectangular` — rectangle block placeholder
388
- * - `rounded` — rectangle with border-radius
389
- * - `circular` — circle placeholder (avatar, icon)
390
- */
391
- variant?: "text" | "rectangular" | "rounded" | "circular";
392
- /**
393
- * Animation type.
394
- * - `pulse` — fading animation (default)
395
- * - `wave` — wave sweep animation
396
- * - `none` — no animation (static)
397
- */
398
- animation?: "pulse" | "wave" | "none";
399
- /** Width of the skeleton. Accepts number (px) or string (e.g. "100%", "200px") */
400
- width?: number | string;
401
- /** Height of the skeleton. Accepts number (px) or string (e.g. "40px", "1.2em") */
402
- height?: number | string;
403
- /** Number of skeleton lines to render. If > 1, renders stacked skeletons. */
404
- count?: number;
405
- /** Gap between stacked skeletons when count > 1. Default is SpacingToken.spacing2 */
406
- gap?: string | number;
407
- /** MUI sx overrides */
408
- sx?: SxProps;
409
- [key: string]: any;
410
- }
411
-
412
- declare function BaseSkeleton(props: BaseSkeletonProps): React.ReactElement;
413
-
414
- interface BaseSwitchProps {
415
- /** Current switch state */
416
- status?: boolean;
417
- /** Label text or element */
418
- label?: React.ReactNode;
419
- /** Label position relative to the switch */
420
- labelPlacement?: "start" | "end" | "top" | "bottom";
421
- /** Disabled state */
422
- isDisabled?: boolean;
423
- /** Change handler */
424
- onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
425
- }
426
-
427
- declare function BaseSwitch(props: BaseSwitchProps): React.ReactElement;
428
-
429
383
  interface BaseCardProps {
430
384
  /** Card variant type */
431
385
  variant?: "default" | "with-header" | "with-header-footer";
@@ -455,10 +409,6 @@ interface BaseCardProps {
455
409
  showEndIcon?: boolean;
456
410
  /** Footer content (only for with-header-footer variant) */
457
411
  footer?: React.ReactNode;
458
- /** Enable watermark overlay on content area */
459
- isWatermark?: boolean;
460
- /** Watermark text (e.g. "000000 / Nama Lengkap") */
461
- watermarkText?: string;
462
412
  /** MUI sx overrides */
463
413
  sx?: SxProps;
464
414
  [key: string]: any;
@@ -466,32 +416,20 @@ interface BaseCardProps {
466
416
 
467
417
  declare function BaseCard(props: BaseCardProps): React.ReactElement;
468
418
 
469
- interface BaseSnackbarPosition {
470
- vertical: "top" | "bottom";
471
- horizontal: "left" | "center" | "right";
472
- }
473
-
474
- interface BaseSnackbarProps {
475
- /** Whether the snackbar is open */
476
- open?: boolean;
477
- /** Close handler */
478
- onClose?: (event?: React.SyntheticEvent | Event, reason?: string) => void;
479
- /** Snackbar message content */
480
- message?: string;
481
- /** Color variant */
482
- variant?: "success" | "error" | "info" | "warning" | "default";
483
- /** Auto hide duration in milliseconds */
484
- duration?: number;
485
- /** Anchor origin position */
486
- position?: BaseSnackbarPosition;
487
- /** Icon element or component. If not provided, no icon is shown. */
488
- icon?: React.ReactNode | React.ComponentType<any>;
489
- /** MUI sx overrides */
490
- sx?: SxProps;
491
- [key: string]: any;
419
+ interface BaseSwitchProps {
420
+ /** Current switch state */
421
+ status?: boolean;
422
+ /** Label text or element */
423
+ label?: React.ReactNode;
424
+ /** Label position relative to the switch */
425
+ labelPlacement?: "start" | "end" | "top" | "bottom";
426
+ /** Disabled state */
427
+ isDisabled?: boolean;
428
+ /** Change handler */
429
+ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
492
430
  }
493
431
 
494
- declare function BaseSnackbar(props: BaseSnackbarProps): React.ReactElement;
432
+ declare function BaseSwitch(props: BaseSwitchProps): React.ReactElement;
495
433
 
496
434
  interface BaseCheckboxOption {
497
435
  /** Label yang ditampilkan */
@@ -543,25 +481,25 @@ declare function BaseCheckbox(
543
481
  props: BaseCheckboxProps,
544
482
  ): React.ReactElement | null;
545
483
 
546
- type BaseDatatableAlign =
547
- | "left"
548
- | "center"
549
- | "right"
550
- | "justify"
551
- | "inherit"
552
- | (string & {});
553
-
554
- interface BaseDatatableColumn<T = Record<string, any>> {
555
- id?: string;
556
- key?: string;
557
- field?: string;
558
- sortField?: string;
559
- label?: ReactNode;
560
- header?: ReactNode;
561
- accessorKey?: string;
562
- accessorFn?: (row: T) => any;
563
- align?: BaseDatatableAlign;
564
- headerAlign?: BaseDatatableAlign;
484
+ type BaseDatatableAlign =
485
+ | "left"
486
+ | "center"
487
+ | "right"
488
+ | "justify"
489
+ | "inherit"
490
+ | (string & {});
491
+
492
+ interface BaseDatatableColumn<T = Record<string, any>> {
493
+ id?: string;
494
+ key?: string;
495
+ field?: string;
496
+ sortField?: string;
497
+ label?: ReactNode;
498
+ header?: ReactNode;
499
+ accessorKey?: string;
500
+ accessorFn?: (row: T) => any;
501
+ align?: BaseDatatableAlign;
502
+ headerAlign?: BaseDatatableAlign;
565
503
  width?: number;
566
504
  minWidth?: number;
567
505
  sticky?: "left" | "right";
@@ -580,11 +518,11 @@ interface BaseDatatableColumn<T = Record<string, any>> {
580
518
  }) => ReactNode;
581
519
  }
582
520
 
583
- interface BaseDatatableHeaderCell {
584
- id?: string;
585
- key?: string;
586
- label: ReactNode;
587
- align?: BaseDatatableAlign;
521
+ interface BaseDatatableHeaderCell {
522
+ id?: string;
523
+ key?: string;
524
+ label: ReactNode;
525
+ align?: BaseDatatableAlign;
588
526
  colSpan?: number;
589
527
  rowSpan?: number;
590
528
  colspan?: number;
@@ -615,12 +553,12 @@ interface BaseDatatableSortState {
615
553
  direction: "asc" | "desc";
616
554
  }
617
555
 
618
- interface BaseDatatableSortPayload {
619
- orderBy: string;
620
- order: "asc" | "desc";
621
- page: number;
622
- rowsPerPage: number;
623
- }
556
+ interface BaseDatatableSortPayload {
557
+ orderBy: string;
558
+ order: "asc" | "desc";
559
+ page: number;
560
+ rowsPerPage: number;
561
+ }
624
562
 
625
563
  interface BaseDatatableLayout {
626
564
  stickyHeader?: boolean;
@@ -686,14 +624,14 @@ interface BaseDatatableProps<T = Record<string, any>> {
686
624
  layout?: BaseDatatableLayout;
687
625
  selection?: BaseDatatableSelection<T>;
688
626
  pagination?: BaseDatatablePagination;
689
- renderRow?: (context: BaseDatatableRenderRowContext<T>) => ReactNode;
690
- onRowClick?: (row: T, rowIndex: number) => void;
691
- getRowId?: (row: T, rowIndex: number) => string | number;
692
- emptyState?: ReactNode;
693
- loading?: boolean;
694
- loadingText?: ReactNode;
695
- rowHover?: boolean;
696
- activeRowId?: string | number | null;
627
+ renderRow?: (context: BaseDatatableRenderRowContext<T>) => ReactNode;
628
+ onRowClick?: (row: T, rowIndex: number) => void;
629
+ getRowId?: (row: T, rowIndex: number) => string | number;
630
+ emptyState?: ReactNode;
631
+ loading?: boolean;
632
+ loadingText?: ReactNode;
633
+ rowHover?: boolean;
634
+ activeRowId?: string | number | null;
697
635
  containerSx?: SxProps;
698
636
  tableSx?: SxProps;
699
637
  }
@@ -1143,4 +1081,4 @@ declare function BaseModalOTP(
1143
1081
  props: BaseModalOTPProps,
1144
1082
  ): React.ReactElement | null;
1145
1083
 
1146
- export { type BaseRadioButtonProps as $, type BaseCheckboxOption as A, BaseAlert as B, CONTENT_SPACING_TOKENS as C, DerivedColor as D, type BaseCheckboxProps as E, type BaseDatatableAlign as F, type BaseDatatableColumn as G, type BaseDatatableFeatures as H, type BaseDatatableHeaderCell as I, type BaseDatatableLayout as J, type BaseDatatablePagination as K, type BaseDatatableProps as L, type BaseDatatableSelection as M, type BaseDatatableSortPayload as N, type BaseDatatableSortState as O, PrimitiveColor as P, type BaseDatePickerProps as Q, Radius as R, Shadow as S, TextFieldUpload as T, type BaseDropdownProps as U, VariantStyles as V, type BaseDropzoneProps as W, type BaseModalOTPProps as X, type BaseModalProps as Y, type BaseModalStepperProps as Z, type BaseModalStepperStep as _, BaseButton as a, type BaseSkeletonProps as a0, type BaseSnackbarPosition as a1, type BaseSnackbarProps as a2, type BaseStepperDashboardStep as a3, type BaseStepperProps as a4, type BaseStepperSimpleStep as a5, type BaseSwitchProps as a6, type BaseTextAreaProps as a7, type BaseTextFieldProps as a8, type ContentSpacingProps as a9, type DerivedColorType as aa, type PrimitiveColorType as ab, type RadiusLevel as ac, type RadiusMap as ad, type RadiusTokenProps as ae, type ShadowElevation as af, type ShadowLevel as ag, type ShadowMap as ah, type ShadowTokenProps as ai, type SpacingProps as aj, type TextFieldUploadProps as ak, type TypographyColor as al, type TypographyProps as am, type TypographyVariant as an, BaseCard as b, BaseCheckbox as c, BaseDatatable as d, BaseDatePicker as e, BaseDropdown as f, BaseDropzone as g, BaseModal as h, BaseModalOTP as i, BaseModalStepper as j, BaseRadioButton as k, BaseSkeleton as l, BaseSnackbar as m, BaseStepper as n, BaseSwitch as o, BaseTextArea as p, BaseTextField as q, BaseTypography as r, ContentSpacing as s, RadiusToken as t, ShadowToken as u, Spacing as v, SpacingToken as w, type BaseAlertProps as x, type BaseButtonProps as y, type BaseCardProps as z };
1084
+ export { type BaseStepperProps as $, type BaseDatatableAlign as A, BaseAlert as B, CONTENT_SPACING_TOKENS as C, DerivedColor as D, type BaseDatatableColumn as E, type BaseDatatableFeatures as F, type BaseDatatableHeaderCell as G, type BaseDatatableLayout as H, type BaseDatatablePagination as I, type BaseDatatableProps as J, type BaseDatatableSelection as K, type BaseDatatableSortPayload as L, type BaseDatatableSortState as M, type BaseDatePickerProps as N, type BaseDropdownProps as O, PrimitiveColor as P, type BaseDropzoneProps as Q, Radius as R, Shadow as S, TextFieldUpload as T, type BaseModalOTPProps as U, VariantStyles as V, type BaseModalProps as W, type BaseModalStepperProps as X, type BaseModalStepperStep as Y, type BaseRadioButtonProps as Z, type BaseStepperDashboardStep as _, BaseButton as a, type BaseStepperSimpleStep as a0, type BaseSwitchProps as a1, type BaseTextAreaProps as a2, type BaseTextFieldProps as a3, type ContentSpacingProps as a4, type DerivedColorType as a5, type PrimitiveColorType as a6, type RadiusLevel as a7, type RadiusMap as a8, type RadiusTokenProps as a9, type ShadowElevation as aa, type ShadowLevel as ab, type ShadowMap as ac, type ShadowTokenProps as ad, type SpacingProps as ae, type TextFieldUploadProps as af, type TypographyColor as ag, type TypographyProps as ah, type TypographyVariant as ai, BaseCard as b, BaseCheckbox as c, BaseDatatable as d, BaseDatePicker as e, BaseDropdown as f, BaseDropzone as g, BaseModal as h, BaseModalOTP as i, BaseModalStepper as j, BaseRadioButton as k, BaseStepper as l, BaseSwitch as m, BaseTextArea as n, BaseTextField as o, BaseTypography as p, ContentSpacing as q, RadiusToken as r, ShadowToken as s, Spacing as t, SpacingToken as u, type BaseAlertProps as v, type BaseButtonProps as w, type BaseCardProps as x, type BaseCheckboxOption as y, type BaseCheckboxProps as z };
@@ -0,0 +1,4 @@
1
+ export { v as BaseAlertProps, w as BaseButtonProps, x as BaseCardProps, y as BaseCheckboxOption, z as BaseCheckboxProps, A as BaseDatatableAlign, E as BaseDatatableColumn, F as BaseDatatableFeatures, G as BaseDatatableHeaderCell, H as BaseDatatableLayout, I as BaseDatatablePagination, J as BaseDatatableProps, K as BaseDatatableSelection, L as BaseDatatableSortPayload, M as BaseDatatableSortState, N as BaseDatePickerProps, O as BaseDropdownProps, Q as BaseDropzoneProps, U as BaseModalOTPProps, W as BaseModalProps, X as BaseModalStepperProps, Y as BaseModalStepperStep, Z as BaseRadioButtonProps, _ as BaseStepperDashboardStep, $ as BaseStepperProps, a0 as BaseStepperSimpleStep, a1 as BaseSwitchProps, a2 as BaseTextAreaProps, a3 as BaseTextFieldProps, a4 as ContentSpacingProps, a5 as DerivedColorType, a6 as PrimitiveColorType, a7 as RadiusLevel, a8 as RadiusMap, a9 as RadiusTokenProps, aa as ShadowElevation, ab as ShadowLevel, ac as ShadowMap, ad as ShadowTokenProps, ae as SpacingProps, af as TextFieldUploadProps, ag as TypographyColor, ah as TypographyProps, ai as TypographyVariant } from './types-D1akE7ak.mjs';
2
+ import 'react';
3
+ import '@mui/material/styles';
4
+ import 'react-hook-form';
@@ -1,186 +1,106 @@
1
- declare function callAsset(uri?: string): string;
2
-
3
- declare function generateVcifId(): string;
4
-
5
- declare function getLocalStorageItem(key: any): any;
6
-
7
- declare function getTipeBankKorporasi(data: any): string;
8
-
9
- /**
10
- * Account & ID Number Formatting Utilities
11
- *
12
- * Konsolidasi dari:
13
- * - formatString.js (dashedAccount, dashedNPWP)
14
- * - formatters.js (formatAccountNumber)
15
- * - stringUtils.js (rekeningFormatter, npwpFormatter)
16
- */
17
- /**
18
- * Format nomor rekening dengan dash separator.
19
- * Mendukung berbagai panjang nomor rekening (progressive formatting).
20
- * @param {string} value - Nomor rekening (bisa mengandung karakter non-numerik)
21
- * @returns {string} Nomor rekening terformat (e.g., "0012-01-123456-01-1")
22
- *
23
- * @example
24
- * formatAccountNumber("001201123456011") // "0012-01-123456-01-1"
25
- * formatAccountNumber("00120112345601") // "0012-01-123456-01"
26
- * formatAccountNumber("0012011") // "0012-01-1"
27
- */
28
- declare function formatAccountNumber(value: string): string;
29
- /**
30
- * Format nomor NPWP dengan dot dan dash separator.
31
- * Mendukung format NPWP 15 digit dan 16 digit (format baru).
32
- * @param {string} value - Nomor NPWP
33
- * @returns {string} NPWP terformat (e.g., "01.234.567.8-901.234")
34
- *
35
- * @example
36
- * formatNPWP("0123456789012345") // "01.234.567.8-901.2345"
37
- * formatNPWP("012345678901234") // "01.234.567.8-901.234"
38
- * formatNPWP("012345678") // "01.234.567.8"
39
- */
40
- declare function formatNPWP(value: string): string;
41
-
42
- declare function formatCurrency$1(value: number | string, { locale, currency, minFractionDigits, maxFractionDigits, }?: {
43
- locale: string;
44
- currency: string;
45
- minFractionDigits: number;
46
- maxFractionDigits: number;
47
- }): string;
48
- declare function formatRupiah(value: number | string): string;
49
- declare function formatNominal$1(value: number | string, { locale, minFractionDigits, maxFractionDigits, decimalSeparator, }?: {
50
- locale: string;
51
- minFractionDigits: number;
52
- maxFractionDigits: number;
53
- decimalSeparator: string;
54
- }): string;
55
- declare function formatDigit(value: number | string): string;
56
-
57
- declare function toYearFirstDash(value: Date | string): string;
58
- declare function toDateFirstSlash(value: Date | string): string;
59
- declare function formatDateToDDSlashMMSlashYYYY(date: Date): string;
60
- declare function formatDateToDDMMYYYY(date: Date): string;
61
- declare function yearFirstDashToDateFirstDash(value: string): string;
62
- declare function yearFirstDashToDateFirstSlash(value: string): string;
63
- declare function dateFirstSlashToYearFirstDash(value: string): string;
64
- declare function sevenDigitToDateFirstSlash(value: string): string;
65
- declare function sevenDigitToYearFirstDash(value: string): string;
66
- declare function sevenDigitToDateFirstDash(value: string): string;
67
- declare function toDateTimeHourMinute(value: string): string;
68
- declare function ddmmyyToSlashDate(value: string): string;
69
-
70
- /**
71
- * Konversi snake_case ke Title Case With Spaces.
72
- * @param {string} snakeStr - Snake case string
73
- * @returns {string} Title case with spaces
74
- *
75
- * @example
76
- * snakeToCamelWithSpace("hello_world") // "Hello World"
77
- * snakeToCamelWithSpace("user_full_name") // "User Full Name"
78
- */
79
- declare function snakeToCamelWithSpace(snakeStr: string): string;
80
- /**
81
- * Cek apakah target string mengandung salah satu dari values.
82
- * @param {string} targetStr - String yang akan dicek
83
- * @param {string[]} values - Array of substrings to match
84
- * @returns {boolean} True jika salah satu value ditemukan
85
- *
86
- * @example
87
- * matchWiths("hello world", ["hello", "foo"]) // true
88
- * matchWiths("hello world", ["foo", "bar"]) // false
89
- */
90
- declare function matchWiths(targetStr: string, values?: string[]): boolean;
91
- declare function formatResponseDesc$1(desc: string): string;
92
- declare function titleCase$1(str: string): string;
93
- declare function stringToBoolean$1(str: string): boolean | undefined;
94
- declare function maskString(value: string, type: string): string;
95
-
96
- declare function parseJSON(value: any): any;
97
- declare function jsonToStringLimiter(value?: any): any;
98
- declare function errorState(name: any, errors: any): any;
99
- declare function ascendingStringify(obj: any): any;
100
-
101
- declare function checkRoleUser(roles: any, listRole: any): boolean;
102
- declare function toggleUsingDummyWbenchEndpoint(status: any): boolean;
103
-
104
- declare const NOT_AUTHORIZE_RESPONSE_CODE: string[];
105
- declare const PUBLIC_PATHS: string[];
106
- declare const COOKIE_MAX_SIZE: 2000;
107
- declare const CLIENT_PUBLIC_API_ROUTES: string[];
108
- declare const CLIENT_ALLOWED_ORIGINS: (string | RegExp)[];
109
-
110
- declare function disableFormElements(selector: any): void;
111
- declare function disableFormBuilder(fields: any, roleAccess: any): any;
112
-
113
- /**
114
- * Cek apakah responseCode termasuk exception.
115
- * @param {string} responseCode - Response code dari API
116
- * @returns {boolean} True jika code ada di daftar exception
117
- *
118
- * @example
119
- * isExceptionCode("00") // false (success)
120
- * isExceptionCode("X0") // true (header exception)
121
- * isExceptionCode("02") // true (not found)
122
- */
123
- declare function isExceptionCode(responseCode: string): boolean;
124
- /**
125
- * Get human-readable message dari exception code.
126
- * @param {string} responseCode - Response code dari API
127
- * @returns {string} Exception message
128
- *
129
- * @example
130
- * getExceptionMessage("X1") // "Access denied"
131
- * getExceptionMessage("99") // "Internal system error"
132
- * getExceptionMessage("unknown") // "An unexpected error occurred"
133
- */
1
+ // Formatters - Currency
2
+ declare function formatCurrency(
3
+ value: number | string | null | undefined,
4
+ options?: {
5
+ locale?: string;
6
+ currency?: string;
7
+ minFractionDigits?: number;
8
+ maxFractionDigits?: number;
9
+ }
10
+ ): string;
11
+ declare function formatRupiah(value: number | string | null | undefined): string;
12
+ declare function formatNominal(
13
+ value: number | string | null | undefined,
14
+ options?: {
15
+ locale?: string;
16
+ minFractionDigits?: number;
17
+ maxFractionDigits?: number;
18
+ decimalSeparator?: string;
19
+ }
20
+ ): string;
21
+ declare function formatDigit(value: number | string): string;
22
+
23
+ // Formatters - Account
24
+ declare function formatAccountNumber(value: string | null | undefined): string;
25
+ declare function formatNPWP(value: string | null | undefined): string;
26
+
27
+ // Formatters - Date
28
+ declare function toYearFirstDash(value: Date | string): string;
29
+ declare function toDateFirstSlash(value: Date | string): string;
30
+ declare function formatDateToDDSlashMMSlashYYYY(date: Date): string;
31
+ declare function formatDateToDDMMYYYY(date: Date): string;
32
+ declare function yearFirstDashToDateFirstDash(value: string): string;
33
+ declare function yearFirstDashToDateFirstSlash(value: string): string;
34
+ declare function dateFirstSlashToYearFirstDash(value: string): string;
35
+ declare function sevenDigitToDateFirstSlash(value: string): string;
36
+ declare function sevenDigitToYearFirstDash(value: string): string;
37
+ declare function sevenDigitToDateFirstDash(value: string): string;
38
+ declare function toDateTimeHourMinute(value: string): string;
39
+ declare function ddmmyyToSlashDate(value: string): string;
40
+
41
+ // Formatters - String
42
+ declare function formatResponseDesc(desc: string): string;
43
+ declare function titleCase(str: string): string;
44
+ declare function snakeToCamelWithSpace(snakeStr: string): string;
45
+ declare function stringToBoolean(str: string): boolean | undefined;
46
+ declare function matchWiths(targetStr: string, values?: string[]): boolean;
47
+ declare function maskString(value: string, type?: string): string;
48
+
49
+ // JSON
50
+ declare function parseJSON(value: string): unknown;
51
+ declare function jsonToStringLimiter(value?: unknown): string | null;
52
+ declare function errorState(name: string, errors: unknown): unknown;
53
+ declare function ascendingStringify(obj: unknown): string;
54
+
55
+ // Asset
56
+ declare function callAsset(uri?: string): string;
57
+
58
+ // Boolean Utils
59
+ declare function checkRoleUser(roles: string[], listRole: string[]): boolean;
60
+ declare function toggleUsingDummyWbenchEndpoint(status: boolean): boolean;
61
+
62
+ // Constants
63
+ declare const NOT_AUTHORIZE_RESPONSE_CODE: string[];
64
+ declare const PUBLIC_PATHS: string[];
65
+ declare const COOKIE_MAX_SIZE: number;
66
+ declare const CLIENT_PUBLIC_API_ROUTES: string[];
67
+ declare const CLIENT_ALLOWED_ORIGINS: Array<string | RegExp>;
68
+
69
+ // Disable Form
70
+ declare function disableFormElements(selector: string): void;
71
+ declare function disableFormBuilder(
72
+ fields: Array<Record<string, unknown> | null>,
73
+ roleAccess: boolean
74
+ ): Array<Record<string, unknown> | null>;
75
+
76
+ // Generate Timestamp
77
+ declare function generateVcifId(): string;
78
+
79
+ // LocalStorage
80
+ declare function getLocalStorageItem(key: string): unknown;
81
+
82
+ // Tipe Bank
83
+ declare function getTipeBankKorporasi(
84
+ data: Array<{ status_perusahaan: string; tipe_bank: string }>
85
+ ): string;
86
+
87
+ // Exception
88
+ declare const HEADER_EXCEPTION: string;
89
+ declare const ACCESS_EXCEPTION: string;
90
+ declare const PARAMETER_EXCEPTION: string;
91
+ declare const NOTFOUND_EXCEPTION: string;
92
+ declare const INVALIDRULE_EXCEPTION: string;
93
+ declare const THIRDPARTY_EXCEPTION: string;
94
+ declare const WAITING_EXCEPTION: string;
95
+ declare const UNSUPPORTED_EXCEPTION: string;
96
+ declare const RUNTIME_EXCEPTION: string;
97
+ declare const EXCEPTION_MESSAGES: Record<string, string>;
98
+ declare class ApiException extends Error {
99
+ responseCode: string;
100
+ responseDesc: string;
101
+ constructor(responseCode: string, responseDesc?: string);
102
+ }
103
+ declare function isExceptionCode(responseCode: string): boolean;
134
104
  declare function getExceptionMessage(responseCode: string): string;
135
- /**
136
- * Exception Utilities
137
- *
138
- * Standardized exception codes dan ApiException class untuk handling error dari backend API.
139
- */
140
- declare const HEADER_EXCEPTION: "X0";
141
- declare const ACCESS_EXCEPTION: "X1";
142
- declare const PARAMETER_EXCEPTION: "01";
143
- declare const NOTFOUND_EXCEPTION: "02";
144
- declare const INVALIDRULE_EXCEPTION: "03";
145
- declare const THIRDPARTY_EXCEPTION: "04";
146
- declare const WAITING_EXCEPTION: "05";
147
- declare const UNSUPPORTED_EXCEPTION: "06";
148
- declare const RUNTIME_EXCEPTION: "99";
149
- declare const EXCEPTION_MESSAGES: {
150
- X0: string;
151
- X1: string;
152
- "01": string;
153
- "02": string;
154
- "03": string;
155
- "04": string;
156
- "05": string;
157
- "06": string;
158
- "99": string;
159
- };
160
- /**
161
- * Custom exception class untuk API errors.
162
- * Menyimpan responseCode dan responseDesc dari backend.
163
- *
164
- * @example
165
- * throw new ApiException("02", "Prakarsa tidak ditemukan");
166
- *
167
- * @example
168
- * // Tanpa custom message — pakai default dari EXCEPTION_MESSAGES
169
- * throw new ApiException("X1");
170
- * // Error: [X1] Access denied
171
- */
172
- declare class ApiException extends Error {
173
- constructor(responseCode: any, responseDesc: any);
174
- responseCode: any;
175
- responseDesc: any;
176
- }
177
-
178
- declare function dashedAccount(value: any): any;
179
- declare function dashedNPWP(value: any): any;
180
- declare function formatCurrency(value: any, country?: string, curr?: string, minFrac?: number, maxFrac?: number): string;
181
- declare function formatResponseDesc(desc: any): any;
182
- declare function formatNominal(value: any, locale?: string, minFrac?: number, maxFrac?: number, commaSeparator?: string): any;
183
- declare function titleCase(str: any): any;
184
- declare function stringToBoolean(str: any): boolean;
185
105
 
186
- export { ACCESS_EXCEPTION, ApiException, CLIENT_ALLOWED_ORIGINS, CLIENT_PUBLIC_API_ROUTES, COOKIE_MAX_SIZE, EXCEPTION_MESSAGES, HEADER_EXCEPTION, INVALIDRULE_EXCEPTION, NOTFOUND_EXCEPTION, NOT_AUTHORIZE_RESPONSE_CODE, PARAMETER_EXCEPTION, PUBLIC_PATHS, RUNTIME_EXCEPTION, THIRDPARTY_EXCEPTION, UNSUPPORTED_EXCEPTION, WAITING_EXCEPTION, ascendingStringify, callAsset, checkRoleUser, dashedAccount, dashedNPWP, dateFirstSlashToYearFirstDash, ddmmyyToSlashDate, disableFormBuilder, disableFormElements, errorState, formatAccountNumber, formatCurrency$1 as formatCurrency, formatCurrency as formatCurrencyLegacy, formatDateToDDMMYYYY, formatDateToDDSlashMMSlashYYYY, formatDigit, formatNPWP, formatNominal$1 as formatNominal, formatNominal as formatNominalLegacy, formatResponseDesc$1 as formatResponseDesc, formatResponseDesc as formatResponseDescLegacy, formatRupiah, generateVcifId, getExceptionMessage, getLocalStorageItem, getTipeBankKorporasi, isExceptionCode, jsonToStringLimiter, maskString, matchWiths, parseJSON, sevenDigitToDateFirstDash, sevenDigitToDateFirstSlash, sevenDigitToYearFirstDash, snakeToCamelWithSpace, stringToBoolean$1 as stringToBoolean, stringToBoolean as stringToBooleanLegacy, titleCase$1 as titleCase, titleCase as titleCaseLegacy, toDateFirstSlash, toDateTimeHourMinute, toYearFirstDash, toggleUsingDummyWbenchEndpoint, yearFirstDashToDateFirstDash, yearFirstDashToDateFirstSlash };
106
+ export { ACCESS_EXCEPTION, ApiException, CLIENT_ALLOWED_ORIGINS, CLIENT_PUBLIC_API_ROUTES, COOKIE_MAX_SIZE, EXCEPTION_MESSAGES, HEADER_EXCEPTION, INVALIDRULE_EXCEPTION, NOTFOUND_EXCEPTION, NOT_AUTHORIZE_RESPONSE_CODE, PARAMETER_EXCEPTION, PUBLIC_PATHS, RUNTIME_EXCEPTION, THIRDPARTY_EXCEPTION, UNSUPPORTED_EXCEPTION, WAITING_EXCEPTION, ascendingStringify, callAsset, checkRoleUser, dateFirstSlashToYearFirstDash, ddmmyyToSlashDate, disableFormBuilder, disableFormElements, errorState, formatAccountNumber, formatCurrency, formatDateToDDMMYYYY, formatDateToDDSlashMMSlashYYYY, formatDigit, formatNPWP, formatNominal, formatResponseDesc, formatRupiah, generateVcifId, getExceptionMessage, getLocalStorageItem, getTipeBankKorporasi, isExceptionCode, jsonToStringLimiter, maskString, matchWiths, parseJSON, sevenDigitToDateFirstDash, sevenDigitToDateFirstSlash, sevenDigitToYearFirstDash, snakeToCamelWithSpace, stringToBoolean, titleCase, toDateFirstSlash, toDateTimeHourMinute, toYearFirstDash, toggleUsingDummyWbenchEndpoint, yearFirstDashToDateFirstDash, yearFirstDashToDateFirstSlash };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spotlibs-components",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "private": false,
5
5
  "main": "dist/index.mjs",
6
6
  "module": "dist/index.mjs",
@@ -29,10 +29,12 @@
29
29
  "default": "./dist/mui/index.mjs"
30
30
  },
31
31
  "./utils": {
32
+ "types": "./dist/utils/index.d.mts",
32
33
  "import": "./dist/utils/index.mjs",
33
34
  "default": "./dist/utils/index.mjs"
34
35
  },
35
36
  "./utils/*": {
37
+ "types": "./src/utils/*.d.ts",
36
38
  "import": "./src/utils/*.js",
37
39
  "default": "./src/utils/*.js"
38
40
  }
@@ -40,7 +42,6 @@
40
42
  "dependencies": {
41
43
  "@emotion/react": "^11.14.0",
42
44
  "@emotion/styled": "^11.14.1",
43
- "@hirohe/react-watermark": "^0.5.0",
44
45
  "@hookform/error-message": "^2.0.1",
45
46
  "@hookform/resolvers": "^3.1.1",
46
47
  "@mui/icons-material": "^5.16.14",