@ttdk-design-system/library-react 0.0.0-stage → 1.0.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/AI_GUIDE.md +6518 -0
- package/llms.txt +6518 -0
- package/package.json +1098 -4
- package/src/core/index.ts +2 -0
- package/src/core/tailwind-preset.cjs +62 -0
- package/src/core/tailwind-preset.ts +85 -0
- package/src/core/theme/tokens.css +663 -0
- package/src/core/types.ts +836 -0
- package/src/index.ts +17 -0
- package/src/tailwind-preset.cjs +62 -0
- package/src/tailwind-preset.ts +85 -0
- package/src/types.ts +1 -0
- package/src/web/accordion/AI_GUIDE.md +149 -0
- package/src/web/accordion/accordion.css +1 -0
- package/src/web/accordion/accordion.tsx +430 -0
- package/src/web/accordion/index.ts +3 -0
- package/src/web/accordion/manifest.json +351 -0
- package/src/web/alert/AI_GUIDE.md +139 -0
- package/src/web/alert/alert.css +1 -0
- package/src/web/alert/alert.tsx +318 -0
- package/src/web/alert/index.ts +3 -0
- package/src/web/alert/manifest.json +240 -0
- package/src/web/avatar/AI_GUIDE.md +118 -0
- package/src/web/avatar/avatar.css +1 -0
- package/src/web/avatar/avatar.tsx +233 -0
- package/src/web/avatar/index.ts +3 -0
- package/src/web/avatar/manifest.json +195 -0
- package/src/web/badge/AI_GUIDE.md +94 -0
- package/src/web/badge/badge.css +1 -0
- package/src/web/badge/badge.tsx +140 -0
- package/src/web/badge/index.ts +2 -0
- package/src/web/badge/manifest.json +141 -0
- package/src/web/banner/AI_GUIDE.md +130 -0
- package/src/web/banner/banner.css +1 -0
- package/src/web/banner/banner.tsx +334 -0
- package/src/web/banner/index.ts +3 -0
- package/src/web/banner/manifest.json +240 -0
- package/src/web/breadcrumb/AI_GUIDE.md +120 -0
- package/src/web/breadcrumb/breadcrumb.css +1 -0
- package/src/web/breadcrumb/breadcrumb.tsx +306 -0
- package/src/web/breadcrumb/index.ts +3 -0
- package/src/web/breadcrumb/manifest.json +225 -0
- package/src/web/button/AI_GUIDE.md +121 -0
- package/src/web/button/button.css +1 -0
- package/src/web/button/button.tsx +287 -0
- package/src/web/button/index.ts +2 -0
- package/src/web/button/manifest.json +177 -0
- package/src/web/calendar/AI_GUIDE.md +151 -0
- package/src/web/calendar/calendar.css +1 -0
- package/src/web/calendar/calendar.tsx +1611 -0
- package/src/web/calendar/index.ts +3 -0
- package/src/web/calendar/manifest.json +470 -0
- package/src/web/card/AI_GUIDE.md +133 -0
- package/src/web/card/card.css +1 -0
- package/src/web/card/card.tsx +408 -0
- package/src/web/card/index.ts +4 -0
- package/src/web/card/manifest.json +357 -0
- package/src/web/checkbox/AI_GUIDE.md +146 -0
- package/src/web/checkbox/checkbox.css +1 -0
- package/src/web/checkbox/checkbox.tsx +307 -0
- package/src/web/checkbox/index.ts +2 -0
- package/src/web/checkbox/manifest.json +294 -0
- package/src/web/chip/AI_GUIDE.md +186 -0
- package/src/web/chip/chip.css +1 -0
- package/src/web/chip/chip.tsx +230 -0
- package/src/web/chip/index.ts +2 -0
- package/src/web/chip/manifest.json +186 -0
- package/src/web/dropdown/AI_GUIDE.md +167 -0
- package/src/web/dropdown/dropdown.css +1 -0
- package/src/web/dropdown/dropdown.tsx +1274 -0
- package/src/web/dropdown/index.ts +3 -0
- package/src/web/dropdown/manifest.json +576 -0
- package/src/web/flex/AI_GUIDE.md +113 -0
- package/src/web/flex/flex-item.tsx +97 -0
- package/src/web/flex/flex.css +1 -0
- package/src/web/flex/flex.tsx +108 -0
- package/src/web/flex/index.ts +5 -0
- package/src/web/flex/manifest.json +162 -0
- package/src/web/form/index.ts +7 -0
- package/src/web/grid/AI_GUIDE.md +112 -0
- package/src/web/grid/grid-item.tsx +112 -0
- package/src/web/grid/grid.css +1 -0
- package/src/web/grid/grid.tsx +99 -0
- package/src/web/grid/index.ts +5 -0
- package/src/web/grid/manifest.json +153 -0
- package/src/web/index.ts +86 -0
- package/src/web/input/AI_GUIDE.md +159 -0
- package/src/web/input/index.ts +3 -0
- package/src/web/input/input.css +1 -0
- package/src/web/input/input.tsx +537 -0
- package/src/web/input/manifest.json +465 -0
- package/src/web/input-number/AI_GUIDE.md +164 -0
- package/src/web/input-number/index.ts +3 -0
- package/src/web/input-number/input-number.css +1 -0
- package/src/web/input-number/input-number.tsx +1193 -0
- package/src/web/input-number/manifest.json +575 -0
- package/src/web/modal/AI_GUIDE.md +171 -0
- package/src/web/modal/index.ts +3 -0
- package/src/web/modal/manifest.json +375 -0
- package/src/web/modal/modal.css +1 -0
- package/src/web/modal/modal.tsx +571 -0
- package/src/web/pagination/AI_GUIDE.md +148 -0
- package/src/web/pagination/index.ts +21 -0
- package/src/web/pagination/manifest.json +432 -0
- package/src/web/pagination/pagination-content.tsx +45 -0
- package/src/web/pagination/pagination-ellipsis.tsx +54 -0
- package/src/web/pagination/pagination-first.tsx +155 -0
- package/src/web/pagination/pagination-item.tsx +45 -0
- package/src/web/pagination/pagination-last.tsx +155 -0
- package/src/web/pagination/pagination-link.tsx +121 -0
- package/src/web/pagination/pagination-next.tsx +158 -0
- package/src/web/pagination/pagination-previous.tsx +158 -0
- package/src/web/pagination/pagination.css +1 -0
- package/src/web/pagination/pagination.tsx +687 -0
- package/src/web/popover/AI_GUIDE.md +163 -0
- package/src/web/popover/index.ts +3 -0
- package/src/web/popover/manifest.json +396 -0
- package/src/web/popover/popover.css +1 -0
- package/src/web/popover/popover.tsx +702 -0
- package/src/web/radio/AI_GUIDE.md +155 -0
- package/src/web/radio/index.ts +2 -0
- package/src/web/radio/manifest.json +294 -0
- package/src/web/radio/radio.css +1 -0
- package/src/web/radio/radio.tsx +290 -0
- package/src/web/selectbox/AI_GUIDE.md +216 -0
- package/src/web/selectbox/index.ts +3 -0
- package/src/web/selectbox/manifest.json +477 -0
- package/src/web/selectbox/selectbox.css +1 -0
- package/src/web/selectbox/selectbox.tsx +1048 -0
- package/src/web/sonner/AI_GUIDE.md +98 -0
- package/src/web/sonner/index.ts +114 -0
- package/src/web/sonner/manifest.json +132 -0
- package/src/web/sonner/sonner.css +1 -0
- package/src/web/sonner/sonner.tsx +177 -0
- package/src/web/table/AI_GUIDE.md +145 -0
- package/src/web/table/index.ts +35 -0
- package/src/web/table/manifest.json +168 -0
- package/src/web/table/table-body.tsx +45 -0
- package/src/web/table/table-caption.tsx +45 -0
- package/src/web/table/table-cell.tsx +74 -0
- package/src/web/table/table-empty.tsx +108 -0
- package/src/web/table/table-footer.tsx +45 -0
- package/src/web/table/table-head.tsx +80 -0
- package/src/web/table/table-header.tsx +45 -0
- package/src/web/table/table-row.tsx +69 -0
- package/src/web/table/table.css +1 -0
- package/src/web/table/table.tsx +305 -0
- package/src/web/tabs/AI_GUIDE.md +150 -0
- package/src/web/tabs/index.ts +3 -0
- package/src/web/tabs/manifest.json +315 -0
- package/src/web/tabs/tabs.css +1 -0
- package/src/web/tabs/tabs.tsx +332 -0
- package/src/web/text/AI_GUIDE.md +129 -0
- package/src/web/text/index.ts +3 -0
- package/src/web/text/manifest.json +195 -0
- package/src/web/text/text.css +1 -0
- package/src/web/text/text.tsx +689 -0
- package/src/web/textarea/AI_GUIDE.md +141 -0
- package/src/web/textarea/index.ts +3 -0
- package/src/web/textarea/manifest.json +438 -0
- package/src/web/textarea/textarea.css +1 -0
- package/src/web/textarea/textarea.tsx +467 -0
- package/src/web/tooltip/AI_GUIDE.md +110 -0
- package/src/web/tooltip/index.ts +3 -0
- package/src/web/tooltip/manifest.json +222 -0
- package/src/web/tooltip/tooltip.css +1 -0
- package/src/web/tooltip/tooltip.tsx +423 -0
- package/src/webview/bottomsheet/AI_GUIDE.md +141 -0
- package/src/webview/bottomsheet/bottomsheet.css +1 -0
- package/src/webview/bottomsheet/bottomsheet.tsx +603 -0
- package/src/webview/bottomsheet/index.ts +4 -0
- package/src/webview/bottomsheet/manifest.json +377 -0
- package/src/webview/button/AI_GUIDE.md +79 -0
- package/src/webview/button/button-ios.css +1 -0
- package/src/webview/button/button-ios.tsx +138 -0
- package/src/webview/button/button-material.css +1 -0
- package/src/webview/button/button-material.tsx +138 -0
- package/src/webview/button/index.ts +7 -0
- package/src/webview/button/manifest.json +148 -0
- package/src/webview/index.ts +7 -0
- package/tailwind-preset.cjs +62 -0
- package/tailwind-preset.js +62 -0
- package/ttdk-manifest.json +10188 -0
- package/README.md +0 -3
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
export interface PaginationFirstProps {
|
|
5
|
+
/**
|
|
6
|
+
* Inline CSS style kustom.
|
|
7
|
+
*/
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
/**
|
|
10
|
+
* URL tujuan navigasi (jika menggunakan tautan anchor <a>).
|
|
11
|
+
*/
|
|
12
|
+
href?: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Teks label tombol opsional.
|
|
16
|
+
*/
|
|
17
|
+
text?: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Mode hanya menampilkan ikon tanpa teks.
|
|
21
|
+
* @default true
|
|
22
|
+
*/
|
|
23
|
+
iconOnly?: boolean;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Menonaktifkan tombol.
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Skala ukuran tombol.
|
|
33
|
+
* @default 'md'
|
|
34
|
+
*/
|
|
35
|
+
size?: "sm" | "md" | "lg" | "icon";
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Kustomisasi visual granular tombol navigasi (UiProps).
|
|
39
|
+
*/
|
|
40
|
+
ui?: UiProps;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Callback saat tombol diklik.
|
|
44
|
+
*/
|
|
45
|
+
onClick?: (event?: any) => void;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Class CSS kustom.
|
|
49
|
+
*/
|
|
50
|
+
className?: string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Label aksesibilitas ARIA.
|
|
54
|
+
* @default 'Go to first page'
|
|
55
|
+
*/
|
|
56
|
+
ariaLabel?: string;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Ikon kustom untuk tombol first page (menggantikan <<).
|
|
60
|
+
*/
|
|
61
|
+
icon?: any;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Tombol navigasi langsung ke halaman pertama (Compound PaginationFirst).
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
import { buildUiVars, UiProps } from "../../core/types";
|
|
69
|
+
|
|
70
|
+
function PaginationFirst(props: PaginationFirstProps) {
|
|
71
|
+
return (
|
|
72
|
+
<>
|
|
73
|
+
{Boolean(props.href) && !props.disabled ? (
|
|
74
|
+
<a
|
|
75
|
+
href={props.href}
|
|
76
|
+
className={`ttdk-pagination-link ttdk-pagination-first ${
|
|
77
|
+
props.className || ""
|
|
78
|
+
}`.trim()}
|
|
79
|
+
aria-label={props.ariaLabel || "Go to first page"}
|
|
80
|
+
data-size={props.size || "md"}
|
|
81
|
+
data-disabled={props.disabled ? "true" : "false"}
|
|
82
|
+
style={{
|
|
83
|
+
...buildUiVars(props.ui),
|
|
84
|
+
...((props as any)["style"] || {}),
|
|
85
|
+
...props.style,
|
|
86
|
+
}}
|
|
87
|
+
onClick={(e) => {
|
|
88
|
+
if (props.disabled) {
|
|
89
|
+
e.preventDefault();
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (props.onClick) {
|
|
93
|
+
props.onClick(e);
|
|
94
|
+
}
|
|
95
|
+
}}
|
|
96
|
+
>
|
|
97
|
+
{props.icon ? <>{props.icon}</> : null}
|
|
98
|
+
{!props.icon ? (
|
|
99
|
+
<svg
|
|
100
|
+
className="ttdk-pagination-icon"
|
|
101
|
+
viewBox="0 0 24 24"
|
|
102
|
+
fill="none"
|
|
103
|
+
aria-hidden="true"
|
|
104
|
+
>
|
|
105
|
+
<polyline points="11 17 6 12 11 7" />
|
|
106
|
+
<polyline points="18 17 13 12 18 7" />
|
|
107
|
+
</svg>
|
|
108
|
+
) : null}
|
|
109
|
+
{!props.iconOnly && Boolean(props.text) ? (
|
|
110
|
+
<span className="ttdk-pagination-first-text">{props.text}</span>
|
|
111
|
+
) : null}
|
|
112
|
+
</a>
|
|
113
|
+
) : null}
|
|
114
|
+
{!props.href || Boolean(props.disabled) ? (
|
|
115
|
+
<button
|
|
116
|
+
type="button"
|
|
117
|
+
className={`ttdk-pagination-link ttdk-pagination-first ${
|
|
118
|
+
props.className || ""
|
|
119
|
+
}`.trim()}
|
|
120
|
+
aria-label={props.ariaLabel || "Go to first page"}
|
|
121
|
+
data-size={props.size || "md"}
|
|
122
|
+
data-disabled={props.disabled ? "true" : "false"}
|
|
123
|
+
disabled={props.disabled}
|
|
124
|
+
style={{
|
|
125
|
+
...buildUiVars(props.ui),
|
|
126
|
+
...((props as any)["style"] || {}),
|
|
127
|
+
}}
|
|
128
|
+
onClick={(e) => {
|
|
129
|
+
if (!props.disabled && props.onClick) {
|
|
130
|
+
props.onClick(e);
|
|
131
|
+
}
|
|
132
|
+
}}
|
|
133
|
+
>
|
|
134
|
+
{props.icon ? <>{props.icon}</> : null}
|
|
135
|
+
{!props.icon ? (
|
|
136
|
+
<svg
|
|
137
|
+
className="ttdk-pagination-icon"
|
|
138
|
+
viewBox="0 0 24 24"
|
|
139
|
+
fill="none"
|
|
140
|
+
aria-hidden="true"
|
|
141
|
+
>
|
|
142
|
+
<polyline points="11 17 6 12 11 7" />
|
|
143
|
+
<polyline points="18 17 13 12 18 7" />
|
|
144
|
+
</svg>
|
|
145
|
+
) : null}
|
|
146
|
+
{!props.iconOnly && Boolean(props.text) ? (
|
|
147
|
+
<span className="ttdk-pagination-first-text">{props.text}</span>
|
|
148
|
+
) : null}
|
|
149
|
+
</button>
|
|
150
|
+
) : null}
|
|
151
|
+
</>
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export default PaginationFirst;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
export interface PaginationItemProps {
|
|
4
|
+
/**
|
|
5
|
+
* Inline CSS style kustom.
|
|
6
|
+
*/
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
/**
|
|
9
|
+
* Kustomisasi visual granular li.ttdk-pagination-item (UiProps).
|
|
10
|
+
*/
|
|
11
|
+
ui?: UiProps;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Class CSS kustom.
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Konten pagination item.
|
|
20
|
+
*/
|
|
21
|
+
children?: any;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Komponen pembungkus item halaman `<li>` (Compound PaginationItem ala Shadcn UI).
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
import { buildUiVars, UiProps } from "../../core/types";
|
|
29
|
+
|
|
30
|
+
function PaginationItem(props: PaginationItemProps) {
|
|
31
|
+
return (
|
|
32
|
+
<li
|
|
33
|
+
className={`ttdk-pagination-item ${props.className || ""}`.trim()}
|
|
34
|
+
style={{
|
|
35
|
+
...buildUiVars(props.ui),
|
|
36
|
+
...((props as any)["style"] || {}),
|
|
37
|
+
...props.style,
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
<>{props.children}</>
|
|
41
|
+
</li>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default PaginationItem;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
export interface PaginationLastProps {
|
|
5
|
+
/**
|
|
6
|
+
* Inline CSS style kustom.
|
|
7
|
+
*/
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
/**
|
|
10
|
+
* URL tujuan navigasi (jika menggunakan tautan anchor <a>).
|
|
11
|
+
*/
|
|
12
|
+
href?: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Teks label tombol opsional.
|
|
16
|
+
*/
|
|
17
|
+
text?: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Mode hanya menampilkan ikon tanpa teks.
|
|
21
|
+
* @default true
|
|
22
|
+
*/
|
|
23
|
+
iconOnly?: boolean;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Menonaktifkan tombol.
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Skala ukuran tombol.
|
|
33
|
+
* @default 'md'
|
|
34
|
+
*/
|
|
35
|
+
size?: "sm" | "md" | "lg" | "icon";
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Kustomisasi visual granular tombol navigasi (UiProps).
|
|
39
|
+
*/
|
|
40
|
+
ui?: UiProps;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Callback saat tombol diklik.
|
|
44
|
+
*/
|
|
45
|
+
onClick?: (event?: any) => void;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Class CSS kustom.
|
|
49
|
+
*/
|
|
50
|
+
className?: string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Label aksesibilitas ARIA.
|
|
54
|
+
* @default 'Go to last page'
|
|
55
|
+
*/
|
|
56
|
+
ariaLabel?: string;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Ikon kustom untuk tombol last page (menggantikan >>).
|
|
60
|
+
*/
|
|
61
|
+
icon?: any;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Tombol navigasi langsung ke halaman terakhir (Compound PaginationLast).
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
import { buildUiVars, UiProps } from "../../core/types";
|
|
69
|
+
|
|
70
|
+
function PaginationLast(props: PaginationLastProps) {
|
|
71
|
+
return (
|
|
72
|
+
<>
|
|
73
|
+
{Boolean(props.href) && !props.disabled ? (
|
|
74
|
+
<a
|
|
75
|
+
href={props.href}
|
|
76
|
+
className={`ttdk-pagination-link ttdk-pagination-last ${
|
|
77
|
+
props.className || ""
|
|
78
|
+
}`.trim()}
|
|
79
|
+
aria-label={props.ariaLabel || "Go to last page"}
|
|
80
|
+
data-size={props.size || "md"}
|
|
81
|
+
data-disabled={props.disabled ? "true" : "false"}
|
|
82
|
+
style={{
|
|
83
|
+
...buildUiVars(props.ui),
|
|
84
|
+
...((props as any)["style"] || {}),
|
|
85
|
+
...props.style,
|
|
86
|
+
}}
|
|
87
|
+
onClick={(e) => {
|
|
88
|
+
if (props.disabled) {
|
|
89
|
+
e.preventDefault();
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (props.onClick) {
|
|
93
|
+
props.onClick(e);
|
|
94
|
+
}
|
|
95
|
+
}}
|
|
96
|
+
>
|
|
97
|
+
{!props.iconOnly && Boolean(props.text) ? (
|
|
98
|
+
<span className="ttdk-pagination-last-text">{props.text}</span>
|
|
99
|
+
) : null}
|
|
100
|
+
{props.icon ? <>{props.icon}</> : null}
|
|
101
|
+
{!props.icon ? (
|
|
102
|
+
<svg
|
|
103
|
+
className="ttdk-pagination-icon"
|
|
104
|
+
viewBox="0 0 24 24"
|
|
105
|
+
fill="none"
|
|
106
|
+
aria-hidden="true"
|
|
107
|
+
>
|
|
108
|
+
<polyline points="13 17 18 12 13 7" />
|
|
109
|
+
<polyline points="6 17 11 12 6 7" />
|
|
110
|
+
</svg>
|
|
111
|
+
) : null}
|
|
112
|
+
</a>
|
|
113
|
+
) : null}
|
|
114
|
+
{!props.href || Boolean(props.disabled) ? (
|
|
115
|
+
<button
|
|
116
|
+
type="button"
|
|
117
|
+
className={`ttdk-pagination-link ttdk-pagination-last ${
|
|
118
|
+
props.className || ""
|
|
119
|
+
}`.trim()}
|
|
120
|
+
aria-label={props.ariaLabel || "Go to last page"}
|
|
121
|
+
data-size={props.size || "md"}
|
|
122
|
+
data-disabled={props.disabled ? "true" : "false"}
|
|
123
|
+
disabled={props.disabled}
|
|
124
|
+
style={{
|
|
125
|
+
...buildUiVars(props.ui),
|
|
126
|
+
...((props as any)["style"] || {}),
|
|
127
|
+
}}
|
|
128
|
+
onClick={(e) => {
|
|
129
|
+
if (!props.disabled && props.onClick) {
|
|
130
|
+
props.onClick(e);
|
|
131
|
+
}
|
|
132
|
+
}}
|
|
133
|
+
>
|
|
134
|
+
{!props.iconOnly && Boolean(props.text) ? (
|
|
135
|
+
<span className="ttdk-pagination-last-text">{props.text}</span>
|
|
136
|
+
) : null}
|
|
137
|
+
{props.icon ? <>{props.icon}</> : null}
|
|
138
|
+
{!props.icon ? (
|
|
139
|
+
<svg
|
|
140
|
+
className="ttdk-pagination-icon"
|
|
141
|
+
viewBox="0 0 24 24"
|
|
142
|
+
fill="none"
|
|
143
|
+
aria-hidden="true"
|
|
144
|
+
>
|
|
145
|
+
<polyline points="13 17 18 12 13 7" />
|
|
146
|
+
<polyline points="6 17 11 12 6 7" />
|
|
147
|
+
</svg>
|
|
148
|
+
) : null}
|
|
149
|
+
</button>
|
|
150
|
+
) : null}
|
|
151
|
+
</>
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export default PaginationLast;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
export interface PaginationLinkProps {
|
|
5
|
+
/**
|
|
6
|
+
* Inline CSS style kustom.
|
|
7
|
+
*/
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
/**
|
|
10
|
+
* Menandai item sebagai halaman yang sedang aktif saat ini.
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
isActive?: boolean;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Menonaktifkan link atau tombol halaman.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Ukuran link pagination.
|
|
23
|
+
* @default 'md'
|
|
24
|
+
*/
|
|
25
|
+
size?: "sm" | "md" | "lg" | "icon";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* URL tujuan navigasi (jika menggunakan tautan anchor <a>).
|
|
29
|
+
*/
|
|
30
|
+
href?: string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Kustomisasi visual granular tombol link pagination (UiProps).
|
|
34
|
+
*/
|
|
35
|
+
ui?: UiProps;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Callback saat link atau tombol diklik.
|
|
39
|
+
*/
|
|
40
|
+
onClick?: (event?: any) => void;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Class CSS kustom.
|
|
44
|
+
*/
|
|
45
|
+
className?: string;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Label aksesibilitas ARIA.
|
|
49
|
+
*/
|
|
50
|
+
ariaLabel?: string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Konten teks atau elemen anak di dalam link pagination.
|
|
54
|
+
*/
|
|
55
|
+
children?: any;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Komponen tombol atau link nomor halaman (Compound PaginationLink ala Shadcn UI).
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
import { buildUiVars, UiProps } from "../../core/types";
|
|
63
|
+
|
|
64
|
+
function PaginationLink(props: PaginationLinkProps) {
|
|
65
|
+
return (
|
|
66
|
+
<>
|
|
67
|
+
{Boolean(props.href) && !props.disabled ? (
|
|
68
|
+
<a
|
|
69
|
+
href={props.href}
|
|
70
|
+
className={`ttdk-pagination-link ${props.className || ""}`.trim()}
|
|
71
|
+
aria-current={props.isActive ? "page" : undefined}
|
|
72
|
+
aria-label={props.ariaLabel}
|
|
73
|
+
data-active={props.isActive ? "true" : "false"}
|
|
74
|
+
data-size={props.size || "md"}
|
|
75
|
+
data-disabled={props.disabled ? "true" : "false"}
|
|
76
|
+
style={{
|
|
77
|
+
...buildUiVars(props.ui),
|
|
78
|
+
...((props as any)["style"] || {}),
|
|
79
|
+
...props.style,
|
|
80
|
+
}}
|
|
81
|
+
onClick={(e) => {
|
|
82
|
+
if (props.disabled) {
|
|
83
|
+
e.preventDefault();
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (props.onClick) {
|
|
87
|
+
props.onClick(e);
|
|
88
|
+
}
|
|
89
|
+
}}
|
|
90
|
+
>
|
|
91
|
+
<>{props.children}</>
|
|
92
|
+
</a>
|
|
93
|
+
) : null}
|
|
94
|
+
{!props.href || Boolean(props.disabled) ? (
|
|
95
|
+
<button
|
|
96
|
+
type="button"
|
|
97
|
+
className={`ttdk-pagination-link ${props.className || ""}`.trim()}
|
|
98
|
+
aria-current={props.isActive ? "page" : undefined}
|
|
99
|
+
aria-label={props.ariaLabel}
|
|
100
|
+
data-active={props.isActive ? "true" : "false"}
|
|
101
|
+
data-size={props.size || "md"}
|
|
102
|
+
data-disabled={props.disabled ? "true" : "false"}
|
|
103
|
+
disabled={props.disabled}
|
|
104
|
+
style={{
|
|
105
|
+
...buildUiVars(props.ui),
|
|
106
|
+
...((props as any)["style"] || {}),
|
|
107
|
+
}}
|
|
108
|
+
onClick={(e) => {
|
|
109
|
+
if (!props.disabled && props.onClick) {
|
|
110
|
+
props.onClick(e);
|
|
111
|
+
}
|
|
112
|
+
}}
|
|
113
|
+
>
|
|
114
|
+
<>{props.children}</>
|
|
115
|
+
</button>
|
|
116
|
+
) : null}
|
|
117
|
+
</>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export default PaginationLink;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
export interface PaginationNextProps {
|
|
5
|
+
/**
|
|
6
|
+
* Inline CSS style kustom.
|
|
7
|
+
*/
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
/**
|
|
10
|
+
* URL tujuan navigasi (jika menggunakan tautan anchor <a>).
|
|
11
|
+
*/
|
|
12
|
+
href?: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Teks label tombol.
|
|
16
|
+
* @default 'Next'
|
|
17
|
+
*/
|
|
18
|
+
text?: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Mode hanya menampilkan ikon tanpa teks.
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
iconOnly?: boolean;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Menonaktifkan tombol.
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Skala ukuran tombol.
|
|
34
|
+
* @default 'md'
|
|
35
|
+
*/
|
|
36
|
+
size?: "sm" | "md" | "lg" | "icon";
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Kustomisasi visual granular tombol navigasi (UiProps).
|
|
40
|
+
*/
|
|
41
|
+
ui?: UiProps;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Callback saat tombol diklik.
|
|
45
|
+
*/
|
|
46
|
+
onClick?: (event?: any) => void;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Class CSS kustom.
|
|
50
|
+
*/
|
|
51
|
+
className?: string;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Label aksesibilitas ARIA.
|
|
55
|
+
* @default 'Go to next page'
|
|
56
|
+
*/
|
|
57
|
+
ariaLabel?: string;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Ikon kustom untuk tombol next page (menggantikan >).
|
|
61
|
+
*/
|
|
62
|
+
icon?: any;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Tombol navigasi ke halaman selanjutnya (Compound PaginationNext ala Shadcn UI).
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
import { buildUiVars, UiProps } from "../../core/types";
|
|
70
|
+
|
|
71
|
+
function PaginationNext(props: PaginationNextProps) {
|
|
72
|
+
return (
|
|
73
|
+
<>
|
|
74
|
+
{Boolean(props.href) && !props.disabled ? (
|
|
75
|
+
<a
|
|
76
|
+
href={props.href}
|
|
77
|
+
className={`ttdk-pagination-link ttdk-pagination-next ${
|
|
78
|
+
props.className || ""
|
|
79
|
+
}`.trim()}
|
|
80
|
+
aria-label={props.ariaLabel || "Go to next page"}
|
|
81
|
+
data-size={props.size || "md"}
|
|
82
|
+
data-disabled={props.disabled ? "true" : "false"}
|
|
83
|
+
style={{
|
|
84
|
+
...buildUiVars(props.ui),
|
|
85
|
+
...((props as any)["style"] || {}),
|
|
86
|
+
...props.style,
|
|
87
|
+
}}
|
|
88
|
+
onClick={(e) => {
|
|
89
|
+
if (props.disabled) {
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (props.onClick) {
|
|
94
|
+
props.onClick(e);
|
|
95
|
+
}
|
|
96
|
+
}}
|
|
97
|
+
>
|
|
98
|
+
{!props.iconOnly ? (
|
|
99
|
+
<span className="ttdk-pagination-next-text">
|
|
100
|
+
{props.text || "Next"}
|
|
101
|
+
</span>
|
|
102
|
+
) : null}
|
|
103
|
+
{props.icon ? <>{props.icon}</> : null}
|
|
104
|
+
{!props.icon ? (
|
|
105
|
+
<svg
|
|
106
|
+
className="ttdk-pagination-icon"
|
|
107
|
+
viewBox="0 0 24 24"
|
|
108
|
+
fill="none"
|
|
109
|
+
aria-hidden="true"
|
|
110
|
+
>
|
|
111
|
+
<polyline points="9 18 15 12 9 6" />
|
|
112
|
+
</svg>
|
|
113
|
+
) : null}
|
|
114
|
+
</a>
|
|
115
|
+
) : null}
|
|
116
|
+
{!props.href || Boolean(props.disabled) ? (
|
|
117
|
+
<button
|
|
118
|
+
type="button"
|
|
119
|
+
className={`ttdk-pagination-link ttdk-pagination-next ${
|
|
120
|
+
props.className || ""
|
|
121
|
+
}`.trim()}
|
|
122
|
+
aria-label={props.ariaLabel || "Go to next page"}
|
|
123
|
+
data-size={props.size || "md"}
|
|
124
|
+
data-disabled={props.disabled ? "true" : "false"}
|
|
125
|
+
disabled={props.disabled}
|
|
126
|
+
style={{
|
|
127
|
+
...buildUiVars(props.ui),
|
|
128
|
+
...((props as any)["style"] || {}),
|
|
129
|
+
}}
|
|
130
|
+
onClick={(e) => {
|
|
131
|
+
if (!props.disabled && props.onClick) {
|
|
132
|
+
props.onClick(e);
|
|
133
|
+
}
|
|
134
|
+
}}
|
|
135
|
+
>
|
|
136
|
+
{!props.iconOnly ? (
|
|
137
|
+
<span className="ttdk-pagination-next-text">
|
|
138
|
+
{props.text || "Next"}
|
|
139
|
+
</span>
|
|
140
|
+
) : null}
|
|
141
|
+
{props.icon ? <>{props.icon}</> : null}
|
|
142
|
+
{!props.icon ? (
|
|
143
|
+
<svg
|
|
144
|
+
className="ttdk-pagination-icon"
|
|
145
|
+
viewBox="0 0 24 24"
|
|
146
|
+
fill="none"
|
|
147
|
+
aria-hidden="true"
|
|
148
|
+
>
|
|
149
|
+
<polyline points="9 18 15 12 9 6" />
|
|
150
|
+
</svg>
|
|
151
|
+
) : null}
|
|
152
|
+
</button>
|
|
153
|
+
) : null}
|
|
154
|
+
</>
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export default PaginationNext;
|