@skalfa/skalfa-app 1.0.2 → 1.0.5

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 (99) hide show
  1. package/.env.example +8 -16
  2. package/app/auth/edit/page.tsx +1 -1
  3. package/app/auth/login/page.tsx +1 -1
  4. package/app/auth/me/page.tsx +1 -1
  5. package/app/auth/register/page.tsx +1 -1
  6. package/app/auth/verify/page.tsx +1 -1
  7. package/app/dashboard/layout.tsx +2 -2
  8. package/app/dashboard/page.tsx +1 -1
  9. package/app/index.ts +1 -0
  10. package/app/layout.tsx +2 -4
  11. package/app/page.tsx +2 -2
  12. package/bun.lock +39 -24
  13. package/components/index.ts +1 -3
  14. package/package.json +8 -7
  15. package/styles/components.css +1392 -0
  16. package/styles/globals.css +40 -175
  17. package/styles/utilities.css +37 -0
  18. package/tsconfig.json +4 -2
  19. package/utils/commands/skalfa.ts +3 -0
  20. package/blueprints/starter.blueprint.json +0 -103
  21. package/components/base.components/accordion/Accordion.component.tsx +0 -82
  22. package/components/base.components/breadcrumb/Breadcrumb.component.tsx +0 -80
  23. package/components/base.components/button/Button.component.tsx +0 -91
  24. package/components/base.components/button/IconButton.component.tsx +0 -88
  25. package/components/base.components/button/button.decorate.ts +0 -82
  26. package/components/base.components/card/AlertCard.component.tsx +0 -69
  27. package/components/base.components/card/Card.component.tsx +0 -25
  28. package/components/base.components/card/DashboardCard.component.tsx +0 -44
  29. package/components/base.components/card/GalleryCard.component.tsx +0 -50
  30. package/components/base.components/card/ProductCard.component.tsx +0 -65
  31. package/components/base.components/card/ProfileCard.component.tsx +0 -71
  32. package/components/base.components/carousel/Carousel.component.tsx +0 -113
  33. package/components/base.components/chip/Chip.component.tsx +0 -39
  34. package/components/base.components/document/DocumentViewer.component.tsx +0 -164
  35. package/components/base.components/document/ExportExcel.component.tsx +0 -340
  36. package/components/base.components/document/ImportExcel.component.tsx +0 -315
  37. package/components/base.components/document/PrintTable.component.tsx +0 -204
  38. package/components/base.components/document/RenderPDF.component.tsx +0 -416
  39. package/components/base.components/index.ts +0 -85
  40. package/components/base.components/input/Checkbox.component.tsx +0 -109
  41. package/components/base.components/input/Input.component.tsx +0 -332
  42. package/components/base.components/input/InputCheckbox.component.tsx +0 -174
  43. package/components/base.components/input/InputCurrency.component.tsx +0 -163
  44. package/components/base.components/input/InputDate.component.tsx +0 -352
  45. package/components/base.components/input/InputDatetime.component.tsx +0 -260
  46. package/components/base.components/input/InputDocument.component.tsx +0 -352
  47. package/components/base.components/input/InputImage.component.tsx +0 -533
  48. package/components/base.components/input/InputMap.component.tsx +0 -318
  49. package/components/base.components/input/InputNumber.component.tsx +0 -192
  50. package/components/base.components/input/InputOtp.component.tsx +0 -169
  51. package/components/base.components/input/InputPassword.component.tsx +0 -236
  52. package/components/base.components/input/InputRadio.component.tsx +0 -175
  53. package/components/base.components/input/InputTime.component.tsx +0 -276
  54. package/components/base.components/input/InputValues.component.tsx +0 -68
  55. package/components/base.components/input/Radio.component.tsx +0 -102
  56. package/components/base.components/input/Select.component.tsx +0 -541
  57. package/components/base.components/modal/BottomSheet.component.tsx +0 -246
  58. package/components/base.components/modal/FloatingPage.component.tsx +0 -104
  59. package/components/base.components/modal/Modal.component.tsx +0 -96
  60. package/components/base.components/modal/ModalConfirm.component.tsx +0 -218
  61. package/components/base.components/modal/Toast.component.tsx +0 -126
  62. package/components/base.components/nav/Bottombar.component.tsx +0 -116
  63. package/components/base.components/nav/Footer.component.tsx +0 -144
  64. package/components/base.components/nav/Headbar.component.tsx +0 -104
  65. package/components/base.components/nav/Navbar.component.tsx +0 -100
  66. package/components/base.components/nav/Sidebar.component.tsx +0 -301
  67. package/components/base.components/nav/Tabbar.component.tsx +0 -60
  68. package/components/base.components/nav/Wizard.component.tsx +0 -73
  69. package/components/base.components/supervision/FormSupervision.component.tsx +0 -434
  70. package/components/base.components/supervision/TableSupervision.component.tsx +0 -697
  71. package/components/base.components/table/ControlBar.component.tsx +0 -497
  72. package/components/base.components/table/FilterComponent.tsx +0 -518
  73. package/components/base.components/table/Pagination.component.tsx +0 -159
  74. package/components/base.components/table/Table.component.tsx +0 -469
  75. package/components/base.components/typography/TypographyArticle.component.tsx +0 -26
  76. package/components/base.components/typography/TypographyColumn.component.tsx +0 -20
  77. package/components/base.components/typography/TypographyContent.component.tsx +0 -20
  78. package/components/base.components/typography/TypographyTips.component.tsx +0 -20
  79. package/components/base.components/wrap/Draggable.component.tsx +0 -303
  80. package/components/base.components/wrap/IDBProvider.tsx +0 -12
  81. package/components/base.components/wrap/Image.component.tsx +0 -10
  82. package/components/base.components/wrap/OutsideClick.component.tsx +0 -48
  83. package/components/base.components/wrap/ScrollContainer.component.tsx +0 -104
  84. package/components/base.components/wrap/ShortcutProvider.tsx +0 -57
  85. package/components/base.components/wrap/Swipe.component.tsx +0 -93
  86. package/components/construct.components/example.tsx +0 -1
  87. package/components/construct.components/index.ts +0 -5
  88. package/components/structure.components/example.tsx +0 -1
  89. package/components/structure.components/index.ts +0 -5
  90. package/langs/index.ts +0 -1
  91. package/langs/validation.langs.ts +0 -17
  92. package/schema/idb/app.schema.ts +0 -9
  93. package/schema/index.ts +0 -5
  94. package/utils/commands/barrels.ts +0 -28
  95. package/utils/commands/blueprint.ts +0 -421
  96. package/utils/commands/light.ts +0 -21
  97. package/utils/commands/logger.ts +0 -42
  98. package/utils/commands/stubs/table-blueprint.stub +0 -13
  99. package/utils/commands/use-pdf.ts +0 -29
