@safestrong/ppa-component-library 1.9.4 → 1.10.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/dist/index.mjs ADDED
@@ -0,0 +1,771 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+
33
+ // src/components/Button.tsx
34
+ import React from "react";
35
+ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
36
+ import { faCircleNotch } from "@fortawesome/free-solid-svg-icons";
37
+ function Button(_a) {
38
+ var _b = _a, {
39
+ label,
40
+ icon,
41
+ isLoading,
42
+ btnType,
43
+ className
44
+ } = _b, rest = __objRest(_b, [
45
+ "label",
46
+ "icon",
47
+ "isLoading",
48
+ "btnType",
49
+ "className"
50
+ ]);
51
+ const buttonIcon = isLoading ? faCircleNotch : icon;
52
+ const loadingLabel = label && isLoading ? "Memproses ..." : "";
53
+ return /* @__PURE__ */ React.createElement(
54
+ "button",
55
+ __spreadProps(__spreadValues({}, rest), {
56
+ disabled: rest.disabled || isLoading,
57
+ className: `${!icon && "py-[0.84rem]"} ${className} ${btnType == "secondary" && "btn__secondary"} btn__primary ${label ? "" : "!p-[0.87rem]"}`
58
+ }),
59
+ buttonIcon && icon && /* @__PURE__ */ React.createElement(
60
+ FontAwesomeIcon,
61
+ {
62
+ icon: buttonIcon,
63
+ className: `text-[1.2rem] ${label && "mr-[0.3rem]"} ${isLoading && "animate-spin"}`
64
+ }
65
+ ),
66
+ isLoading ? loadingLabel : label
67
+ );
68
+ }
69
+ var IconButton = (props) => {
70
+ const btnIcon = props.isloading ? faCircleNotch : props.icon;
71
+ return /* @__PURE__ */ React.createElement(
72
+ "button",
73
+ __spreadProps(__spreadValues({}, props), {
74
+ disabled: props.disabled || props.isloading,
75
+ className: `${props.className} ${props.label ? "max-w-[content] px-[0.8rem]" : ""} icon__button`
76
+ }),
77
+ btnIcon && /* @__PURE__ */ React.createElement(
78
+ FontAwesomeIcon,
79
+ {
80
+ icon: btnIcon,
81
+ className: props.isloading ? "animate-spin" : ""
82
+ }
83
+ ),
84
+ props.label && /* @__PURE__ */ React.createElement("span", { className: "inline-block ml-[0.8rem] text-[1rem]" }, props.label)
85
+ );
86
+ };
87
+ var IconButtonGroup = ({ list: list2 }) => {
88
+ function getIcon2(props) {
89
+ return props.isloading ? faCircleNotch : props.icon;
90
+ }
91
+ return /* @__PURE__ */ React.createElement("div", { className: "icon__button_group" }, list2.map((props, idx) => /* @__PURE__ */ React.createElement(
92
+ "button",
93
+ __spreadProps(__spreadValues({
94
+ key: idx + 1
95
+ }, props), {
96
+ disabled: props.disabled || props.isloading,
97
+ className: getBtnClass(idx)
98
+ }),
99
+ getIcon2(props) && /* @__PURE__ */ React.createElement(
100
+ FontAwesomeIcon,
101
+ {
102
+ icon: getIcon2(props),
103
+ className: props.isloading ? "animate-spin" : ""
104
+ }
105
+ ),
106
+ props.isnotif && /* @__PURE__ */ React.createElement("span", { className: "btn__notif_badge" })
107
+ )));
108
+ };
109
+ var SSOButton = ({ href, btnclass }) => {
110
+ return /* @__PURE__ */ React.createElement("a", { href, className: `sso-button ${btnclass}` }, /* @__PURE__ */ React.createElement(
111
+ "img",
112
+ {
113
+ alt: "logo",
114
+ className: "sso-icon",
115
+ src: "https://storage.ppa-ho.net/public/ppa-component-library/lock.png"
116
+ }
117
+ ), " ", "Login dengan SSO");
118
+ };
119
+ Button.IconButton = IconButton;
120
+ Button.IconButtonGroup = IconButtonGroup;
121
+ Button.SSOButton = SSOButton;
122
+ function getBtnClass(idx) {
123
+ return `icon__button !h-[2.95rem] !rounded-[0] border-[0] relative ${idx == 0 ? "" : "border-l border-l-[var(--color-border)]"}`;
124
+ }
125
+
126
+ // src/components/TextInput.tsx
127
+ import React2 from "react";
128
+ import { FontAwesomeIcon as FontAwesomeIcon2 } from "@fortawesome/react-fontawesome";
129
+ var input__icon = "w-[2rem] p-[0.9rem] px-[0.7rem] text-[1.2rem] bg-[var(--color-background-icon)] text-[var(--color-icon-input)] mr-2 group-focus-within:text-[var(--color-primary)] ";
130
+ function TextInput(_a) {
131
+ var _b = _a, {
132
+ label,
133
+ labelFor,
134
+ icon,
135
+ outerclass,
136
+ isdarkmode,
137
+ inputclass
138
+ } = _b, attr = __objRest(_b, [
139
+ "label",
140
+ "labelFor",
141
+ "icon",
142
+ "outerclass",
143
+ "isdarkmode",
144
+ "inputclass"
145
+ ]);
146
+ function getThemedClass(prefix) {
147
+ return `var(--color${isdarkmode ? "-dark" : ""}${prefix})`;
148
+ }
149
+ return /* @__PURE__ */ React2.createElement("div", { className: `group ${outerclass} w-full` }, label && /* @__PURE__ */ React2.createElement(
150
+ "label",
151
+ {
152
+ htmlFor: labelFor,
153
+ className: "text-input__label",
154
+ style: {
155
+ color: getThemedClass("-text-secondary")
156
+ }
157
+ },
158
+ label
159
+ ), /* @__PURE__ */ React2.createElement(
160
+ "div",
161
+ {
162
+ className: `text-input__wrapper overflow-hidden ${attr.className}`,
163
+ style: {
164
+ borderColor: getThemedClass("-border"),
165
+ background: getThemedClass("-bg-surface")
166
+ }
167
+ },
168
+ icon && /* @__PURE__ */ React2.createElement(FontAwesomeIcon2, { icon, className: input__icon }),
169
+ /* @__PURE__ */ React2.createElement(
170
+ "input",
171
+ __spreadProps(__spreadValues({}, attr), {
172
+ className: `text-input w-full ${icon && "!pl-[0.3rem]"} ${inputclass}`,
173
+ style: {
174
+ color: getThemedClass("-text-primary")
175
+ }
176
+ })
177
+ )
178
+ ));
179
+ }
180
+
181
+ // src/components/Slider.tsx
182
+ import React3 from "react";
183
+ import { faCheck } from "@fortawesome/free-solid-svg-icons";
184
+ import { FontAwesomeIcon as FontAwesomeIcon3 } from "@fortawesome/react-fontawesome";
185
+ function Slider(attr) {
186
+ return /* @__PURE__ */ React3.createElement("div", { className: "flex items-center h-[3rem]" }, /* @__PURE__ */ React3.createElement("div", { className: "slider__wrapper group relative" }, /* @__PURE__ */ React3.createElement("input", __spreadValues({ id: "slider", type: "checkbox", className: input }, attr)), /* @__PURE__ */ React3.createElement("label", { htmlFor: attr.id || "slider", className: "slider" }, /* @__PURE__ */ React3.createElement(
187
+ FontAwesomeIcon3,
188
+ {
189
+ icon: faCheck,
190
+ className: "text-[0.7rem] translate-x-[0.2px]"
191
+ }
192
+ ))));
193
+ }
194
+ var input = "peer ... w-[38px] h-[20px] opacity-[0] cursor-pointer absolute";
195
+
196
+ // src/components/SingleSelect.tsx
197
+ import React4, { useEffect, useMemo, useState } from "react";
198
+ import { FontAwesomeIcon as FontAwesomeIcon4 } from "@fortawesome/react-fontawesome";
199
+ import { faCheck as faCheck2, faChevronDown } from "@fortawesome/free-solid-svg-icons";
200
+ function SingleSelect(attr) {
201
+ var _b;
202
+ const _a = attr, { options = [], stringOptions = [], isdarkmode } = _a, attrInput = __objRest(_a, ["options", "stringOptions", "isdarkmode"]);
203
+ const inputValue = attrInput.value;
204
+ const [keyword, setKeyword] = useState("");
205
+ const [selected, setSelected] = useState({
206
+ label: "",
207
+ value: ""
208
+ });
209
+ function selectItem({ label, value }, e) {
210
+ const triggerManual = attrInput.onChange;
211
+ if (triggerManual) {
212
+ triggerManual == null ? void 0 : triggerManual({
213
+ target: { value, name: attrInput.name }
214
+ });
215
+ }
216
+ setSelected({ label, value });
217
+ if (attr.stateaction) {
218
+ if ((options == null ? void 0 : options.length) > 0) attr.stateaction({ label, value });
219
+ if ((stringOptions == null ? void 0 : stringOptions.length) > 0) attr.stateaction(value);
220
+ }
221
+ setKeyword("");
222
+ e.currentTarget.blur();
223
+ }
224
+ function autoUpdateValue(updatedValue) {
225
+ if (updatedValue) {
226
+ const filtered = availableOptions.find(
227
+ ({ value }) => value == updatedValue
228
+ );
229
+ if (filtered) setSelected(filtered);
230
+ }
231
+ }
232
+ const availableOptions = useMemo(() => {
233
+ let defaultOptions = options && options.length > 0;
234
+ if (!defaultOptions)
235
+ return stringOptions.map((opt) => ({ label: opt, value: opt }));
236
+ return options;
237
+ }, [options, stringOptions]);
238
+ const filteredOptions = useMemo(() => {
239
+ return availableOptions.filter(
240
+ ({ label, value }) => (label + "").toLowerCase().includes(keyword.toLowerCase()) || (value + "").toLowerCase().includes(keyword.toLowerCase())
241
+ );
242
+ }, [keyword, availableOptions]);
243
+ useEffect(() => {
244
+ inputValue && autoUpdateValue(inputValue);
245
+ }, [inputValue]);
246
+ function getThemedClass(prefix) {
247
+ return `var(--color${isdarkmode ? "-dark" : ""}${prefix})`;
248
+ }
249
+ const placeholderClass = `${input2} select-item-placeholder-${isdarkmode ? "dark" : ""}`;
250
+ const optionHoverClass = `select-item-hover${isdarkmode ? "-dark" : ""}`;
251
+ return /* @__PURE__ */ React4.createElement("div", { className: `w-full group ${attr.outerclass}` }, attrInput.label && /* @__PURE__ */ React4.createElement(
252
+ "label",
253
+ {
254
+ className: "text-input__label",
255
+ htmlFor: attrInput.labelHtml,
256
+ style: { color: getThemedClass("-text-secondary") }
257
+ },
258
+ attrInput.label
259
+ ), /* @__PURE__ */ React4.createElement(
260
+ "div",
261
+ {
262
+ className: `${attrInput.className} text-input__wrapper relative`,
263
+ style: {
264
+ borderColor: getThemedClass("-border"),
265
+ background: getThemedClass("-bg-surface")
266
+ }
267
+ },
268
+ /* @__PURE__ */ React4.createElement(
269
+ "input",
270
+ __spreadProps(__spreadValues(__spreadValues({
271
+ type: "hidden"
272
+ }, attrInput), attrInput.onChange ? { onChange: attrInput.onChange } : {}), {
273
+ value: (_b = attrInput.value) != null ? _b : selected.value
274
+ })
275
+ ),
276
+ /* @__PURE__ */ React4.createElement(
277
+ "input",
278
+ {
279
+ type: "search",
280
+ value: keyword,
281
+ autoComplete: "off",
282
+ onChange: (e) => setKeyword(e.target.value),
283
+ className: `${attrInput.name}-keyword ${placeholderClass}`,
284
+ placeholder: selected.value ? selected.label : attrInput.placeholder,
285
+ style: {
286
+ color: selected.value ? getThemedClass("-text-primary") : void 0
287
+ }
288
+ }
289
+ ),
290
+ /* @__PURE__ */ React4.createElement(
291
+ "div",
292
+ {
293
+ className: "select-item__wrapper",
294
+ style: {
295
+ borderColor: getThemedClass("-border"),
296
+ background: getThemedClass("-bg-surface")
297
+ }
298
+ },
299
+ filteredOptions.length == 0 && keyword != "" && /* @__PURE__ */ React4.createElement(
300
+ "button",
301
+ {
302
+ disabled: true,
303
+ className: "select-item",
304
+ style: { color: "var(--color-danger)" }
305
+ },
306
+ "Tidak ada Item"
307
+ ),
308
+ filteredOptions.map(({ label, value }) => /* @__PURE__ */ React4.createElement(
309
+ "button",
310
+ {
311
+ key: value,
312
+ type: "button",
313
+ className: `select-item ${optionHoverClass}`,
314
+ onClick: (e) => selectItem({ label, value }, e),
315
+ style: { color: getThemedClass("-text-secondary") }
316
+ },
317
+ label,
318
+ selected.value == value && /* @__PURE__ */ React4.createElement(
319
+ FontAwesomeIcon4,
320
+ {
321
+ icon: faCheck2,
322
+ style: { color: "var(--color-info)" }
323
+ }
324
+ )
325
+ ))
326
+ ),
327
+ /* @__PURE__ */ React4.createElement(FontAwesomeIcon4, { icon: faChevronDown, style: { color: getThemedClass("-icon-input"), paddingRight: "0.7rem" } })
328
+ ));
329
+ }
330
+ SingleSelect.autoFill = autoFillInput;
331
+ function autoFillInput(value, elName, list2) {
332
+ const inp = document.querySelector(`[name="${elName}"]`);
333
+ inp.value = `${value}`;
334
+ const filtered = list2.find((item) => item.value == value);
335
+ const el = document.querySelector(`.${elName}-keyword`);
336
+ el == null ? void 0 : el.setAttribute("placeholder", `${filtered == null ? void 0 : filtered.label}`);
337
+ }
338
+ var input2 = "text-input peer ... w-full";
339
+
340
+ // src/components/Tooltip.tsx
341
+ import React5 from "react";
342
+ function Tooltip({
343
+ children,
344
+ text,
345
+ position = "top"
346
+ }) {
347
+ function getAccent() {
348
+ const mapping = {
349
+ top,
350
+ bottom,
351
+ left,
352
+ right
353
+ };
354
+ return mapping[position];
355
+ }
356
+ return /* @__PURE__ */ React5.createElement("div", { className: "relative" }, /* @__PURE__ */ React5.createElement("div", { className: "peer" }, children), /* @__PURE__ */ React5.createElement("span", { className: `tooltip-text ${getAccent()}` }, text));
357
+ }
358
+ var top = "bottom-full translate-y-[-0.3rem] right-0 after:bottom-0 after:translate-y-[0.25rem] ";
359
+ var bottom = "right-0 top-full translate-y-[0.3rem] after:top-[-0.4rem] after:translate-y-[0.2rem] ";
360
+ var right = "left-full w-[max-content] translate-x-[0.6rem] after:left-[-0.2rem] top-[-0.2rem] after:top-[0.6rem]";
361
+ var left = "right-full w-[max-content] translate-x-[-0.6rem] top-[-0.2rem] after:right-[-0.2rem] after:top-[0.6rem]";
362
+
363
+ // src/components/NavTabClient.tsx
364
+ import React6 from "react";
365
+ function NavTabClient({
366
+ items,
367
+ state
368
+ }) {
369
+ return /* @__PURE__ */ React6.createElement("nav", { className: "navtab__wrapper" }, items.map(({ label, value }) => /* @__PURE__ */ React6.createElement(
370
+ "button",
371
+ {
372
+ key: value,
373
+ className: `navtab__item ${state.active == value ? "navtab__item__active" : "hover:bg-[var(--color-border)]/50"}`,
374
+ onClick: () => state.setActive(value)
375
+ },
376
+ label
377
+ )));
378
+ }
379
+
380
+ // src/components/Card.tsx
381
+ import React7 from "react";
382
+ function Card({ children, className }) {
383
+ return /* @__PURE__ */ React7.createElement("div", { className: `card ${className}` }, children);
384
+ }
385
+ var Footer = ({
386
+ className,
387
+ children
388
+ }) => {
389
+ return /* @__PURE__ */ React7.createElement("div", { className: `${className} border-t border-t-[var(--color-border)]` }, children);
390
+ };
391
+ Card.Footer = Footer;
392
+
393
+ // src/components/Toast.tsx
394
+ import React8 from "react";
395
+ import { FontAwesomeIcon as FontAwesomeIcon5 } from "@fortawesome/react-fontawesome";
396
+ import {
397
+ faCheckCircle,
398
+ faInfoCircle,
399
+ faQuestionCircle,
400
+ faXmarkCircle
401
+ } from "@fortawesome/free-solid-svg-icons";
402
+ function Toast({
403
+ title,
404
+ description,
405
+ type = "info",
406
+ className
407
+ }) {
408
+ return /* @__PURE__ */ React8.createElement("div", { className: `toast__wrapper group ${className}` }, /* @__PURE__ */ React8.createElement("div", { className: "toast__body" }, /* @__PURE__ */ React8.createElement("div", { style: { background: getColor(type) }, className: bullet }), /* @__PURE__ */ React8.createElement("div", null, /* @__PURE__ */ React8.createElement("p", { className: "toast__title" }, title), /* @__PURE__ */ React8.createElement("p", { className: "toast__description" }, description)), /* @__PURE__ */ React8.createElement("div", { className: `toast__icon toast__icon__${type}` })), /* @__PURE__ */ React8.createElement(
409
+ "p",
410
+ {
411
+ className: "toast__bar toast-bar-animate",
412
+ style: { background: getColor(type) }
413
+ }
414
+ ));
415
+ }
416
+ var Inline = ({
417
+ className,
418
+ text,
419
+ type
420
+ }) => {
421
+ return /* @__PURE__ */ React8.createElement(
422
+ "div",
423
+ {
424
+ className: `toast__inline ${className}`,
425
+ style: { background: `var(--color-${type}-soft)`, opacity: 0.9 }
426
+ },
427
+ /* @__PURE__ */ React8.createElement(
428
+ FontAwesomeIcon5,
429
+ {
430
+ icon: getIcon(type),
431
+ className: "text-[1.3rem]",
432
+ style: { color: getColor(type) }
433
+ }
434
+ ),
435
+ /* @__PURE__ */ React8.createElement("p", null, text)
436
+ );
437
+ };
438
+ Toast.Inline = Inline;
439
+ function getColor(type) {
440
+ return `var(--color-${type})`;
441
+ }
442
+ function getIcon(type) {
443
+ const mapping = {
444
+ warning: faQuestionCircle,
445
+ info: faInfoCircle,
446
+ danger: faXmarkCircle,
447
+ success: faCheckCircle
448
+ };
449
+ return mapping[type];
450
+ }
451
+ var bullet = "w-[2rem] h-[2rem] absolute top-[-0.7rem] left-[-0.7rem] rounded-[50%]";
452
+
453
+ // src/components/Expandable.tsx
454
+ import React9 from "react";
455
+ import { faCaretRight } from "@fortawesome/free-solid-svg-icons";
456
+ import { FontAwesomeIcon as FontAwesomeIcon6 } from "@fortawesome/react-fontawesome";
457
+ function Expandable({
458
+ children,
459
+ title,
460
+ className,
461
+ isOpen
462
+ }) {
463
+ const name = title.replace(" ", "");
464
+ return /* @__PURE__ */ React9.createElement("div", { className: `expandable ${className}` }, /* @__PURE__ */ React9.createElement(
465
+ "input",
466
+ {
467
+ id: name,
468
+ type: "checkbox",
469
+ defaultChecked: isOpen,
470
+ className: "opacity-[0] peer absolute top-0 ex-title"
471
+ }
472
+ ), /* @__PURE__ */ React9.createElement(FontAwesomeIcon6, { icon: faCaretRight, className: "expandable__icon" }), /* @__PURE__ */ React9.createElement("label", { htmlFor: name, className: "expandable__title" }, title), /* @__PURE__ */ React9.createElement("div", { className: "expandable__body" }, /* @__PURE__ */ React9.createElement("div", { className: "p-[0.75rem] px-[1rem]" }, children)));
473
+ }
474
+
475
+ // src/components/MultiSelect.tsx
476
+ import React10, { useCallback, useMemo as useMemo2, useState as useState2 } from "react";
477
+ import { FontAwesomeIcon as FontAwesomeIcon7 } from "@fortawesome/react-fontawesome";
478
+ import { faCheck as faCheck3, faListCheck } from "@fortawesome/free-solid-svg-icons";
479
+ function MultiSelect(_a) {
480
+ var _b = _a, {
481
+ state,
482
+ label,
483
+ labelHtml
484
+ } = _b, attr = __objRest(_b, [
485
+ "state",
486
+ "label",
487
+ "labelHtml"
488
+ ]);
489
+ const { options = [], stringOptions = [], isdarkmode } = attr;
490
+ const [keyword, setKeyword] = useState2("");
491
+ const optionHoverClass = `select-item-hover${isdarkmode ? "-dark" : ""}`;
492
+ const placeholderClass = `${input3} select-item-placeholder-${isdarkmode ? "dark" : ""}`;
493
+ const availableOptions = useMemo2(() => {
494
+ const isDefaultOption = options && options.length > 0;
495
+ if (!isDefaultOption)
496
+ return stringOptions.map((opt) => ({ label: opt, value: opt }));
497
+ return options;
498
+ }, [options, stringOptions]);
499
+ function getFiltered() {
500
+ return availableOptions.filter(
501
+ ({ label: label2, value }) => (label2 + "").toLowerCase().includes(keyword.toLowerCase()) || (value + "").toLowerCase().includes(keyword.toLowerCase())
502
+ );
503
+ }
504
+ function selectItem({ label: label2, value }) {
505
+ state.select((prev) => {
506
+ const isItemExist2 = prev.find((item) => item.value == value);
507
+ if (isItemExist2) {
508
+ return prev.filter((item) => item.value != value);
509
+ }
510
+ return [...prev, { label: label2, value }];
511
+ });
512
+ }
513
+ function isItemExist(value) {
514
+ return state.value.find((item) => item.value == value);
515
+ }
516
+ const selectUnSelectAll = useCallback(() => {
517
+ const isAllSelected = state.value.length == availableOptions.length;
518
+ state.select(isAllSelected ? [] : availableOptions);
519
+ }, [state.value]);
520
+ function getThemedClass(prefix) {
521
+ return `var(--color${isdarkmode ? "-dark" : ""}${prefix})`;
522
+ }
523
+ return /* @__PURE__ */ React10.createElement("div", { className: `group w-full ${attr.outerclass}` }, label && /* @__PURE__ */ React10.createElement(
524
+ "label",
525
+ {
526
+ htmlFor: labelHtml,
527
+ className: "text-input__label",
528
+ style: { color: getThemedClass("-text-secondary") }
529
+ },
530
+ label
531
+ ), /* @__PURE__ */ React10.createElement(
532
+ "div",
533
+ {
534
+ className: "text-input__wrapper relative",
535
+ style: {
536
+ borderColor: getThemedClass("-border"),
537
+ background: getThemedClass("-bg-surface")
538
+ }
539
+ },
540
+ /* @__PURE__ */ React10.createElement(
541
+ "input",
542
+ {
543
+ type: "search",
544
+ value: keyword,
545
+ autoComplete: "off",
546
+ className: `${input3} ${placeholderClass}`,
547
+ onChange: (e) => setKeyword(e.target.value),
548
+ placeholder: `${state.value.length} Dipilih`,
549
+ style: {
550
+ color: state.value.length > 0 ? getThemedClass("-text-primary") : void 0
551
+ }
552
+ }
553
+ ),
554
+ /* @__PURE__ */ React10.createElement(
555
+ "div",
556
+ {
557
+ className: "select-item__wrapper select-multiple__wrapper",
558
+ style: {
559
+ borderColor: getThemedClass("-border"),
560
+ background: getThemedClass("-bg-surface")
561
+ }
562
+ },
563
+ getFiltered().length == 0 && keyword != "" && /* @__PURE__ */ React10.createElement(
564
+ "button",
565
+ {
566
+ disabled: true,
567
+ className: "select-item",
568
+ style: { color: "var(--color-danger)" }
569
+ },
570
+ "Tidak ada Item"
571
+ ),
572
+ getFiltered().map(({ label: label2, value }) => /* @__PURE__ */ React10.createElement(
573
+ "button",
574
+ {
575
+ key: value,
576
+ type: "button",
577
+ onClick: () => selectItem({ label: label2, value }),
578
+ className: `select-item ${optionHoverClass}`,
579
+ style: { color: getThemedClass("-text-secondary") }
580
+ },
581
+ label2,
582
+ isItemExist(value) && /* @__PURE__ */ React10.createElement(
583
+ FontAwesomeIcon7,
584
+ {
585
+ icon: faCheck3,
586
+ style: { color: "var(--color-info)" }
587
+ }
588
+ )
589
+ ))
590
+ ),
591
+ /* @__PURE__ */ React10.createElement(
592
+ "button",
593
+ {
594
+ type: "button",
595
+ className: "cursor-pointer",
596
+ onClick: selectUnSelectAll
597
+ },
598
+ /* @__PURE__ */ React10.createElement(
599
+ FontAwesomeIcon7,
600
+ {
601
+ icon: faListCheck,
602
+ style: {
603
+ color: getThemedClass("-icon-input"),
604
+ paddingRight: "0.7rem",
605
+ fontSize: "1.2rem"
606
+ }
607
+ }
608
+ )
609
+ )
610
+ ));
611
+ }
612
+ var input3 = "text-input peer ... w-full";
613
+
614
+ // src/components/ThemeToggle.tsx
615
+ import React11 from "react";
616
+ function ThemeToggle(attr) {
617
+ return /* @__PURE__ */ React11.createElement("div", { className: "flex items-center h-[3rem]" }, /* @__PURE__ */ React11.createElement(
618
+ "label",
619
+ {
620
+ htmlFor: `${attr.id || "theme-toggle"}`,
621
+ className: "slider__wrapper slider-theme slider-theme-light relative"
622
+ },
623
+ /* @__PURE__ */ React11.createElement(
624
+ "input",
625
+ __spreadProps(__spreadValues({
626
+ id: "theme-toggle"
627
+ }, attr), {
628
+ type: "checkbox",
629
+ className: "peer ... w-[38px] h-[20px] opacity-[0] cursor-pointer absolute"
630
+ })
631
+ ),
632
+ /* @__PURE__ */ React11.createElement("span", { className: "slider-theme__bullet" })
633
+ ));
634
+ }
635
+
636
+ // src/components/Dashboard.tsx
637
+ import React12, { useState as useState3 } from "react";
638
+ var list = [
639
+ { label: "Option 1", value: "option1" },
640
+ { label: "Option 2", value: "option2" },
641
+ { label: "Option 3", value: "option3" }
642
+ ];
643
+ var stringList = ["option1", "option2", "option3"];
644
+ function Dashboard() {
645
+ const [selectedItem, setSelectedItem] = useState3([]);
646
+ const [sel, setSel] = useState3({ label: "", value: "" });
647
+ function updateState(item) {
648
+ const filtered = list.find(({ value }) => value == item);
649
+ filtered && setSel(filtered);
650
+ }
651
+ return /* @__PURE__ */ React12.createElement("div", { className: "flex items-center gap-[1rem]" }, /* @__PURE__ */ React12.createElement(
652
+ MultiSelect,
653
+ {
654
+ isdarkmode: true,
655
+ label: "Multi Select",
656
+ stringOptions: stringList,
657
+ state: { value: selectedItem, select: setSelectedItem }
658
+ }
659
+ ), /* @__PURE__ */ React12.createElement(
660
+ SingleSelect,
661
+ {
662
+ label: "Single Select",
663
+ name: "newinput",
664
+ stringOptions: stringList,
665
+ placeholder: "-- Pilih Status --",
666
+ value: sel.value
667
+ }
668
+ ));
669
+ }
670
+
671
+ // src/components/Badge.tsx
672
+ import React13 from "react";
673
+ function Badge({
674
+ text,
675
+ type,
676
+ className
677
+ }) {
678
+ return /* @__PURE__ */ React13.createElement("div", { className: "badge__wrapper" }, /* @__PURE__ */ React13.createElement(
679
+ "span",
680
+ {
681
+ style: {
682
+ background: `var(--color-${type})`
683
+ },
684
+ className: `badge ${className}`
685
+ },
686
+ text
687
+ ));
688
+ }
689
+
690
+ // src/components/Skeleton.tsx
691
+ import React14 from "react";
692
+ function Skeleton({ className }) {
693
+ return /* @__PURE__ */ React14.createElement("div", { className: `${className} skeleton` }, /* @__PURE__ */ React14.createElement("span", { className: "skeleton__item skeleton-slide" }));
694
+ }
695
+
696
+ // src/components/Navigation.tsx
697
+ import React15 from "react";
698
+ function Navigation() {
699
+ return /* @__PURE__ */ React15.createElement("nav", null);
700
+ }
701
+ var URLNavigation = (props) => {
702
+ const Component = props.CustomComponent || "a";
703
+ function getAnchorClass(href) {
704
+ return href === props.activeUrl ? "bg-[var(--color-primary-soft)] text-[var(--color-primary)]" : "text-[var(--color-text-secondary)]/70 hover:bg-[var(--color-border)]/40";
705
+ }
706
+ return /* @__PURE__ */ React15.createElement("nav", { className: `nav__wrapper ${props.outerclass}` }, props.list.map((prop) => /* @__PURE__ */ React15.createElement(
707
+ Component,
708
+ __spreadValues({
709
+ key: prop.href,
710
+ className: `${base__anchor} ${getAnchorClass(prop.href)}`
711
+ }, prop),
712
+ prop.label
713
+ )));
714
+ };
715
+ Navigation.URL = URLNavigation;
716
+ var base__anchor = "p-[0.8rem] h-full grid items-center transition-all leading-[1] px-[1.2rem] rounded-[0.4rem]";
717
+
718
+ // src/components/Confirmation.tsx
719
+ import React16 from "react";
720
+ function Confirmation({
721
+ type = "warning",
722
+ text,
723
+ title,
724
+ secondaryAction,
725
+ secondaryLabel = "Tidak",
726
+ mainAction,
727
+ mainLabel = "Ya"
728
+ }) {
729
+ return /* @__PURE__ */ React16.createElement("div", { className: "confirmation__outer" }, /* @__PURE__ */ React16.createElement("div", { className: "confirmation__card" }, /* @__PURE__ */ React16.createElement("div", { className: wrapper }, /* @__PURE__ */ React16.createElement("div", { className: `baloon__${type} baloon` }), /* @__PURE__ */ React16.createElement("div", null, /* @__PURE__ */ React16.createElement("h3", { className: "font-semibold" }, title), /* @__PURE__ */ React16.createElement("p", { className: confirmation__text }, text))), /* @__PURE__ */ React16.createElement("div", { className: "confirmation__footer" }, secondaryAction && /* @__PURE__ */ React16.createElement(
730
+ "button",
731
+ {
732
+ onClick: secondaryAction,
733
+ type: "button",
734
+ className: "cursor-pointer",
735
+ style: { color: `var(--color-${type})` }
736
+ },
737
+ secondaryLabel
738
+ ), /* @__PURE__ */ React16.createElement(
739
+ "button",
740
+ {
741
+ onClick: mainAction,
742
+ className: "cursor-pointer btn__primary min-w-[8rem]",
743
+ style: {
744
+ background: `var(--color-${type})`,
745
+ border: `1px solid var(--color-${type})`
746
+ }
747
+ },
748
+ mainLabel
749
+ ))));
750
+ }
751
+ var wrapper = "pt-[0.5rem] pb-[1rem] px-[1.8rem] grid items-center gap-[1.5rem]";
752
+ var confirmation__text = "mt-[0.7rem] w-[90%] text-[var(--color-text-secondary)]";
753
+ export {
754
+ Badge,
755
+ Button,
756
+ Card,
757
+ Confirmation,
758
+ Dashboard,
759
+ Expandable,
760
+ MultiSelect,
761
+ NavTabClient,
762
+ Navigation,
763
+ SingleSelect,
764
+ Skeleton,
765
+ Slider,
766
+ TextInput,
767
+ ThemeToggle,
768
+ Toast,
769
+ Tooltip
770
+ };
771
+ //# sourceMappingURL=index.mjs.map