1mpacto-react-ui 0.2.0-beta.9 → 1.0.1
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/assets/_colors.scss +80 -0
- package/dist/assets/_mixins.scss +32 -5
- package/dist/assets/_typography.scss +582 -0
- package/dist/assets/colors.css +40 -0
- package/dist/assets/core.css +1 -1
- package/dist/assets/fontfamily.css +1 -1
- package/dist/assets/fonts/PlusJakartaSans-Italic.ttf +0 -0
- package/dist/assets/fonts/PlusJakartaSans.ttf +0 -0
- package/dist/assets/style.css +1 -1
- package/dist/assets/toast.css +98 -194
- package/dist/assets/typography.css +96 -0
- package/dist/index.cjs +120 -117
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +27703 -27059
- package/dist/package.json.d.ts +46 -47
- package/dist/src/components/Alert/index.d.ts +1 -0
- package/dist/src/components/Badges/Badges.config.d.ts +57 -0
- package/dist/src/components/Badges/Badges.d.ts +1 -0
- package/dist/src/components/Badges/Badges.stories.d.ts +117 -2
- package/dist/src/components/Breadcrumbs/Breadcrumbs.config.d.ts +113 -0
- package/dist/src/components/Breadcrumbs/Breadcrumbs.d.ts +2 -1
- package/dist/src/components/Breadcrumbs/Breadcrumbs.stories.d.ts +221 -6
- package/dist/src/components/Button/Button.config.d.ts +70 -0
- package/dist/src/components/Button/Button.d.ts +1 -0
- package/dist/src/components/Button/Button.stories.d.ts +129 -4
- package/dist/src/components/ButtonIcon/ButtonIcon.config.d.ts +53 -0
- package/dist/src/components/ButtonIcon/ButtonIcon.d.ts +1 -0
- package/dist/src/components/ButtonIcon/ButtonIcon.stories.d.ts +123 -4
- package/dist/src/components/ButtonPopover/ButtonPopover.d.ts +1 -0
- package/dist/src/components/ButtonPopover/ButtonPopover.stories.d.ts +258 -2
- package/dist/src/components/Calendar/Calendar.d.ts +3 -1
- package/dist/src/components/Calendar/Calendar.stories.d.ts +283 -2
- package/dist/src/components/Calendar/CalendarButton.d.ts +1 -0
- package/dist/src/components/Calendar/CalendarCell.d.ts +1 -0
- package/dist/src/components/Calendar/CalendarMonth.d.ts +1 -0
- package/dist/src/components/Calendar/CalendarRange.d.ts +1 -0
- package/dist/src/components/Calendar/CalendarYear.d.ts +1 -0
- package/dist/src/components/Chart/DoughnutChart.d.ts +1 -0
- package/dist/src/components/Chart/GradientBarChart.d.ts +1 -0
- package/dist/src/components/Chart/GradientBarChart.stories.d.ts +71 -4
- package/dist/src/components/Chart/GradientLineChart.d.ts +1 -0
- package/dist/src/components/Chart/GradientLineChart.stories.d.ts +82 -4
- package/dist/src/components/Chart/LineChart.d.ts +1 -0
- package/dist/src/components/Chart/LineChart.stories.d.ts +35 -2
- package/dist/src/components/Chips/Chips.config.d.ts +35 -0
- package/dist/src/components/Chips/Chips.d.ts +1 -0
- package/dist/src/components/Chips/Chips.stories.d.ts +137 -2
- package/dist/src/components/Collapse/Collapse.d.ts +1 -0
- package/dist/src/components/Collapse/Collapse.stories.d.ts +89 -2
- package/dist/src/components/Collapse/CollapseV2.d.ts +1 -0
- package/dist/src/components/Collapse/CollapseV2.stories.d.ts +59 -2
- package/dist/src/components/Colors/Colors.stories.d.ts +2 -1
- package/dist/src/components/DatePicker/DatePicker.d.ts +1 -0
- package/dist/src/components/DatePicker/DatePicker.stories.d.ts +221 -2
- package/dist/src/components/DatePicker/DateRangePicker.d.ts +1 -0
- package/dist/src/components/DatePicker/FilterDate.d.ts +2 -1
- package/dist/src/components/DatePicker/FilterDate.stories.d.ts +232 -3
- package/dist/src/components/DatePicker/MonthYearPicker.d.ts +1 -0
- package/dist/src/components/DatePicker/MonthYearPicker.stories.d.ts +198 -2
- package/dist/src/components/ErrorMessage/ErrorMessage.config.d.ts +8 -0
- package/dist/src/components/ErrorMessage/ErrorMessage.d.ts +1 -0
- package/dist/src/components/ErrorMessage/ErrorMessage.stories.d.ts +39 -2
- package/dist/src/components/FilterContainer/FilterContainer.d.ts +1 -0
- package/dist/src/components/FilterContainer/FilterContainer.stories.d.ts +165 -0
- package/dist/src/components/Input/InputFloatingInner.config.d.ts +9 -0
- package/dist/src/components/Input/InputFloatingInner.d.ts +1 -0
- package/dist/src/components/Input/InputFloatingInner.stories.d.ts +177 -6
- package/dist/src/components/Input/InputInnerLabel.config.d.ts +8 -0
- package/dist/src/components/Input/InputInnerLabel.d.ts +5 -0
- package/dist/src/components/Input/InputInnerLabel.stories.d.ts +205 -0
- package/dist/src/components/Input/InputNative.config.d.ts +9 -0
- package/dist/src/components/Input/InputNative.d.ts +1 -0
- package/dist/src/components/Input/InputNative.stories.d.ts +149 -5
- package/dist/src/components/Input/InputReguler.config.d.ts +9 -0
- package/dist/src/components/Input/InputReguler.d.ts +1 -0
- package/dist/src/components/Input/InputReguler.stories.d.ts +177 -6
- package/dist/src/components/Modal/ModalDialog.config.d.ts +9 -0
- package/dist/src/components/Modal/ModalDialog.d.ts +1 -0
- package/dist/src/components/Modal/ModalDialog.stories.d.ts +121 -2
- package/dist/src/components/NumberFormat/NumberFormat.d.ts +1 -0
- package/dist/src/components/NumberFormat/NumberFormat.stories.d.ts +373 -18
- package/dist/src/components/Pagination/Pagination.config.d.ts +5 -0
- package/dist/src/components/Pagination/Pagination.d.ts +2 -1
- package/dist/src/components/Pagination/Pagination.stories.d.ts +200 -3
- package/dist/src/components/Popover/Popover.d.ts +1 -0
- package/dist/src/components/Popover/Popover.stories.d.ts +216 -7
- package/dist/src/components/PortalComponent/PortalComponent.d.ts +1 -0
- package/dist/src/components/PortalComponent/PortalComponent.stories.d.ts +61 -0
- package/dist/src/components/RadioCheckbox/CheckboxTable.d.ts +1 -0
- package/dist/src/components/RadioCheckbox/RadioCheckbox.config.d.ts +41 -0
- package/dist/src/components/RadioCheckbox/RadioCheckbox.d.ts +1 -0
- package/dist/src/components/RadioCheckbox/RadioCheckbox.stories.d.ts +230 -8
- package/dist/src/components/RadioCheckbox/RadioCheckboxLabel.config.d.ts +25 -0
- package/dist/src/components/RadioCheckbox/RadioCheckboxLabel.d.ts +1 -0
- package/dist/src/components/RadioCheckbox/RadioCheckboxLabel.stories.d.ts +196 -4
- package/dist/src/components/SelectDropdownContainer/SelectDropdownContainer.config.d.ts +26 -0
- package/dist/src/components/SelectDropdownContainer/SelectDropdownContainer.d.ts +2 -1
- package/dist/src/components/SelectDropdownContainer/SelectDropdownContainer.stories.d.ts +5 -4
- package/dist/src/components/SelectDropdownContainer/styleConfig.d.ts +5 -1
- package/dist/src/components/Sidebar/ItemSidebar.config.d.ts +34 -0
- package/dist/src/components/Sidebar/ItemSidebar.d.ts +1 -0
- package/dist/src/components/Sidebar/Sidebar.config.d.ts +16 -0
- package/dist/src/components/Sidebar/Sidebar.d.ts +2 -1
- package/dist/src/components/Sidebar/Sidebar.stories.d.ts +6 -5
- package/dist/src/components/Step/Step.d.ts +1 -0
- package/dist/src/components/Step/Step.stories.d.ts +135 -2
- package/dist/src/components/Step/StepIndicator.d.ts +1 -0
- package/dist/src/components/Step/StepIndicator.stories.d.ts +148 -2
- package/dist/src/components/Switch/Switch.config.d.ts +26 -0
- package/dist/src/components/Switch/Switch.d.ts +1 -0
- package/dist/src/components/Switch/Switch.stories.d.ts +128 -2
- package/dist/src/components/Table/Table.config.d.ts +5 -0
- package/dist/src/components/Table/Table.d.ts +3 -3
- package/dist/src/components/Table/Table.stories.d.ts +71 -52
- package/dist/src/components/Table/TableSubMobile.d.ts +4 -0
- package/dist/src/components/Tabs/TabPanel.d.ts +1 -0
- package/dist/src/components/Tabs/Tabs.config.d.ts +31 -0
- package/dist/src/components/Tabs/Tabs.d.ts +2 -1
- package/dist/src/components/Tabs/Tabs.stories.d.ts +220 -3
- package/dist/src/components/TextEditor/TextEditor.d.ts +1 -0
- package/dist/src/components/TextEditor/TextEditor.stories.d.ts +59 -10
- package/dist/src/components/Textarea/Textarea.config.d.ts +31 -0
- package/dist/src/components/Textarea/Textarea.d.ts +1 -0
- package/dist/src/components/Textarea/Textarea.stories.d.ts +250 -3
- package/dist/src/components/Textarea/TextareaFloatingInner.config.d.ts +6 -0
- package/dist/src/components/Textarea/TextareaFloatingInner.d.ts +1 -0
- package/dist/src/components/Textarea/TextareaFloatingInner.stories.d.ts +260 -3
- package/dist/src/components/Textarea/TextareaInnerLabel.config.d.ts +7 -0
- package/dist/src/components/Textarea/TextareaInnerLabel.d.ts +5 -0
- package/dist/src/components/Textarea/TextareaInnerLabel.stories.d.ts +259 -0
- package/dist/src/components/TimeRange/TimeRange.d.ts +4 -0
- package/dist/src/components/TimeRange/TimeRange.stories.d.ts +186 -0
- package/dist/src/components/Timeline/Timeline.d.ts +1 -0
- package/dist/src/components/Timeline/Timeline.stories.d.ts +40 -2
- package/dist/src/components/Tooltip/Tooltip.d.ts +1 -0
- package/dist/src/components/Tooltip/Tooltip.stories.d.ts +159 -2
- package/dist/src/components/TruncateComponent/TruncateComponent.d.ts +1 -0
- package/dist/src/components/TruncateComponent/TruncateComponent.stories.d.ts +106 -2
- package/dist/src/components/Typography/Typography.stories.d.ts +2 -1
- package/dist/src/components/Upload/UploadFile.d.ts +1 -0
- package/dist/src/components/Upload/UploadFile.stories.d.ts +127 -2
- package/dist/src/components/Upload/UploadImage.d.ts +2 -1
- package/dist/src/components/Upload/UploadImage.stories.d.ts +145 -3
- package/dist/src/components/Upload/UploadMultipleFile.d.ts +2 -1
- package/dist/src/components/Upload/UploadMultipleFile.stories.d.ts +190 -3
- package/dist/src/components/Virtualization/ListVirtualization.d.ts +1 -0
- package/dist/src/components/Virtualization/ListVirtualization.stories.d.ts +279 -2
- package/dist/src/components/Virtualization/TableVirtualization.d.ts +1 -0
- package/dist/src/components/Virtualization/TableVirtualization.stories.d.ts +296 -2
- package/dist/src/components/index.d.ts +15 -8
- package/dist/src/components/screens/Screens.stories.d.ts +14 -0
- package/dist/src/config/bigNumber/index.d.ts +1 -0
- package/dist/src/config/components/borderRadius.d.ts +1 -0
- package/dist/src/config/components/font.d.ts +7 -0
- package/dist/src/config/components/gap.d.ts +1 -0
- package/dist/src/config/components/tinymce.d.ts +1 -0
- package/dist/src/config/components/typography.d.ts +3 -49
- package/dist/src/config/tailwind/index.d.ts +3 -1
- package/dist/src/config/tailwind/nativeScreen.d.ts +3 -0
- package/dist/src/config/tailwind/typography.d.ts +1 -0
- package/dist/src/hooks/index.d.ts +6 -3
- package/dist/src/hooks/useAsyncDebounce.d.ts +9 -0
- package/dist/src/hooks/useCombinedResizeObserver.d.ts +67 -0
- package/dist/src/hooks/useCountdown.d.ts +67 -3
- package/dist/src/hooks/useDeepCompareEffect.d.ts +14 -0
- package/dist/src/hooks/useElementOrWindowMediaQuery.d.ts +9 -0
- package/dist/src/hooks/useEventListener.d.ts +28 -0
- package/dist/src/hooks/useMasonry.d.ts +80 -0
- package/dist/src/hooks/useMergeRefs.d.ts +27 -0
- package/dist/src/hooks/useOtpInput.d.ts +200 -0
- package/dist/src/hooks/useStateRef.d.ts +9 -0
- package/dist/src/interfaces/components/Alert/index.d.ts +9 -0
- package/dist/src/interfaces/components/Badges/index.d.ts +31 -1
- package/dist/src/interfaces/components/Breadcrumbs/index.d.ts +86 -2
- package/dist/src/interfaces/components/Button/index.d.ts +47 -2
- package/dist/src/interfaces/components/ButtonIcon/index.d.ts +37 -0
- package/dist/src/interfaces/components/ButtonPopover/index.d.ts +79 -0
- package/dist/src/interfaces/components/Calendar/index.d.ts +385 -3
- package/dist/src/interfaces/components/Chart/index.d.ts +461 -0
- package/dist/src/interfaces/components/Checkbox/index.d.ts +13 -0
- package/dist/src/interfaces/components/Chips/index.d.ts +39 -1
- package/dist/src/interfaces/components/Collapse/index.d.ts +61 -0
- package/dist/src/interfaces/components/DatePicker/index.d.ts +278 -1
- package/dist/src/interfaces/components/ErrorMessage/index.d.ts +17 -1
- package/dist/src/interfaces/components/FilterContainer/index.d.ts +103 -0
- package/dist/src/interfaces/components/Input/index.d.ts +194 -0
- package/dist/src/interfaces/components/Modal/index.d.ts +46 -0
- package/dist/src/interfaces/components/NumberFormat/index.d.ts +26 -0
- package/dist/src/interfaces/components/Pagination/index.d.ts +84 -0
- package/dist/src/interfaces/components/Popover/index.d.ts +99 -1
- package/dist/src/interfaces/components/RadioCheckbox/RadioCheckbox.d.ts +60 -2
- package/dist/src/interfaces/components/RadioCheckbox/RadioCheckboxLabel.d.ts +47 -1
- package/dist/src/interfaces/components/SelectDropdownContainer/index.d.ts +197 -2
- package/dist/src/interfaces/components/Sidebar/index.d.ts +230 -1
- package/dist/src/interfaces/components/Step/index.d.ts +154 -0
- package/dist/src/interfaces/components/Switch/index.d.ts +54 -1
- package/dist/src/interfaces/components/Table/index.d.ts +403 -6
- package/dist/src/interfaces/components/Tabs/index.d.ts +131 -1
- package/dist/src/interfaces/components/TextEditor/index.d.ts +13 -0
- package/dist/src/interfaces/components/Textarea/index.d.ts +170 -0
- package/dist/src/interfaces/components/TimeRange/index.d.ts +129 -0
- package/dist/src/interfaces/components/Timeline/index.d.ts +37 -0
- package/dist/src/interfaces/components/Tooltip/index.d.ts +57 -0
- package/dist/src/interfaces/components/TruncateComponent/index.d.ts +34 -0
- package/dist/src/interfaces/components/UploadFile/index.d.ts +187 -0
- package/dist/src/interfaces/components/Virtualization/ListVirtualization.d.ts +139 -0
- package/dist/src/interfaces/components/Virtualization/TableVirtualization.d.ts +144 -0
- package/dist/src/main.d.ts +1 -0
- package/dist/src/utils/common.d.ts +5 -4
- package/dist/src/utils/constant.d.ts +1 -0
- package/dist/types-external/table.d.ts +3 -0
- package/package.json +46 -47
- package/dist/index.cjs.map +0 -1
- package/dist/index.mjs.map +0 -1
|
@@ -1,14 +1,78 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* [ID] : Interface untuk opsi hook useCountdown.
|
|
3
|
+
* [EN] : Interface for useCountdown hook options.
|
|
4
|
+
*/
|
|
5
|
+
export interface IUseCountdown {
|
|
6
|
+
/**
|
|
7
|
+
* [ID] : Tanggal target hitung mundur.
|
|
8
|
+
* [EN] : Countdown target date.
|
|
9
|
+
*/
|
|
2
10
|
date: string;
|
|
11
|
+
/**
|
|
12
|
+
* [ID] : Interval waktu dalam milidetik.
|
|
13
|
+
* [EN] : Time interval in milliseconds.
|
|
14
|
+
*/
|
|
3
15
|
intervalMs: number;
|
|
16
|
+
/**
|
|
17
|
+
* [ID] : Status berjalan atau tidak.
|
|
18
|
+
* [EN] : Running status.
|
|
19
|
+
*/
|
|
4
20
|
running: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* [ID] : Penyesuaian waktu dalam jam (opsional).
|
|
23
|
+
* [EN] : Time adjustment in hours (optional).
|
|
24
|
+
*/
|
|
5
25
|
adjustTimesTime?: number;
|
|
26
|
+
/**
|
|
27
|
+
* [ID] : Callback saat hitung mundur selesai (opsional).
|
|
28
|
+
* [EN] : Callback when countdown is done (optional).
|
|
29
|
+
*/
|
|
6
30
|
callbackDone?: () => void;
|
|
7
|
-
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* [ID] : Interface untuk nilai kembalian hook useCountdown.
|
|
34
|
+
* [EN] : Interface for useCountdown hook return value.
|
|
35
|
+
*/
|
|
36
|
+
export interface IUseCountdownReturn {
|
|
37
|
+
/**
|
|
38
|
+
* [ID] : Sisa waktu dalam detik.
|
|
39
|
+
* [EN] : Remaining time in seconds.
|
|
40
|
+
*/
|
|
8
41
|
count: number;
|
|
42
|
+
/**
|
|
43
|
+
* [ID] : Status apakah hitung mundur sedang berjalan.
|
|
44
|
+
* [EN] : Status whether countdown is running.
|
|
45
|
+
*/
|
|
46
|
+
isRunning: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* [ID] : Fungsi untuk memulai hitung mundur.
|
|
49
|
+
* [EN] : Function to start countdown.
|
|
50
|
+
*/
|
|
9
51
|
startCountdown: () => void;
|
|
52
|
+
/**
|
|
53
|
+
* [ID] : Fungsi untuk menghentikan hitung mundur.
|
|
54
|
+
* [EN] : Function to stop countdown.
|
|
55
|
+
*/
|
|
10
56
|
stopCountdown: () => void;
|
|
57
|
+
/**
|
|
58
|
+
* [ID] : Fungsi untuk mereset hitung mundur.
|
|
59
|
+
* [EN] : Function to reset countdown.
|
|
60
|
+
* @param value - [ID] : Nilai reset (opsional, bisa Date atau number).
|
|
61
|
+
* [EN] : Reset value (optional, can be Date or number).
|
|
62
|
+
*/
|
|
11
63
|
resetCountdown: (value?: Date | number) => void;
|
|
64
|
+
/**
|
|
65
|
+
* [ID] : Fungsi untuk mengatur callback saat selesai.
|
|
66
|
+
* [EN] : Function to set callback when done.
|
|
67
|
+
* @param val - [ID] : Fungsi callback. [EN] : Callback function.
|
|
68
|
+
*/
|
|
12
69
|
setCallbackDone: (val: () => void) => void;
|
|
13
|
-
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* [ID] : Hook untuk hitung mundur waktu.
|
|
73
|
+
* [EN] : Hook for countdown timer.
|
|
74
|
+
* @param options - [ID] : Opsi hitung mundur. [EN] : Countdown options.
|
|
75
|
+
* @returns [ID] : Objek kontrol hitung mundur. [EN] : Countdown control object.
|
|
76
|
+
*/
|
|
77
|
+
declare const useCountdown: (options: IUseCountdown) => IUseCountdownReturn;
|
|
14
78
|
export default useCountdown;
|
|
@@ -1,3 +1,17 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* [ID] : Hook untuk memoize nilai dengan perbandingan mendalam.
|
|
5
|
+
* [EN] : Hook to memoize value with deep comparison.
|
|
6
|
+
* @template T - [ID] : Tipe nilai. [EN] : Value type.
|
|
7
|
+
* @param value - [ID] : Nilai yang akan di-memoize. [EN] : Value to be memoized.
|
|
8
|
+
* @returns [ID] : Nilai yang sudah di-memoize. [EN] : Memoized value.
|
|
9
|
+
*/
|
|
2
10
|
export declare function useDeepCompareMemoize<T>(value: T): T;
|
|
11
|
+
/**
|
|
12
|
+
* [ID] : Hook useEffect dengan perbandingan dependensi mendalam.
|
|
13
|
+
* [EN] : useEffect hook with deep dependency comparison.
|
|
14
|
+
* @param callback - [ID] : Fungsi efek yang akan dijalankan. [EN] : Effect function to be executed.
|
|
15
|
+
* @param dependencies - [ID] : Daftar dependensi. [EN] : Dependency list.
|
|
16
|
+
*/
|
|
3
17
|
export declare function useDeepCompareEffect(callback: React.EffectCallback, dependencies: React.DependencyList): void;
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [ID] : Hook untuk memeriksa media query pada elemen atau jendela.
|
|
3
|
+
* [EN] : Hook to check media query on element or window.
|
|
4
|
+
* @param query - [ID] : String media query (gunakan 'WIDTH' sebagai placeholder lebar).
|
|
5
|
+
* [EN] : Media query string (use 'WIDTH' as width placeholder).
|
|
6
|
+
* @param elementId - [ID] : ID elemen target (opsional, jika null menggunakan window).
|
|
7
|
+
* [EN] : Target element ID (optional, if null uses window).
|
|
8
|
+
* @returns [ID] : Boolean apakah query cocok. [EN] : Boolean whether query matches.
|
|
9
|
+
*/
|
|
1
10
|
declare function useElementOrWindowMediaQuery(query: string, elementId?: string | null): boolean;
|
|
2
11
|
export default useElementOrWindowMediaQuery;
|
|
@@ -1,9 +1,37 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* [ID] : Interface untuk opsi hook useEventListener.
|
|
5
|
+
* [EN] : Interface for useEventListener hook options.
|
|
6
|
+
*/
|
|
2
7
|
interface UseEventListenerOptions {
|
|
8
|
+
/**
|
|
9
|
+
* [ID] : Referensi elemen target.
|
|
10
|
+
* [EN] : Target element reference.
|
|
11
|
+
*/
|
|
3
12
|
ref: React.RefObject<HTMLElement>;
|
|
13
|
+
/**
|
|
14
|
+
* [ID] : Fungsi handler utama.
|
|
15
|
+
* [EN] : Main handler function.
|
|
16
|
+
* @param ref - [ID] : Referensi elemen. [EN] : Element reference.
|
|
17
|
+
* @param event - [ID] : Objek event. [EN] : Event object.
|
|
18
|
+
*/
|
|
4
19
|
handlerMain: (ref: React.RefObject<HTMLElement>, event: Event) => void;
|
|
20
|
+
/**
|
|
21
|
+
* [ID] : Jenis event listener (default: 'mousedown').
|
|
22
|
+
* [EN] : Event listener type (default: 'mousedown').
|
|
23
|
+
*/
|
|
5
24
|
eventListener?: keyof DocumentEventMap | (string & {});
|
|
25
|
+
/**
|
|
26
|
+
* [ID] : Dependensi tambahan untuk useEffect (opsional).
|
|
27
|
+
* [EN] : Additional dependencies for useEffect (optional).
|
|
28
|
+
*/
|
|
6
29
|
useEffectDependency?: unknown[];
|
|
7
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* [ID] : Hook untuk menambahkan event listener ke dokumen.
|
|
33
|
+
* [EN] : Hook to add event listener to document.
|
|
34
|
+
* @param options - [ID] : Opsi event listener. [EN] : Event listener options.
|
|
35
|
+
*/
|
|
8
36
|
export declare function useEventListener({ ref, handlerMain, eventListener, useEffectDependency, }: UseEventListenerOptions): void;
|
|
9
37
|
export {};
|
|
@@ -1,24 +1,104 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* [ID] : Tipe arah layout masonry.
|
|
5
|
+
* [EN] : Masonry layout direction type.
|
|
6
|
+
*/
|
|
2
7
|
export type TMasonryDirection = 'masonry-ltr' | 'masonry-rtl' | 'top-down-ltr' | 'top-down-rtl';
|
|
8
|
+
/**
|
|
9
|
+
* [ID] : Tipe hook useMasonry.
|
|
10
|
+
* [EN] : useMasonry hook type.
|
|
11
|
+
* @template T - [ID] : Tipe elemen HTML kontainer. [EN] : Container HTML element type.
|
|
12
|
+
* @param params - [ID] : Parameter hook. [EN] : Hook parameters.
|
|
13
|
+
* @returns [ID] : Objek berisi fungsi hitung ulang layout. [EN] : Object containing recalculate layout function.
|
|
14
|
+
*/
|
|
3
15
|
export type TUseMasonry = <T extends HTMLElement>(params: {
|
|
16
|
+
/**
|
|
17
|
+
* [ID] : Referensi kontainer.
|
|
18
|
+
* [EN] : Container reference.
|
|
19
|
+
*/
|
|
4
20
|
containerRef: React.RefObject<T>;
|
|
21
|
+
/**
|
|
22
|
+
* [ID] : Elemen anak.
|
|
23
|
+
* [EN] : Children elements.
|
|
24
|
+
*/
|
|
5
25
|
children: React.ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* [ID] : Jumlah kolom.
|
|
28
|
+
* [EN] : Column count.
|
|
29
|
+
*/
|
|
6
30
|
columnCount: number;
|
|
31
|
+
/**
|
|
32
|
+
* [ID] : Jarak horizontal antar item.
|
|
33
|
+
* [EN] : Horizontal gap between items.
|
|
34
|
+
*/
|
|
7
35
|
gapX: number;
|
|
36
|
+
/**
|
|
37
|
+
* [ID] : Jarak vertikal antar item.
|
|
38
|
+
* [EN] : Vertical gap between items.
|
|
39
|
+
*/
|
|
8
40
|
gapY: number;
|
|
41
|
+
/**
|
|
42
|
+
* [ID] : Arah layout (opsional).
|
|
43
|
+
* [EN] : Layout direction (optional).
|
|
44
|
+
*/
|
|
9
45
|
direction?: TMasonryDirection;
|
|
46
|
+
/**
|
|
47
|
+
* [ID] : Waktu debounce hitung ulang (ms) (opsional).
|
|
48
|
+
* [EN] : Recalculate debounce time (ms) (optional).
|
|
49
|
+
*/
|
|
10
50
|
debounceRecalculate?: number;
|
|
51
|
+
/**
|
|
52
|
+
* [ID] : Durasi animasi (ms) (opsional).
|
|
53
|
+
* [EN] : Animation duration (ms) (optional).
|
|
54
|
+
*/
|
|
11
55
|
durationAnimation?: number;
|
|
56
|
+
/**
|
|
57
|
+
* [ID] : Aktifkan animasi (opsional).
|
|
58
|
+
* [EN] : Enable animation (optional).
|
|
59
|
+
*/
|
|
12
60
|
enableAnimation?: boolean;
|
|
13
61
|
}) => {
|
|
62
|
+
/**
|
|
63
|
+
* [ID] : Fungsi untuk menghitung ulang layout.
|
|
64
|
+
* [EN] : Function to recalculate layout.
|
|
65
|
+
*/
|
|
14
66
|
recalculateLayout: () => void;
|
|
15
67
|
};
|
|
68
|
+
/**
|
|
69
|
+
* [ID] : Interface untuk properti layout masonry.
|
|
70
|
+
* [EN] : Interface for masonry layout properties.
|
|
71
|
+
*/
|
|
16
72
|
export interface IMasonryLayout {
|
|
73
|
+
/**
|
|
74
|
+
* [ID] : Elemen anak.
|
|
75
|
+
* [EN] : Children elements.
|
|
76
|
+
*/
|
|
17
77
|
children: React.ReactNode | React.ReactNode[];
|
|
78
|
+
/**
|
|
79
|
+
* [ID] : Jumlah kolom (opsional).
|
|
80
|
+
* [EN] : Column count (optional).
|
|
81
|
+
*/
|
|
18
82
|
columnCount?: number;
|
|
83
|
+
/**
|
|
84
|
+
* [ID] : Jarak horizontal (opsional).
|
|
85
|
+
* [EN] : Horizontal gap (optional).
|
|
86
|
+
*/
|
|
19
87
|
gapX?: number;
|
|
88
|
+
/**
|
|
89
|
+
* [ID] : Jarak vertikal (opsional).
|
|
90
|
+
* [EN] : Vertical gap (optional).
|
|
91
|
+
*/
|
|
20
92
|
gapY?: number;
|
|
93
|
+
/**
|
|
94
|
+
* [ID] : Arah layout (opsional).
|
|
95
|
+
* [EN] : Layout direction (optional).
|
|
96
|
+
*/
|
|
21
97
|
direction?: TMasonryDirection;
|
|
22
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* [ID] : Hook untuk mengatur layout masonry.
|
|
101
|
+
* [EN] : Hook to manage masonry layout.
|
|
102
|
+
*/
|
|
23
103
|
declare const useMasonry: TUseMasonry;
|
|
24
104
|
export default useMasonry;
|
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* [ID] : Tipe referensi React (callback atau objek).
|
|
5
|
+
* [EN] : React reference type (callback or object).
|
|
6
|
+
* @template T - [ID] : Tipe elemen. [EN] : Element type.
|
|
7
|
+
*/
|
|
2
8
|
export type ReactRef<T> = React.RefCallback<T> | React.MutableRefObject<T>;
|
|
9
|
+
/**
|
|
10
|
+
* [ID] : Menetapkan nilai ke referensi.
|
|
11
|
+
* [EN] : Assigns a value to a reference.
|
|
12
|
+
* @template T - [ID] : Tipe nilai. [EN] : Value type.
|
|
13
|
+
* @param ref - [ID] : Referensi target. [EN] : Target reference.
|
|
14
|
+
* @param value - [ID] : Nilai yang akan ditetapkan. [EN] : Value to assign.
|
|
15
|
+
*/
|
|
3
16
|
export declare function assignRef<T = unknown>(ref: ReactRef<T> | null | undefined, value: T): void;
|
|
17
|
+
/**
|
|
18
|
+
* [ID] : Menggabungkan beberapa referensi menjadi satu fungsi callback.
|
|
19
|
+
* [EN] : Merges multiple references into a single callback function.
|
|
20
|
+
* @template T - [ID] : Tipe elemen. [EN] : Element type.
|
|
21
|
+
* @param refs - [ID] : Daftar referensi. [EN] : List of references.
|
|
22
|
+
* @returns [ID] : Fungsi callback referensi. [EN] : Reference callback function.
|
|
23
|
+
*/
|
|
4
24
|
export declare function mergeRefs<T>(...refs: (ReactRef<T> | null | undefined)[]): (node: T | null) => void;
|
|
25
|
+
/**
|
|
26
|
+
* [ID] : Hook untuk menggabungkan beberapa referensi.
|
|
27
|
+
* [EN] : Hook to merge multiple references.
|
|
28
|
+
* @template T - [ID] : Tipe elemen. [EN] : Element type.
|
|
29
|
+
* @param refs - [ID] : Daftar referensi. [EN] : List of references.
|
|
30
|
+
* @returns [ID] : Referensi gabungan yang di-memoize. [EN] : Memoized merged reference.
|
|
31
|
+
*/
|
|
5
32
|
export declare function useMergeRefs<T>(...refs: (ReactRef<T> | null | undefined)[]): (node: T | null) => void;
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* [ID] : Interface untuk opsi hook useOtpInput.
|
|
5
|
+
* [EN] : Interface for useOtpInput hook options.
|
|
6
|
+
*/
|
|
7
|
+
export interface IUseOtpInput {
|
|
8
|
+
/**
|
|
9
|
+
* [ID] : ID komponen (opsional).
|
|
10
|
+
* [EN] : Component ID (optional).
|
|
11
|
+
*/
|
|
12
|
+
id?: string;
|
|
13
|
+
/**
|
|
14
|
+
* [ID] : Jumlah input OTP.
|
|
15
|
+
* [EN] : Number of OTP inputs.
|
|
16
|
+
*/
|
|
17
|
+
numInputs: number;
|
|
18
|
+
/**
|
|
19
|
+
* [ID] : Callback saat OTP lengkap (opsional).
|
|
20
|
+
* [EN] : Callback when OTP is complete (optional).
|
|
21
|
+
* @param otp - [ID] : String OTP lengkap. [EN] : Complete OTP string.
|
|
22
|
+
*/
|
|
23
|
+
onComplete?: (otp: string) => void;
|
|
24
|
+
/**
|
|
25
|
+
* [ID] : Nonaktifkan fokus saat edit (opsional).
|
|
26
|
+
* [EN] : Disable focus on edit (optional).
|
|
27
|
+
*/
|
|
28
|
+
disableFocusOnEdit?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* [ID] : Blur saat lengkap (opsional).
|
|
31
|
+
* [EN] : Blur on complete (optional).
|
|
32
|
+
*/
|
|
33
|
+
blurOnComplete?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* [ID] : Nonaktifkan input saat lengkap (opsional).
|
|
36
|
+
* [EN] : Disable input on complete (optional).
|
|
37
|
+
*/
|
|
38
|
+
disableOnComplete?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* [ID] : Interface untuk properti input.
|
|
42
|
+
* [EN] : Interface for input properties.
|
|
43
|
+
*/
|
|
44
|
+
export interface IInputProps {
|
|
45
|
+
/**
|
|
46
|
+
* [ID] : ID input.
|
|
47
|
+
* [EN] : Input ID.
|
|
48
|
+
*/
|
|
49
|
+
id: string;
|
|
50
|
+
/**
|
|
51
|
+
* [ID] : Fungsi referensi input.
|
|
52
|
+
* [EN] : Input reference function.
|
|
53
|
+
* @param el - [ID] : Elemen input. [EN] : Input element.
|
|
54
|
+
*/
|
|
55
|
+
ref: (el: HTMLInputElement | null) => void;
|
|
56
|
+
/**
|
|
57
|
+
* [ID] : Nilai input.
|
|
58
|
+
* [EN] : Input value.
|
|
59
|
+
*/
|
|
60
|
+
value: string;
|
|
61
|
+
/**
|
|
62
|
+
* [ID] : Handler perubahan input.
|
|
63
|
+
* [EN] : Input change handler.
|
|
64
|
+
* @param e - [ID] : Event perubahan. [EN] : Change event.
|
|
65
|
+
*/
|
|
66
|
+
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
67
|
+
/**
|
|
68
|
+
* [ID] : Handler tombol ditekan.
|
|
69
|
+
* [EN] : Key down handler.
|
|
70
|
+
* @param e - [ID] : Event keyboard. [EN] : Keyboard event.
|
|
71
|
+
*/
|
|
72
|
+
onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
73
|
+
/**
|
|
74
|
+
* [ID] : Handler paste.
|
|
75
|
+
* [EN] : Paste handler.
|
|
76
|
+
* @param e - [ID] : Event clipboard. [EN] : Clipboard event.
|
|
77
|
+
*/
|
|
78
|
+
onPaste: (e: React.ClipboardEvent<HTMLInputElement>) => void;
|
|
79
|
+
/**
|
|
80
|
+
* [ID] : Handler fokus.
|
|
81
|
+
* [EN] : Focus handler.
|
|
82
|
+
* @param e - [ID] : Event fokus. [EN] : Focus event.
|
|
83
|
+
*/
|
|
84
|
+
onFocus: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
85
|
+
/**
|
|
86
|
+
* [ID] : Status non-aktif.
|
|
87
|
+
* [EN] : Disabled status.
|
|
88
|
+
*/
|
|
89
|
+
disabled: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* [ID] : Tipe input.
|
|
92
|
+
* [EN] : Input type.
|
|
93
|
+
*/
|
|
94
|
+
type: 'text';
|
|
95
|
+
/**
|
|
96
|
+
* [ID] : Mode input.
|
|
97
|
+
* [EN] : Input mode.
|
|
98
|
+
*/
|
|
99
|
+
inputMode: 'numeric';
|
|
100
|
+
/**
|
|
101
|
+
* [ID] : Auto complete.
|
|
102
|
+
* [EN] : Auto complete.
|
|
103
|
+
*/
|
|
104
|
+
autoComplete: 'one-time-code';
|
|
105
|
+
/**
|
|
106
|
+
* [ID] : Label ARIA.
|
|
107
|
+
* [EN] : ARIA label.
|
|
108
|
+
*/
|
|
109
|
+
'aria-label': string;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* [ID] : Interface untuk data input.
|
|
113
|
+
* [EN] : Interface for input data.
|
|
114
|
+
*/
|
|
115
|
+
export interface IInputData {
|
|
116
|
+
/**
|
|
117
|
+
* [ID] : ID input.
|
|
118
|
+
* [EN] : Input ID.
|
|
119
|
+
*/
|
|
120
|
+
id: string;
|
|
121
|
+
/**
|
|
122
|
+
* [ID] : Fungsi referensi input.
|
|
123
|
+
* [EN] : Input reference function.
|
|
124
|
+
* @param el - [ID] : Elemen input. [EN] : Input element.
|
|
125
|
+
*/
|
|
126
|
+
ref: (el: HTMLInputElement | null) => void;
|
|
127
|
+
/**
|
|
128
|
+
* [ID] : Nilai input.
|
|
129
|
+
* [EN] : Input value.
|
|
130
|
+
*/
|
|
131
|
+
value: string;
|
|
132
|
+
/**
|
|
133
|
+
* [ID] : Status non-aktif.
|
|
134
|
+
* [EN] : Disabled status.
|
|
135
|
+
*/
|
|
136
|
+
disabled: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* [ID] : Tipe input.
|
|
139
|
+
* [EN] : Input type.
|
|
140
|
+
*/
|
|
141
|
+
type: 'text';
|
|
142
|
+
/**
|
|
143
|
+
* [ID] : Mode input.
|
|
144
|
+
* [EN] : Input mode.
|
|
145
|
+
*/
|
|
146
|
+
inputMode: 'numeric';
|
|
147
|
+
/**
|
|
148
|
+
* [ID] : Status apakah OTP terisi.
|
|
149
|
+
* [EN] : Status whether OTP is filled.
|
|
150
|
+
*/
|
|
151
|
+
isOtpFilled: boolean;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* [ID] : Interface untuk nilai kembalian hook useOtpInput.
|
|
155
|
+
* [EN] : Interface for useOtpInput hook return value.
|
|
156
|
+
*/
|
|
157
|
+
export interface IUseOtpInputReturn {
|
|
158
|
+
/**
|
|
159
|
+
* [ID] : Fungsi mendapatkan properti input berdasarkan indeks.
|
|
160
|
+
* [EN] : Function to get input properties by index.
|
|
161
|
+
* @param index - [ID] : Indeks input. [EN] : Input index.
|
|
162
|
+
* @returns [ID] : Properti input. [EN] : Input properties.
|
|
163
|
+
*/
|
|
164
|
+
getInputProps: (index: number) => IInputProps;
|
|
165
|
+
/**
|
|
166
|
+
* [ID] : Fungsi mendapatkan data input berdasarkan indeks.
|
|
167
|
+
* [EN] : Function to get input data by index.
|
|
168
|
+
* @param index - [ID] : Indeks input. [EN] : Input index.
|
|
169
|
+
* @returns [ID] : Data input. [EN] : Input data.
|
|
170
|
+
*/
|
|
171
|
+
getInputData: (index: number) => IInputData;
|
|
172
|
+
/**
|
|
173
|
+
* [ID] : Fungsi membersihkan OTP.
|
|
174
|
+
* [EN] : Function to clear OTP.
|
|
175
|
+
*/
|
|
176
|
+
clearOtp: () => void;
|
|
177
|
+
/**
|
|
178
|
+
* [ID] : Array nilai OTP.
|
|
179
|
+
* [EN] : OTP values array.
|
|
180
|
+
*/
|
|
181
|
+
otpValues: string[];
|
|
182
|
+
/**
|
|
183
|
+
* [ID] : String OTP gabungan.
|
|
184
|
+
* [EN] : Joined OTP string.
|
|
185
|
+
*/
|
|
186
|
+
otpString: string;
|
|
187
|
+
/**
|
|
188
|
+
* [ID] : Status apakah OTP lengkap.
|
|
189
|
+
* [EN] : Status whether OTP is complete.
|
|
190
|
+
*/
|
|
191
|
+
isOtpComplete: boolean;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* [ID] : Hook untuk mengelola input OTP.
|
|
195
|
+
* [EN] : Hook to manage OTP input.
|
|
196
|
+
* @param options - [ID] : Opsi hook. [EN] : Hook options.
|
|
197
|
+
* @returns [ID] : Objek kontrol OTP. [EN] : OTP control object.
|
|
198
|
+
*/
|
|
199
|
+
export declare const useOtpInput: ({ id, numInputs, onComplete, disableFocusOnEdit, blurOnComplete, disableOnComplete, }: IUseOtpInput) => IUseOtpInputReturn;
|
|
200
|
+
export default useOtpInput;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* [ID] : Hook untuk menggunakan state dengan referensi mutable.
|
|
5
|
+
* [EN] : Hook to use state with mutable reference.
|
|
6
|
+
* @template T - [ID] : Tipe nilai state. [EN] : State value type.
|
|
7
|
+
* @param initialValue - [ID] : Nilai awal. [EN] : Initial value.
|
|
8
|
+
* @returns [ID] : Tuple berisi nilai, fungsi setter, dan referensi.
|
|
9
|
+
* [EN] : Tuple containing value, setter function, and reference.
|
|
10
|
+
*/
|
|
2
11
|
declare function useStateRef<T>(initialValue: T): [T, React.Dispatch<React.SetStateAction<T>>, React.MutableRefObject<T>];
|
|
3
12
|
export default useStateRef;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { ToastOptions } from 'react-toastify';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* [ID] : Interface untuk opsi komponen Alert.
|
|
5
|
+
* [EN] : Interface for Alert component options.
|
|
6
|
+
*/
|
|
2
7
|
export interface IOptionAlert extends ToastOptions {
|
|
8
|
+
/**
|
|
9
|
+
* [ID] : Jenis alert (opsional).
|
|
10
|
+
* [EN] : Alert kind (optional).
|
|
11
|
+
*/
|
|
3
12
|
kind?: 'laba' | 'payhere';
|
|
4
13
|
}
|
|
@@ -1,11 +1,41 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { IBorderRadius } from '../../../config/components/borderRadius';
|
|
3
3
|
import { Itypography } from '../../../config/components/typography';
|
|
4
|
+
import { TFont } from '../../../config/components/font';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* [ID] : Interface untuk komponen Badges.
|
|
8
|
+
* [EN] : Interface for Badges component.
|
|
9
|
+
*/
|
|
4
10
|
export interface IBadges extends React.HTMLAttributes<HTMLSpanElement> {
|
|
11
|
+
/**
|
|
12
|
+
* [ID] : Konten anak di dalam badge.
|
|
13
|
+
* [EN] : Child content inside the badge.
|
|
14
|
+
*/
|
|
5
15
|
children: ReactNode | ReactNode[];
|
|
16
|
+
/**
|
|
17
|
+
* [ID] : Nama kelas CSS tambahan (opsional).
|
|
18
|
+
* [EN] : Additional CSS class name (optional).
|
|
19
|
+
*/
|
|
6
20
|
className?: string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* [ID] : Konfigurasi radius sudut badge (opsional).
|
|
23
|
+
* [EN] : Badge border radius configuration (optional).
|
|
24
|
+
*/
|
|
7
25
|
rounded?: IBorderRadius;
|
|
26
|
+
/**
|
|
27
|
+
* [ID] : Varian gaya badge (opsional).
|
|
28
|
+
* [EN] : Badge style variant (optional).
|
|
29
|
+
*/
|
|
8
30
|
variants?: 'filled-gray-600' | 'filled-green-600' | 'filled-green-50' | 'filled-blue-gray-50' | 'filled-red-500' | 'filled-blue-600' | 'filled-amber-800' | 'filled-pink-600' | 'filled-lime-700' | 'filled-lime-900-bg_lime-100' | 'filled-red-900' | 'filled-laba-green-10' | 'filled-cyan-800-bg_cyan-100' | 'ghost-gray-200' | 'ghost-green-100' | 'ghost-red-100' | 'ghost-blue-100' | 'ghost-amber-100' | 'ghost-laba-orange-01' | 'ghost-laba-green-01' | 'ghost-laba-green-02' | 'ghost-laba-blue-02' | 'ghost-laba-blue-01' | 'ghost-laba-grey-05' | 'ghost-laba-red-01' | 'outline-gray-600' | 'outline-green-600' | 'outline-red-500' | 'outline-blue-600' | 'outline-amber-800' | 'outline-laba-blue-01' | 'outline-laba-orange-06' | 'outline-laba-orange-06-bg_laba-orange-01' | 'outline-laba-red-06' | 'outline-laba-green-06';
|
|
9
|
-
|
|
31
|
+
/**
|
|
32
|
+
* [ID] : Konfigurasi font (opsional).
|
|
33
|
+
* [EN] : Font configuration (optional).
|
|
34
|
+
*/
|
|
35
|
+
fonts?: TFont;
|
|
36
|
+
/**
|
|
37
|
+
* [ID] : Konfigurasi tipografi (opsional).
|
|
38
|
+
* [EN] : Typography configuration (optional).
|
|
39
|
+
*/
|
|
10
40
|
typography?: Itypography;
|
|
11
41
|
}
|
|
@@ -1,18 +1,102 @@
|
|
|
1
1
|
import { ReactNode, ElementType, HTMLAttributes } from 'react';
|
|
2
2
|
import { IGap } from '../../../config/components/gap';
|
|
3
|
+
import { TFont } from '../../../config/components/font';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* [ID] : Interface untuk komponen Breadcrumbs.
|
|
7
|
+
* [EN] : Interface for Breadcrumbs component.
|
|
8
|
+
* @template T - [ID] : Tipe elemen HTML. [EN] : HTML element type.
|
|
9
|
+
*/
|
|
3
10
|
export interface IBreadcrumbs<T extends ElementType> extends HTMLAttributes<HTMLDivElement> {
|
|
11
|
+
/**
|
|
12
|
+
* [ID] : Elemen HTML yang akan dirender (opsional).
|
|
13
|
+
* [EN] : HTML element to be rendered (optional).
|
|
14
|
+
*/
|
|
4
15
|
as?: T;
|
|
5
|
-
|
|
6
|
-
|
|
16
|
+
/**
|
|
17
|
+
* [ID] : Konfigurasi font (opsional).
|
|
18
|
+
* [EN] : Font configuration (optional).
|
|
19
|
+
*/
|
|
20
|
+
fonts?: TFont;
|
|
21
|
+
/**
|
|
22
|
+
* [ID] : Varian gaya breadcrumbs (opsional).
|
|
23
|
+
* [EN] : Breadcrumbs style variant (optional).
|
|
24
|
+
*/
|
|
25
|
+
variants?: 'laba-blue-10' | 'blue-700' | 'bill-secondary-800';
|
|
26
|
+
/**
|
|
27
|
+
* [ID] : Daftar URL untuk setiap breadcrumb.
|
|
28
|
+
* [EN] : List of URLs for each breadcrumb.
|
|
29
|
+
*/
|
|
7
30
|
urls: string[];
|
|
31
|
+
/**
|
|
32
|
+
* [ID] : Teks label untuk setiap breadcrumb.
|
|
33
|
+
* [EN] : Label text for each breadcrumb.
|
|
34
|
+
*/
|
|
8
35
|
textBreadcrumbs: string[];
|
|
36
|
+
/**
|
|
37
|
+
* [ID] : Handler klik untuk setiap breadcrumb (opsional).
|
|
38
|
+
* [EN] : Click handler for each breadcrumb (optional).
|
|
39
|
+
*/
|
|
9
40
|
onClickBreadcrumbs?: (() => void | undefined)[];
|
|
41
|
+
/**
|
|
42
|
+
* [ID] : Handler klik untuk aksi tambahan (opsional).
|
|
43
|
+
* [EN] : Click handler for additional action (optional).
|
|
44
|
+
*/
|
|
10
45
|
onClickAction?: () => void;
|
|
46
|
+
/**
|
|
47
|
+
* [ID] : Handler klik global untuk URL (opsional).
|
|
48
|
+
* [EN] : Global click handler for URLs (optional).
|
|
49
|
+
* @param url - [ID] : URL yang diklik. [EN] : Clicked URL.
|
|
50
|
+
*/
|
|
11
51
|
onClickUrls?: (url: string) => void;
|
|
52
|
+
/**
|
|
53
|
+
* [ID] : Jarak untuk elemen aksi (opsional).
|
|
54
|
+
* [EN] : Gap for action element (optional).
|
|
55
|
+
*/
|
|
12
56
|
gapAction?: IGap;
|
|
57
|
+
/**
|
|
58
|
+
* [ID] : Jarak antar URL (opsional).
|
|
59
|
+
* [EN] : Gap between URLs (optional).
|
|
60
|
+
*/
|
|
13
61
|
gapUrls?: IGap;
|
|
62
|
+
/**
|
|
63
|
+
* [ID] : Teks untuk tombol aksi (opsional).
|
|
64
|
+
* [EN] : Text for action button (optional).
|
|
65
|
+
*/
|
|
14
66
|
textAction?: string;
|
|
67
|
+
/**
|
|
68
|
+
* [ID] : Ikon untuk tombol aksi (opsional).
|
|
69
|
+
* [EN] : Icon for action button (optional).
|
|
70
|
+
*/
|
|
15
71
|
iconAction?: ReactNode | ReactNode[];
|
|
72
|
+
/**
|
|
73
|
+
* [ID] : Pemisah antar breadcrumb (opsional).
|
|
74
|
+
* [EN] : Separator between breadcrumbs (optional).
|
|
75
|
+
*/
|
|
16
76
|
separator?: ReactNode | ReactNode[] | string;
|
|
77
|
+
/**
|
|
78
|
+
* [ID] : Fungsi untuk menghasilkan properti link kustom (opsional).
|
|
79
|
+
* [EN] : Function to generate custom link properties (optional).
|
|
80
|
+
* @param value - [ID] : Nilai teks breadcrumb. [EN] : Breadcrumb text value.
|
|
81
|
+
* @param index - [ID] : Indeks breadcrumb. [EN] : Breadcrumb index.
|
|
82
|
+
* @param urls - [ID] : Array semua URL. [EN] : Array of all URLs.
|
|
83
|
+
* @returns [ID] : Objek properti. [EN] : Property object.
|
|
84
|
+
*/
|
|
17
85
|
propsLink?: (value: string, index: number, urls: string[]) => object;
|
|
86
|
+
/**
|
|
87
|
+
* [ID] : Nama kelas CSS untuk elemen aksi (opsional).
|
|
88
|
+
* [EN] : CSS class name for action element (optional).
|
|
89
|
+
*/
|
|
90
|
+
classNameAction?: string;
|
|
91
|
+
/**
|
|
92
|
+
* [ID] : Nama kelas CSS untuk URL (opsional).
|
|
93
|
+
* [EN] : CSS class name for URL (optional).
|
|
94
|
+
*/
|
|
95
|
+
classNameUrl?: string;
|
|
96
|
+
/**
|
|
97
|
+
* [ID] : Fungsi render kustom untuk aksi (opsional).
|
|
98
|
+
* [EN] : Custom render function for action (optional).
|
|
99
|
+
* @returns [ID] : Elemen React. [EN] : React element.
|
|
100
|
+
*/
|
|
101
|
+
renderAction?: () => ReactNode | ReactNode[];
|
|
18
102
|
}
|