@@ -1,352 +0,0 @@
1
- "use client"
2
-
3
- import { InputHTMLAttributes, ReactNode, useEffect, useMemo, useRef, useState } from "react";
4
- import moment from "moment";
5
- import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
6
- import { faChevronLeft, faChevronRight } from "@fortawesome/free-solid-svg-icons";
7
- import { cn, pcn, useInputHandler, useInputRandomId, useResponsive, useValidation, validation, ValidationRules } from "@utils";
8
- import { BottomSheetComponent, ButtonComponent, OutsideClickComponent } from "@components";
9
-
10
-
11
-
12
- type CT = "label" | "tip" | "error" | "input" | "icon";
13
-
14
- export interface InputDateProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange"> {
15
- label ?: string;
16
- tip ?: string | ReactNode;
17
- leftIcon ?: any;
18
- rightIcon ?: any;
19
-
20
- value ?: string;
21
- invalid ?: string;
22
- validations ?: ValidationRules;
23
-
24
- onChange ?: (value: string) => any;
25
- register ?: (name: string, validations?: ValidationRules) => void;
26
- unregister ?: (name: string) => void;
27
-
28
- /** Use custom class with: "label::", "tip::", "error::", "icon::". */
29
- className ?: string;
30
- }
31
-
32
-
33
-
34
- export function InputDateComponent({
35
- label,
36
- tip,
37
- leftIcon,
38
- rightIcon,
39
-
40
- value,
41
- invalid,
42
- validations,
43
-
44
- register,
45
- unregister,
46
- onChange,
47
-
48
- className = "",
49
- ...props
50
- }: InputDateProps) {
51
- const { isSm } = useResponsive();
52
-
53
- // =========================>
54
- // ## Initial
55
- // =========================>
56
- const inputHandler = useInputHandler(props.name, value, validations, register, unregister, false)
57
- const randomId = useInputRandomId()
58
-
59
-
60
- // =========================>
61
- // ## Invalid handler
62
- // =========================>
63
- const [invalidMessage] = useValidation(inputHandler.value, validations, invalid, inputHandler.idle);
64
-
65
-
66
- return (
67
- <>
68
- <div className="relative flex flex-col gap-y-0.5">
69
- <label
70
- htmlFor={randomId}
71
- className={cn(
72
- "input-label",
73
- pcn<CT>(className, "label"),
74
- props.disabled && "opacity-50",
75
- props.disabled && pcn<CT>(className, "label", "disabled"),
76
- inputHandler.focus && "text-primary",
77
- inputHandler.focus && pcn<CT>(className, "label", "focus"),
78
- !!invalidMessage && "text-danger",
79
- !!invalidMessage && pcn<CT>(className, "label", "focus")
80
- )}
81
- >
82
- {label}
83
- {validations && validation.hasRules(validations, "required") && <span className="text-danger ml-1">*</span>}
84
- </label>
85
-
86
- {tip && (
87
- <small
88
- className={cn(
89
- "input-tip",
90
- pcn<CT>(className, "tip"),
91
- props.disabled && "opacity-60",
92
- props.disabled && pcn<CT>(className, "tip", "disabled")
93
- )}
94
- >{tip}</small>
95
- )}
96
-
97
- <OutsideClickComponent onOutsideClick={!isSm ? () => inputHandler.setFocus(false) : undefined}>
98
- <div className="relative">
99
- <input
100
- {...props}
101
- id={randomId}
102
- className={cn(
103
- "input",
104
- leftIcon && "pl-12",
105
- rightIcon && "pr-12",
106
- pcn<CT>(className, "input"),
107
- !!invalidMessage && "input-error",
108
- !!invalidMessage && pcn<CT>(className, "input", "error")
109
- )}
110
- value={inputHandler.value}
111
- onChange={(e) => {
112
- inputHandler.setValue(e.target.value);
113
- inputHandler.setValue(false);
114
- onChange?.(e.target.value);
115
- }}
116
- onFocus={(e) => {
117
- props.onFocus?.(e);
118
- inputHandler.setFocus(true);
119
- }}
120
- onBlur={(e) => {
121
- props.onBlur?.(e);
122
- }}
123
- autoComplete="off"
124
- inputMode={isSm ? "none" : undefined}
125
- />
126
-
127
- {leftIcon && (
128
- <FontAwesomeIcon
129
- className={cn(
130
- "left-4 input-icon ",
131
- pcn<CT>(className, "icon"),
132
- props.disabled && "opacity-60",
133
- props.disabled && pcn<CT>(className, "icon", "disabled"),
134
- inputHandler.focus && "text-primary",
135
- inputHandler.focus && pcn<CT>(className, "icon", "focus")
136
- )}
137
- icon={leftIcon}
138
- />
139
- )}
140
-
141
- {rightIcon && (
142
- <FontAwesomeIcon
143
- className={cn(
144
- "right-4 input-icon",
145
- pcn<CT>(className, "icon"),
146
- props.disabled && "opacity-60",
147
- props.disabled && pcn<CT>(className, "icon", "disabled"),
148
- inputHandler.focus && "text-primary",
149
- inputHandler.focus && pcn<CT>(className, "icon", "focus")
150
- )}
151
- icon={rightIcon}
152
- />
153
- )}
154
-
155
- {!isSm && inputHandler.focus && (
156
- <div className="w-max h-72 bg-background border p-2 rounded-[6px] absolute top-full right-0 mt-1 z-50">
157
- <InputDatePickerComponent
158
- onChange={(e) => {
159
- inputHandler.setValue(e);
160
- onChange?.(e);
161
- }}
162
- />
163
- </div>
164
- )}
165
- </div>
166
- </OutsideClickComponent>
167
-
168
- {invalidMessage && (
169
- <small className={cn("input-error-message", pcn<CT>(className, "error"))}>{invalidMessage}</small>
170
- )}
171
- </div>
172
-
173
- {isSm && (
174
- <BottomSheetComponent
175
- show={inputHandler.focus}
176
- onClose={() => inputHandler.setFocus(false)}
177
- size={380}
178
- footer={
179
- <div className="p-4">
180
- <ButtonComponent
181
- label="Selesai"
182
- variant="outline"
183
- onClick={() => inputHandler.setFocus(false)}
184
- block
185
- />
186
- </div>
187
- }
188
- >
189
- <div className="p-4">
190
- <InputDatePickerComponent
191
- onChange={(e) => {
192
- inputHandler.setValue(e);
193
- onChange?.(e);
194
- }}
195
- />
196
- </div>
197
- </BottomSheetComponent>
198
- )}
199
- </>
200
- );
201
- }
202
-
203
-
204
-
205
- export interface InputDatePickerProps {
206
- onChange ?: (date: string) => void;
207
- minDate ?: string;
208
- maxDate ?: string;
209
- rightElement ?: ReactNode;
210
- };
211
-
212
-
213
-
214
- export const InputDatePickerComponent: React.FC<InputDatePickerProps> = ({
215
- onChange,
216
- minDate,
217
- maxDate,
218
- rightElement,
219
- }) => {
220
- const activeYearRef = useRef<HTMLDivElement | null>(null);
221
- const containerYearRef = useRef<HTMLDivElement | null>(null);
222
-
223
- const [currentDate, setCurrentDate] = useState(moment());
224
- const [selectedDate, setSelectedDate] = useState(moment());
225
-
226
- const startDate = moment(currentDate).startOf("month").startOf("week");
227
- const endDate = moment(currentDate).endOf("month").endOf("week");
228
-
229
- const handlePrevMonth = () => setCurrentDate(moment(currentDate).subtract(1, "month"));
230
- const handleNextMonth = () => setCurrentDate(moment(currentDate).add(1, "month"));
231
-
232
- const handleDateClick = (date: moment.Moment) => {
233
- if ((minDate && date.isBefore(moment(minDate))) || (maxDate && date.isAfter(moment(maxDate)))) { return; }
234
-
235
- setSelectedDate(date);
236
- onChange?.(date.format("YYYY-MM-DD"));
237
- };
238
-
239
- const renderDays = () => {
240
- const days = [];
241
- const startDay = moment(startDate);
242
-
243
- for (let i = 0; i < 7; i++) {
244
- days.push(
245
- <div key={i} className="text-center font-bold">
246
- {startDay.add(i, "days").format("dd")}
247
- </div>
248
- );
249
- }
250
-
251
- return days;
252
- };
253
-
254
- const renderCells = () => {
255
- const rows = [];
256
- let days = [];
257
- const day = moment(startDate);
258
-
259
- while (day.isBefore(endDate) || day.isSame(endDate, "day")) {
260
- for (let i = 0; i < 7; i++) {
261
- const cloneDay = moment(day);
262
-
263
- days.push(
264
- <div
265
- key={day.toString()}
266
- className={`w-8 aspect-square flex items-center justify-center text-center rounded-lg transition-all
267
- ${day.isSame(currentDate, "month") ? "text-foreground" : "text-light-foreground"}
268
- ${day.isSame(selectedDate, "day") ? "bg-primary text-background" : "hover:bg-light-primary"}
269
- ${day.isSame(moment(), "day") ? "border !border-primary" : "hover:bg-light-primary"}
270
- ${(minDate && day.isBefore(moment(minDate))) || (maxDate && day.isAfter(moment(maxDate))) ? "opacity-10 cursor-not-allowed" : "cursor-pointer"}`}
271
- onClick={() => handleDateClick(cloneDay)}
272
- >{day.format("D")}</div>
273
- );
274
-
275
- day.add(1, "day");
276
- }
277
-
278
- rows.push(<div key={day.toString()} className="grid grid-cols-7 gap-1">{days}</div>);
279
-
280
- days = [];
281
- }
282
-
283
- return rows;
284
- };
285
-
286
- const years = useMemo(() => {
287
- const dumpYears = [];
288
-
289
- for (let i = 1945; i <= moment().year(); i++) {
290
- dumpYears.push(i);
291
- }
292
-
293
- return dumpYears;
294
- }, []);
295
-
296
- useEffect(() => {
297
- if (activeYearRef.current && containerYearRef.current) {
298
- containerYearRef.current.scrollTo({
299
- top: activeYearRef.current.offsetTop - containerYearRef.current.offsetTop,
300
- });
301
- }
302
- }, []);
303
-
304
- return (
305
- <div className="w-full flex gap-2 max-h-[260]">
306
- <div
307
- className="w-1/5 overflow-y-auto input-scroll pr-1"
308
- ref={containerYearRef}
309
- >
310
- <div className="flex flex-col">
311
- {years?.map((item) => {
312
- const isActive = currentDate?.year() === item;
313
-
314
- return (
315
- <>
316
- <div
317
- key={item}
318
- ref={isActive ? activeYearRef : null}
319
- className={`py-1 px-2 font-semibold rounded-[6px] cursor-pointer ${isActive && "bg-light-primary"}`}
320
- onClick={() => setCurrentDate(moment().set("year", item))}
321
- >
322
- {item}
323
- </div>
324
- </>
325
- );
326
- })}
327
- </div>
328
- </div>
329
- <div className="w-4/5">
330
- <div className="flex justify-between items-center mb-2">
331
- <button
332
- onClick={handlePrevMonth}
333
- className="w-8 text-sm aspect-square rounded-full cursor-pointer"
334
- >
335
- <FontAwesomeIcon icon={faChevronLeft} />
336
- </button>
337
- <h2 className="font-semibold">{currentDate.format("MMMM")}</h2>
338
- <button
339
- onClick={handleNextMonth}
340
- className="w-8 text-sm aspect-square rounded-full cursor-pointer"
341
- >
342
- <FontAwesomeIcon icon={faChevronRight} />
343
- </button>
344
- </div>
345
- <div className="grid grid-cols-7 gap-1 mb-2">{renderDays()}</div>
346
- <div>{renderCells()}</div>
347
- </div>
348
-
349
- {rightElement && <div>{rightElement}</div>}
350
- </div>
351
- );
352
- };
@@ -1,260 +0,0 @@
1
- "use client"
2
-
3
- import { InputHTMLAttributes, ReactNode, useEffect, useState } from "react";
4
- import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
5
- import { cn, pcn, useInputHandler, useInputRandomId, useResponsive, useValidation, validation, ValidationRules } from "@utils";
6
- import { OutsideClickComponent, InputDatePickerComponent, InputTimePickerComponent, BottomSheetComponent, ButtonComponent, TabbarComponent } from "@components";
7
-
8
-
9
-
10
- type CT = "label" | "tip" | "error" | "input" | "icon";
11
-
12
- export interface InputDateTimeProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange"> {
13
- label ?: string;
14
- tip ?: string | ReactNode;
15
- leftIcon ?: any;
16
- rightIcon ?: any;
17
-
18
- value ?: string;
19
- invalid ?: string;
20
- validations ?: ValidationRules;
21
-
22
- onChange ?: (value: string) => any;
23
- register ?: (name: string, validations?: ValidationRules) => void;
24
- unregister ?: (name: string) => void;
25
-
26
- /** Use custom class with: "label::", "tip::", "error::", "icon::", "suggest::", "suggest-item::". */
27
- className ?: string;
28
- }
29
-
30
-
31
-
32
- export function InputDatetimeComponent({
33
- label,
34
- tip,
35
- leftIcon,
36
- rightIcon,
37
-
38
- value,
39
- invalid,
40
- validations,
41
-
42
- register,
43
- unregister,
44
- onChange,
45
-
46
- className = "",
47
- ...props
48
- }: InputDateTimeProps) {
49
- const { isSm } = useResponsive();
50
-
51
- const [pickerType, setPickerType] = useState<"date" | "time">("date");
52
- const [dateValue, setDateValue] = useState("");
53
- const [timeValue, setTimeValue] = useState("");
54
-
55
-
56
- // =========================>
57
- // ## Initial
58
- // =========================>
59
- const inputHandler = useInputHandler(props.name, value, validations, register, unregister, false)
60
- const randomId = useInputRandomId()
61
-
62
-
63
- // =========================>
64
- // ## Invalid handler
65
- // =========================>
66
- const [invalidMessage] = useValidation(inputHandler.value, validations, invalid, inputHandler.idle);
67
-
68
-
69
- // =========================>
70
- // ## change value handler
71
- // =========================>
72
- useEffect(() => {
73
- inputHandler.setValue(value || "");
74
- value && inputHandler.setValue(false);
75
-
76
- if (value) {
77
- const [d, t] = value.split(" ");
78
- setDateValue(d || "");
79
- setTimeValue(t || "");
80
- }
81
- }, [value]);
82
-
83
-
84
- const handleChange = (date: string, time: string) => {
85
- const newVal = `${date} ${time}`;
86
- inputHandler.setValue(newVal.trim());
87
- onChange?.(newVal.trim());
88
- };
89
-
90
-
91
- return (
92
- <>
93
- <div className="relative flex flex-col gap-y-0.5">
94
- <label
95
- htmlFor={randomId}
96
- className={cn(
97
- "input-label",
98
- pcn<CT>(className, "label"),
99
- props.disabled && "opacity-50",
100
- inputHandler.focus && "text-primary",
101
- !!invalidMessage && "text-danger"
102
- )}
103
- >
104
- {label}
105
- {validations && validation.hasRules(validations, "required") && <span className="text-danger ml-1">*</span>}
106
- </label>
107
-
108
- {tip && (
109
- <small
110
- className={cn(
111
- "input-tip",
112
- pcn<CT>(className, "tip"),
113
- props.disabled && "opacity-60"
114
- )}
115
- >{tip}</small>
116
- )}
117
-
118
- <OutsideClickComponent onOutsideClick={!isSm ? () => inputHandler.setFocus(false) : undefined}>
119
- <div className="relative">
120
- <input
121
- {...props}
122
- id={randomId}
123
- readOnly
124
- className={cn(
125
- "input",
126
- leftIcon && "pl-12",
127
- rightIcon && "pr-12",
128
- pcn<CT>(className, "input"),
129
- !!invalidMessage && "input-error"
130
- )}
131
- value={inputHandler.value}
132
- onFocus={(e) => {
133
- props.onFocus?.(e);
134
- inputHandler.setFocus(true);
135
- }}
136
- autoComplete="off"
137
- inputMode={isSm ? "none" : undefined}
138
- />
139
-
140
- {leftIcon && (
141
- <FontAwesomeIcon
142
- className={cn(
143
- "left-4 input-icon",
144
- pcn<CT>(className, "icon"),
145
- props.disabled && "opacity-60",
146
- inputHandler.focus && "text-primary"
147
- )}
148
- icon={leftIcon}
149
- />
150
- )}
151
-
152
- {rightIcon && (
153
- <FontAwesomeIcon
154
- className={cn(
155
- "right-4 input-icon",
156
- pcn<CT>(className, "icon"),
157
- props.disabled && "opacity-60",
158
- inputHandler.focus && "text-primary"
159
- )}
160
- icon={rightIcon}
161
- />
162
- )}
163
-
164
- {!isSm && inputHandler.focus && (
165
- <>
166
- <div className="absolute z-50 top-full right-0 mt-1 w-max bg-background border rounded-[6px] p-2 shadow min-w-[350]">
167
- <TabbarComponent
168
- items={[
169
- {
170
- label: "Tanggal",
171
- value: 'date'
172
- },
173
- {
174
- label: "Jam",
175
- value: 'time'
176
- },
177
- ]}
178
- active={pickerType}
179
- onChange={(e) => setPickerType(e as "time" | "date")}
180
- className="mb-4"
181
- />
182
- {pickerType === "date" ? (
183
- <InputDatePickerComponent
184
- onChange={(e) => {
185
- setDateValue(e);
186
- handleChange(e, timeValue);
187
- }}
188
- />
189
- ) : (
190
- <InputTimePickerComponent
191
- onChange={(e) => {
192
- setTimeValue(e);
193
- handleChange(dateValue, e);
194
- }}
195
- />
196
- )}
197
- </div>
198
- </>
199
- )}
200
- </div>
201
- </OutsideClickComponent>
202
-
203
- {invalidMessage && (
204
- <small className={cn("input-error-message", pcn<CT>(className, "error"))}>{invalidMessage}</small>
205
- )}
206
- </div>
207
-
208
- {isSm && (
209
- <BottomSheetComponent
210
- show={inputHandler.focus}
211
- onClose={() => inputHandler.setFocus(false)}
212
- size={430}
213
- footer={
214
- <div className="p-4">
215
- <ButtonComponent
216
- label="Selesai"
217
- variant="outline"
218
- onClick={() => inputHandler.setFocus(false)}
219
- block
220
- />
221
- </div>
222
- }
223
- >
224
- <div className="p-4">
225
- <TabbarComponent
226
- items={[
227
- {
228
- label: "Tanggal",
229
- value: 'date'
230
- },
231
- {
232
- label: "Jam",
233
- value: 'time'
234
- },
235
- ]}
236
- active={pickerType}
237
- onChange={(e) => setPickerType(e as "time" | "date")}
238
- className="mb-4"
239
- />
240
- {pickerType === "date" ? (
241
- <InputDatePickerComponent
242
- onChange={(e) => {
243
- setDateValue(e);
244
- handleChange(e, timeValue);
245
- }}
246
- />
247
- ) : (
248
- <InputTimePickerComponent
249
- onChange={(e) => {
250
- setTimeValue(e);
251
- handleChange(dateValue, e);
252
- }}
253
- />
254
- )}
255
- </div>
256
- </BottomSheetComponent>
257
- )}
258
- </>
259
- );
260
- }