unipo-ui 1.2.0 → 1.4.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/cli/index.mjs +53 -4
- package/dist/EditorBlok-CarZErBW.d.cts +155 -0
- package/dist/EditorBlok-CarZErBW.d.ts +155 -0
- package/dist/admisi-LKPO7LCR.js +11 -0
- package/dist/admisi-U6YYQGBB.cjs +20 -0
- package/dist/akademik-3DFVHKUD.cjs +20 -0
- package/dist/akademik-IXTTJMVD.js +11 -0
- package/dist/akses-AUPQD6YN.cjs +20 -0
- package/dist/akses-V5XIMBWT.js +11 -0
- package/dist/arsip-23P44PGP.cjs +20 -0
- package/dist/arsip-NZFZOTY7.js +11 -0
- package/dist/cbt-4N6COVIN.js +11 -0
- package/dist/cbt-GMQSR7TP.cjs +20 -0
- package/dist/chunk-3O5ELKBH.cjs +18 -0
- package/dist/chunk-3O5ELKBH.cjs.map +1 -0
- package/dist/chunk-BCHB7R6D.cjs +614 -0
- package/dist/chunk-BCHB7R6D.cjs.map +1 -0
- package/dist/chunk-BRARGLUX.js +462 -0
- package/dist/chunk-BRARGLUX.js.map +1 -0
- package/dist/chunk-CIVK5JDV.cjs +150 -0
- package/dist/chunk-CIVK5JDV.cjs.map +1 -0
- package/dist/{chunk-SJ4DJOMZ.js → chunk-DHQFANBE.js} +178 -1557
- package/dist/chunk-DHQFANBE.js.map +1 -0
- package/dist/chunk-JSUHAYQ4.js +15 -0
- package/dist/chunk-JSUHAYQ4.js.map +1 -0
- package/dist/chunk-LTADAXBH.cjs +510 -0
- package/dist/chunk-LTADAXBH.cjs.map +1 -0
- package/dist/chunk-NCRYPHOJ.cjs +2276 -0
- package/dist/chunk-NCRYPHOJ.cjs.map +1 -0
- package/dist/chunk-PC4G2C4M.js +1007 -0
- package/dist/chunk-PC4G2C4M.js.map +1 -0
- package/dist/chunk-PYMN25WD.js +2176 -0
- package/dist/chunk-PYMN25WD.js.map +1 -0
- package/dist/chunk-PYYLKWNZ.js +537 -0
- package/dist/chunk-PYYLKWNZ.js.map +1 -0
- package/dist/chunk-QHVQ6R55.cjs +1059 -0
- package/dist/chunk-QHVQ6R55.cjs.map +1 -0
- package/dist/chunk-TITKMSUS.cjs +2186 -0
- package/dist/chunk-TITKMSUS.cjs.map +1 -0
- package/dist/chunk-UA6AUXMY.js +122 -0
- package/dist/chunk-UA6AUXMY.js.map +1 -0
- package/dist/crm-C4XGSG6O.js +11 -0
- package/dist/crm-LTVCDNMK.cjs +20 -0
- package/dist/dasbor-OJLMSFTF.cjs +20 -0
- package/dist/dasbor-Y3UPFYFE.js +11 -0
- package/dist/editor.cjs +2050 -0
- package/dist/editor.cjs.map +1 -0
- package/dist/editor.d.cts +202 -0
- package/dist/editor.d.ts +202 -0
- package/dist/editor.js +1986 -0
- package/dist/editor.js.map +1 -0
- package/dist/edom-3GZUUB7H.cjs +20 -0
- package/dist/edom-K4Y2NV4K.js +11 -0
- package/dist/fakultas-DJRUVJBV.js +11 -0
- package/dist/fakultas-VVAQOPUX.cjs +20 -0
- package/dist/filter-D54KALbB.d.cts +436 -0
- package/dist/filter-D54KALbB.d.ts +436 -0
- package/dist/helpdesk-LV65LM5V.js +11 -0
- package/dist/helpdesk-S7GAHYXG.cjs +20 -0
- package/dist/humas-7BMMJ3WF.js +11 -0
- package/dist/humas-H56JFUW6.cjs +20 -0
- package/dist/ikon.cjs +125 -0
- package/dist/ikon.cjs.map +1 -0
- package/dist/ikon.d.cts +140 -0
- package/dist/ikon.d.ts +140 -0
- package/dist/ikon.js +6 -0
- package/dist/ikon.js.map +1 -0
- package/dist/iku-CJG75NAT.cjs +20 -0
- package/dist/iku-XFGUJ6CX.js +11 -0
- package/dist/index.cjs +601 -313
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +192 -2
- package/dist/index.d.ts +192 -2
- package/dist/index.js +128 -4
- package/dist/index.js.map +1 -1
- package/dist/induk-BGTGKRLL.js +11 -0
- package/dist/induk-DLYDMZAM.cjs +20 -0
- package/dist/integrasi-4VXNGA3V.cjs +20 -0
- package/dist/integrasi-IP3WWDO7.js +11 -0
- package/dist/kalender-NZH7F2LO.js +11 -0
- package/dist/kalender-SD7EUASC.cjs +20 -0
- package/dist/karier-BDPZONV6.cjs +20 -0
- package/dist/karier-VHUJKKD6.js +11 -0
- package/dist/katalog.cjs +1806 -0
- package/dist/katalog.cjs.map +1 -0
- package/dist/katalog.d.cts +650 -0
- package/dist/katalog.d.ts +650 -0
- package/dist/katalog.js +1721 -0
- package/dist/katalog.js.map +1 -0
- package/dist/kelulusan-3QCPPC3D.js +11 -0
- package/dist/kelulusan-X7DYJN6T.cjs +20 -0
- package/dist/kemahasiswaan-JNCMH3HR.js +11 -0
- package/dist/kemahasiswaan-MQYXEVKE.cjs +20 -0
- package/dist/kerjasama-KYHEBSLX.cjs +20 -0
- package/dist/kerjasama-QSZ5X4OB.js +11 -0
- package/dist/keu-6H5WH6A4.js +11 -0
- package/dist/keu-MIJRVMGW.cjs +20 -0
- package/dist/kurikulum-SRO7TJYI.cjs +20 -0
- package/dist/kurikulum-XT7PZJOK.js +11 -0
- package/dist/layanan-H25JKJKC.js +11 -0
- package/dist/layanan-XR75P7YX.cjs +20 -0
- package/dist/lms-2ZCH273D.cjs +20 -0
- package/dist/lms-MFXFO2AZ.js +11 -0
- package/dist/lppm-B7ECUONV.js +11 -0
- package/dist/lppm-QEQKZXCY.cjs +20 -0
- package/dist/master-GKTTAKLF.cjs +20 -0
- package/dist/master-ZG4SPPDU.js +11 -0
- package/dist/mbkm-737Q4WFQ.js +11 -0
- package/dist/mbkm-GMNFIFDS.cjs +20 -0
- package/dist/notifikasi-FMA26M4I.js +11 -0
- package/dist/notifikasi-QDCYIX7G.cjs +20 -0
- package/dist/pddikti-RJVYY2J4.cjs +20 -0
- package/dist/pddikti-VF2PXDKA.js +11 -0
- package/dist/{content-DaJPx5LX.d.cts → pemeliharaan-D5S-1lqW.d.ts} +38 -434
- package/dist/{content-DaJPx5LX.d.ts → pemeliharaan-Dr0HSxvZ.d.cts} +38 -434
- package/dist/perpustakaan-5RL33XG2.js +11 -0
- package/dist/perpustakaan-JXZW43MJ.cjs +20 -0
- package/dist/pilih-BEes_D3n.d.cts +205 -0
- package/dist/pilih-CEKqXMUS.d.ts +205 -0
- package/dist/pmb-EGTWW2ZH.cjs +20 -0
- package/dist/pmb-G7EAFJ3R.js +11 -0
- package/dist/portal-5LCG6IP3.cjs +20 -0
- package/dist/portal-NYR3OIU4.js +11 -0
- package/dist/portal-api-BJLO6AGI.js +11 -0
- package/dist/portal-api-Q6B3X6ZV.cjs +20 -0
- package/dist/profil-FA2WXZR5.js +11 -0
- package/dist/profil-J4DRC6LS.cjs +20 -0
- package/dist/referensi-HNYOJGNX.js +11 -0
- package/dist/referensi-VOT5BRCL.cjs +20 -0
- package/dist/registry.json +996 -4
- package/dist/repositori-4GHBDDQA.js +11 -0
- package/dist/repositori-JRDIIPDJ.cjs +20 -0
- package/dist/rpl-4RGI6RNL.js +11 -0
- package/dist/rpl-NBVCZHQF.cjs +20 -0
- package/dist/sarpras-TAF4M2NQ.js +11 -0
- package/dist/sarpras-TXNUAX4Y.cjs +20 -0
- package/dist/scss/components/_animasi.scss +280 -0
- package/dist/scss/components/_editor.scss +1093 -0
- package/dist/scss/components/_ikon.scss +339 -0
- package/dist/scss/components/_katalog.scss +662 -0
- package/dist/scss/components/_konten-blok.scss +413 -0
- package/dist/scss/components/_pilih-berkas.scss +156 -0
- package/dist/scss/components/_platform.scss +364 -0
- package/dist/scss/index.scss +7 -0
- package/dist/sdm-5YKAAV3T.js +11 -0
- package/dist/sdm-IN64PE3T.cjs +20 -0
- package/dist/siakad.cjs +1487 -3078
- package/dist/siakad.cjs.map +1 -1
- package/dist/siakad.d.cts +84 -196
- package/dist/siakad.d.ts +84 -196
- package/dist/siakad.js +473 -2307
- package/dist/siakad.js.map +1 -1
- package/dist/spmi-AXZ5B3EJ.cjs +20 -0
- package/dist/spmi-LMUM2XER.js +11 -0
- package/dist/tracer-UBUAIJEK.js +11 -0
- package/dist/tracer-WWVIA55Q.cjs +20 -0
- package/dist/ui-unipo.css +3505 -0
- package/dist/ui-unipo.min.css +1 -1
- package/package.json +35 -3
- package/src/components/animasi.tsx +186 -0
- package/src/components/modal.tsx +113 -0
- package/src/components/overlays.tsx +6 -1
- package/src/components/pemeliharaan.tsx +152 -0
- package/src/components/platform.tsx +94 -0
- package/src/editor/EditorBerita.tsx +297 -0
- package/src/editor/EditorBlok.tsx +367 -0
- package/src/editor/Kanvas.tsx +322 -0
- package/src/editor/Penyisip.tsx +185 -0
- package/src/editor/TeksSebaris.tsx +190 -0
- package/src/editor/blok/Media.tsx +132 -0
- package/src/editor/blok/Tata.tsx +115 -0
- package/src/editor/blok/Teks.tsx +182 -0
- package/src/editor/blok/index.tsx +212 -0
- package/src/editor/blok/props.ts +24 -0
- package/src/editor/index.ts +10 -0
- package/src/editor/konteks.tsx +58 -0
- package/src/editor/render.ts +232 -0
- package/src/editor/tipe.ts +225 -0
- package/src/ikon/ilustrasi.tsx +283 -0
- package/src/ikon/index.ts +7 -0
- package/src/ikon/kotak.tsx +30 -0
- package/src/ikon/unipo.tsx +326 -0
- package/src/index.ts +8 -0
- package/src/katalog/aturan.ts +515 -0
- package/src/katalog/data/id.ts +749 -0
- package/src/katalog/data/indeks.json +1 -0
- package/src/katalog/data/muat.ts +47 -0
- package/src/katalog/ikon.tsx +11 -0
- package/src/katalog/index.ts +13 -0
- package/src/katalog/isian.tsx +408 -0
- package/src/katalog/katalog.tsx +138 -0
- package/src/katalog/kelola.tsx +690 -0
- package/src/katalog/modul.tsx +336 -0
- package/src/katalog/tampil.tsx +147 -0
- package/src/katalog/tipe.ts +141 -0
- package/src/katalog/wizard.tsx +155 -0
- package/src/lib/platform.ts +91 -0
- package/src/siakad/index.ts +3 -0
- package/src/siakad/media-editor.ts +67 -0
- package/src/siakad/pemeliharaan.tsx +118 -0
- package/src/siakad/pilih-berkas.tsx +292 -0
- package/src/siakad/provider.tsx +2 -0
- package/dist/chunk-DEF5CA7C.cjs +0 -3648
- package/dist/chunk-DEF5CA7C.cjs.map +0 -1
- package/dist/chunk-SJ4DJOMZ.js.map +0 -1
|
@@ -0,0 +1,614 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var chunk3O5ELKBH_cjs = require('./chunk-3O5ELKBH.cjs');
|
|
5
|
+
var useRender = require('@base-ui/react/use-render');
|
|
6
|
+
var mergeProps = require('@base-ui/react/merge-props');
|
|
7
|
+
var separator = require('@base-ui/react/separator');
|
|
8
|
+
var lucideReact = require('lucide-react');
|
|
9
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
10
|
+
var React = require('react');
|
|
11
|
+
var field = require('@base-ui/react/field');
|
|
12
|
+
var fieldset = require('@base-ui/react/fieldset');
|
|
13
|
+
var input = require('@base-ui/react/input');
|
|
14
|
+
var checkbox = require('@base-ui/react/checkbox');
|
|
15
|
+
var checkboxGroup = require('@base-ui/react/checkbox-group');
|
|
16
|
+
var radio = require('@base-ui/react/radio');
|
|
17
|
+
var radioGroup = require('@base-ui/react/radio-group');
|
|
18
|
+
var _switch = require('@base-ui/react/switch');
|
|
19
|
+
var numberField = require('@base-ui/react/number-field');
|
|
20
|
+
var otpField = require('@base-ui/react/otp-field');
|
|
21
|
+
var slider = require('@base-ui/react/slider');
|
|
22
|
+
var toggle = require('@base-ui/react/toggle');
|
|
23
|
+
var toggleGroup = require('@base-ui/react/toggle-group');
|
|
24
|
+
var dialog = require('@base-ui/react/dialog');
|
|
25
|
+
var alertDialog = require('@base-ui/react/alert-dialog');
|
|
26
|
+
var popover = require('@base-ui/react/popover');
|
|
27
|
+
var tooltip = require('@base-ui/react/tooltip');
|
|
28
|
+
var menu = require('@base-ui/react/menu');
|
|
29
|
+
var toast = require('@base-ui/react/toast');
|
|
30
|
+
|
|
31
|
+
function _interopNamespace(e) {
|
|
32
|
+
if (e && e.__esModule) return e;
|
|
33
|
+
var n = Object.create(null);
|
|
34
|
+
if (e) {
|
|
35
|
+
Object.keys(e).forEach(function (k) {
|
|
36
|
+
if (k !== 'default') {
|
|
37
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
38
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () { return e[k]; }
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
n.default = e;
|
|
46
|
+
return Object.freeze(n);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
50
|
+
|
|
51
|
+
// src/lib/format.ts
|
|
52
|
+
var LOCALE = "id-ID";
|
|
53
|
+
function initials(name, max = 2) {
|
|
54
|
+
if (!name) return "?";
|
|
55
|
+
const words = name.replace(/,.*$/, "").replace(/\b(dr|drs|dra|ir|prof|h|hj|s\.\w+|m\.\w+)\.?\s/gi, " ").replace(/[^\p{L}\p{N}\s]/gu, " ").split(/\s+/).filter((w) => w && !/^(dan|di|ke|dari|untuk|bin|binti|the|of|and)$/i.test(w));
|
|
56
|
+
if (!words.length) return "?";
|
|
57
|
+
if (words.length === 1) return words[0].slice(0, max).toUpperCase();
|
|
58
|
+
return words.slice(0, max).map((w) => w[0]).join("").toUpperCase();
|
|
59
|
+
}
|
|
60
|
+
function hueFromString(text) {
|
|
61
|
+
let h = 0;
|
|
62
|
+
for (let i = 0; i < text.length; i++) h = h * 31 + text.charCodeAt(i) >>> 0;
|
|
63
|
+
return h % 360;
|
|
64
|
+
}
|
|
65
|
+
function formatNumber(n, opts) {
|
|
66
|
+
if (n == null || Number.isNaN(n)) return "\u2013";
|
|
67
|
+
return new Intl.NumberFormat(LOCALE, opts).format(n);
|
|
68
|
+
}
|
|
69
|
+
function formatCompact(n) {
|
|
70
|
+
return formatNumber(n, { notation: "compact", maximumFractionDigits: 1 });
|
|
71
|
+
}
|
|
72
|
+
function formatRupiah(n) {
|
|
73
|
+
return formatNumber(n, { style: "currency", currency: "IDR", maximumFractionDigits: 0 });
|
|
74
|
+
}
|
|
75
|
+
function formatDate(d, style = "medium") {
|
|
76
|
+
if (!d) return "\u2013";
|
|
77
|
+
const date = typeof d === "string" ? new Date(d.length === 10 ? d + "T00:00:00" : d) : d;
|
|
78
|
+
if (Number.isNaN(date.getTime())) return String(d);
|
|
79
|
+
return new Intl.DateTimeFormat(LOCALE, { dateStyle: style }).format(date);
|
|
80
|
+
}
|
|
81
|
+
function formatTime(d) {
|
|
82
|
+
if (!d) return "\u2013";
|
|
83
|
+
const date = typeof d === "string" ? new Date(d) : d;
|
|
84
|
+
return new Intl.DateTimeFormat(LOCALE, { hour: "2-digit", minute: "2-digit" }).format(date);
|
|
85
|
+
}
|
|
86
|
+
function formatRelative(d, now = /* @__PURE__ */ new Date()) {
|
|
87
|
+
const date = typeof d === "string" ? new Date(d) : d;
|
|
88
|
+
const diff = (date.getTime() - now.getTime()) / 1e3;
|
|
89
|
+
const rtf = new Intl.RelativeTimeFormat(LOCALE, { numeric: "auto" });
|
|
90
|
+
const units = [
|
|
91
|
+
["year", 31536e3],
|
|
92
|
+
["month", 2592e3],
|
|
93
|
+
["week", 604800],
|
|
94
|
+
["day", 86400],
|
|
95
|
+
["hour", 3600],
|
|
96
|
+
["minute", 60]
|
|
97
|
+
];
|
|
98
|
+
for (const [unit, sec] of units) if (Math.abs(diff) >= sec) return rtf.format(Math.round(diff / sec), unit);
|
|
99
|
+
return rtf.format(Math.round(diff), "second");
|
|
100
|
+
}
|
|
101
|
+
function formatBytes(bytes) {
|
|
102
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
103
|
+
const u = ["KB", "MB", "GB"];
|
|
104
|
+
let v = bytes / 1024;
|
|
105
|
+
let i = 0;
|
|
106
|
+
while (v >= 1024 && i < u.length - 1) {
|
|
107
|
+
v /= 1024;
|
|
108
|
+
i++;
|
|
109
|
+
}
|
|
110
|
+
return `${formatNumber(v, { maximumFractionDigits: 1 })} ${u[i]}`;
|
|
111
|
+
}
|
|
112
|
+
function formatRupiahRingkas(n) {
|
|
113
|
+
if (n == null || Number.isNaN(n)) return "\u2013";
|
|
114
|
+
const a = Math.abs(n);
|
|
115
|
+
const [d, s] = a >= 1e12 ? [1e12, "T"] : a >= 1e9 ? [1e9, "M"] : a >= 1e6 ? [1e6, "jt"] : a >= 1e3 ? [1e3, "rb"] : [1, ""];
|
|
116
|
+
return `Rp ${formatNumber(n / d, { maximumFractionDigits: n / d >= 100 ? 0 : 1 })}${s ? " " + s : ""}`;
|
|
117
|
+
}
|
|
118
|
+
function formatPersen(n, digits = 1) {
|
|
119
|
+
if (n == null || Number.isNaN(n)) return "\u2013";
|
|
120
|
+
return `${formatNumber(n, { maximumFractionDigits: digits })}%`;
|
|
121
|
+
}
|
|
122
|
+
function Button({ variant = "primary", size = "md", iconOnly, fullWidth, loading, className, render, children, disabled, ...props }) {
|
|
123
|
+
const defaultProps = {
|
|
124
|
+
className: chunk3O5ELKBH_cjs.cn("u-button", className),
|
|
125
|
+
"data-variant": variant,
|
|
126
|
+
"data-size": size,
|
|
127
|
+
"data-icon-only": chunk3O5ELKBH_cjs.dataFlag(iconOnly),
|
|
128
|
+
"data-full-width": chunk3O5ELKBH_cjs.dataFlag(fullWidth),
|
|
129
|
+
"data-loading": chunk3O5ELKBH_cjs.dataFlag(loading),
|
|
130
|
+
"aria-busy": loading || void 0,
|
|
131
|
+
disabled: disabled || loading,
|
|
132
|
+
type: render ? void 0 : "button",
|
|
133
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
134
|
+
children,
|
|
135
|
+
loading && /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: size === "lg" || size === "xl" ? "md" : "sm" })
|
|
136
|
+
] })
|
|
137
|
+
};
|
|
138
|
+
return useRender.useRender({ render, defaultTagName: "button", props: mergeProps.mergeProps(defaultProps, props) });
|
|
139
|
+
}
|
|
140
|
+
function ButtonGroup({ className, ...props }) {
|
|
141
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "group", className: chunk3O5ELKBH_cjs.cn("u-button-group", className), ...props });
|
|
142
|
+
}
|
|
143
|
+
function Badge({ variant = "neutral", size, shape, dot, className, children, ...props }) {
|
|
144
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: chunk3O5ELKBH_cjs.cn("u-badge", className), "data-variant": variant, "data-size": size, "data-shape": shape, ...props, children: [
|
|
145
|
+
dot && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "u-badge-dot", "aria-hidden": true }),
|
|
146
|
+
children
|
|
147
|
+
] });
|
|
148
|
+
}
|
|
149
|
+
function Tag({ active, size, icon, onRemove, removeLabel = "Hapus", className, render, children, ...props }) {
|
|
150
|
+
return useRender.useRender({
|
|
151
|
+
render,
|
|
152
|
+
defaultTagName: "span",
|
|
153
|
+
props: mergeProps.mergeProps(
|
|
154
|
+
{
|
|
155
|
+
className: chunk3O5ELKBH_cjs.cn("u-tag", className),
|
|
156
|
+
"data-active": chunk3O5ELKBH_cjs.dataFlag(active),
|
|
157
|
+
"data-size": size,
|
|
158
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
159
|
+
icon,
|
|
160
|
+
children,
|
|
161
|
+
onRemove && /* @__PURE__ */ jsxRuntime.jsx(
|
|
162
|
+
"button",
|
|
163
|
+
{
|
|
164
|
+
type: "button",
|
|
165
|
+
className: "u-tag-remove",
|
|
166
|
+
"aria-label": removeLabel,
|
|
167
|
+
onClick: (e) => {
|
|
168
|
+
e.preventDefault();
|
|
169
|
+
e.stopPropagation();
|
|
170
|
+
onRemove();
|
|
171
|
+
},
|
|
172
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: 12 })
|
|
173
|
+
}
|
|
174
|
+
)
|
|
175
|
+
] })
|
|
176
|
+
},
|
|
177
|
+
props
|
|
178
|
+
)
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
function Kbd({ className, ...props }) {
|
|
182
|
+
return /* @__PURE__ */ jsxRuntime.jsx("kbd", { className: chunk3O5ELKBH_cjs.cn("u-kbd", className), ...props });
|
|
183
|
+
}
|
|
184
|
+
function Spinner({ size = "md", className, label = "Memuat", ...props }) {
|
|
185
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 24 24", fill: "none", role: "status", "aria-label": label, className: chunk3O5ELKBH_cjs.cn("u-spinner", className), "data-size": size, ...props, children: [
|
|
186
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "9", stroke: "currentColor", strokeOpacity: "0.2", strokeWidth: "2.5" }),
|
|
187
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 12a9 9 0 0 0-9-9", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round" })
|
|
188
|
+
] });
|
|
189
|
+
}
|
|
190
|
+
function Skeleton({ shape, className, style, width, height, ...props }) {
|
|
191
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: chunk3O5ELKBH_cjs.cn("u-skeleton", className), "data-shape": shape, style: { width, height, ...style }, ...props });
|
|
192
|
+
}
|
|
193
|
+
function Separator({ className, orientation = "horizontal", label, ...props }) {
|
|
194
|
+
if (label) {
|
|
195
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "separator", className: chunk3O5ELKBH_cjs.cn("u-separator-label", typeof className === "string" && className), children: label });
|
|
196
|
+
}
|
|
197
|
+
return /* @__PURE__ */ jsxRuntime.jsx(separator.Separator, { orientation, className: chunk3O5ELKBH_cjs.cn("u-separator", className), ...props });
|
|
198
|
+
}
|
|
199
|
+
function VisuallyHidden(props) {
|
|
200
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "u-sr-only", ...props });
|
|
201
|
+
}
|
|
202
|
+
function Label({ className, required, optional, children, ...props }) {
|
|
203
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: chunk3O5ELKBH_cjs.cn("u-label", className), ...props, children: [
|
|
204
|
+
children,
|
|
205
|
+
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "u-label-required", "aria-hidden": true, children: "*" }),
|
|
206
|
+
optional && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "u-label-optional", children: "(opsional)" })
|
|
207
|
+
] });
|
|
208
|
+
}
|
|
209
|
+
function Field({ label, description, error, required, optional, orientation, className, children, invalid, ...props }) {
|
|
210
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(field.Field.Root, { className: chunk3O5ELKBH_cjs.cn("u-field", className), "data-orientation": orientation, invalid: invalid ?? Boolean(error), ...props, children: [
|
|
211
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(field.Field.Label, { className: "u-label", children: [
|
|
212
|
+
label,
|
|
213
|
+
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "u-label-required", "aria-hidden": true, children: "*" }),
|
|
214
|
+
optional && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "u-label-optional", children: "(opsional)" })
|
|
215
|
+
] }),
|
|
216
|
+
children,
|
|
217
|
+
description && !error && /* @__PURE__ */ jsxRuntime.jsx(field.Field.Description, { className: "u-field-description", children: description }),
|
|
218
|
+
error && /* @__PURE__ */ jsxRuntime.jsxs(field.Field.Error, { className: "u-field-error", match: true, children: [
|
|
219
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleAlert, { "aria-hidden": true }),
|
|
220
|
+
error
|
|
221
|
+
] })
|
|
222
|
+
] });
|
|
223
|
+
}
|
|
224
|
+
var FieldControl = field.Field.Control;
|
|
225
|
+
function FieldDescription({ className, ...props }) {
|
|
226
|
+
return /* @__PURE__ */ jsxRuntime.jsx(field.Field.Description, { className: chunk3O5ELKBH_cjs.cn("u-field-description", className), ...props });
|
|
227
|
+
}
|
|
228
|
+
function FieldError({ className, children, ...props }) {
|
|
229
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(field.Field.Error, { className: chunk3O5ELKBH_cjs.cn("u-field-error", className), ...props, children: [
|
|
230
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleAlert, { "aria-hidden": true }),
|
|
231
|
+
children
|
|
232
|
+
] });
|
|
233
|
+
}
|
|
234
|
+
function Fieldset({ legend, className, children, ...props }) {
|
|
235
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(fieldset.Fieldset.Root, { className: chunk3O5ELKBH_cjs.cn("u-fieldset", className), ...props, children: [
|
|
236
|
+
legend && /* @__PURE__ */ jsxRuntime.jsx(fieldset.Fieldset.Legend, { className: "u-fieldset-legend", children: legend }),
|
|
237
|
+
children
|
|
238
|
+
] });
|
|
239
|
+
}
|
|
240
|
+
function Input({ className, size, ...props }) {
|
|
241
|
+
return /* @__PURE__ */ jsxRuntime.jsx(input.Input, { className: chunk3O5ELKBH_cjs.cn("u-input", className), "data-size": size, ...props });
|
|
242
|
+
}
|
|
243
|
+
function Textarea({ className, ...props }) {
|
|
244
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
245
|
+
field.Field.Control,
|
|
246
|
+
{
|
|
247
|
+
render: (p) => /* @__PURE__ */ jsxRuntime.jsx("textarea", { ...p }),
|
|
248
|
+
className: chunk3O5ELKBH_cjs.cn("u-textarea", className),
|
|
249
|
+
...props
|
|
250
|
+
}
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
function InputGroup({ size, start, end, boxed, invalid, className, children, ...props }) {
|
|
254
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunk3O5ELKBH_cjs.cn("u-input-group", className), "data-size": size, "data-invalid": chunk3O5ELKBH_cjs.dataFlag(invalid), ...props, children: [
|
|
255
|
+
start != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "u-input-addon", "data-align": "start", "data-boxed": chunk3O5ELKBH_cjs.dataFlag(boxed), children: start }),
|
|
256
|
+
children,
|
|
257
|
+
end != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "u-input-addon", "data-align": "end", "data-boxed": chunk3O5ELKBH_cjs.dataFlag(boxed), children: end })
|
|
258
|
+
] });
|
|
259
|
+
}
|
|
260
|
+
function Checkbox({ className, ...props }) {
|
|
261
|
+
return /* @__PURE__ */ jsxRuntime.jsx(checkbox.Checkbox.Root, { className: chunk3O5ELKBH_cjs.cn("u-checkbox", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
262
|
+
checkbox.Checkbox.Indicator,
|
|
263
|
+
{
|
|
264
|
+
className: "u-checkbox-indicator",
|
|
265
|
+
render: (p, state) => /* @__PURE__ */ jsxRuntime.jsx("span", { ...p, children: state.indeterminate ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minus, {}) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, {}) })
|
|
266
|
+
}
|
|
267
|
+
) });
|
|
268
|
+
}
|
|
269
|
+
function Radio({ className, ...props }) {
|
|
270
|
+
return /* @__PURE__ */ jsxRuntime.jsx(radio.Radio.Root, { className: chunk3O5ELKBH_cjs.cn("u-radio", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(radio.Radio.Indicator, { className: "u-radio-indicator" }) });
|
|
271
|
+
}
|
|
272
|
+
function Choice({ label, description, control, disabled, className, ...props }) {
|
|
273
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: chunk3O5ELKBH_cjs.cn("u-choice", className), "data-disabled": chunk3O5ELKBH_cjs.dataFlag(disabled), ...props, children: [
|
|
274
|
+
control,
|
|
275
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "u-choice-text", children: [
|
|
276
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: label }),
|
|
277
|
+
description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "u-choice-description", children: description })
|
|
278
|
+
] })
|
|
279
|
+
] });
|
|
280
|
+
}
|
|
281
|
+
function CheckboxGroup({ options, orientation, variant = "list", columns = 2, className, onValueChange, ...props }) {
|
|
282
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
283
|
+
checkboxGroup.CheckboxGroup,
|
|
284
|
+
{
|
|
285
|
+
className: chunk3O5ELKBH_cjs.cn(variant === "card" ? "u-choice-cards" : "u-choice-group", className),
|
|
286
|
+
"data-orientation": orientation,
|
|
287
|
+
style: variant === "card" ? { "--u-cols": columns } : void 0,
|
|
288
|
+
onValueChange: (v) => onValueChange?.(v),
|
|
289
|
+
...props,
|
|
290
|
+
children: options.map(
|
|
291
|
+
(o) => variant === "card" ? /* @__PURE__ */ jsxRuntime.jsx(ChoiceCard, { ...o, control: /* @__PURE__ */ jsxRuntime.jsx(Checkbox, { value: o.value, disabled: o.disabled }) }, o.value) : /* @__PURE__ */ jsxRuntime.jsx(Choice, { label: o.label, description: o.description, disabled: o.disabled, control: /* @__PURE__ */ jsxRuntime.jsx(Checkbox, { value: o.value, disabled: o.disabled }) }, o.value)
|
|
292
|
+
)
|
|
293
|
+
}
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
function RadioGroup({ options, orientation, variant = "list", columns = 2, className, onValueChange, ...props }) {
|
|
297
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
298
|
+
radioGroup.RadioGroup,
|
|
299
|
+
{
|
|
300
|
+
className: chunk3O5ELKBH_cjs.cn(variant === "card" ? "u-choice-cards" : "u-choice-group", className),
|
|
301
|
+
"data-orientation": orientation,
|
|
302
|
+
style: variant === "card" ? { "--u-cols": columns } : void 0,
|
|
303
|
+
onValueChange: (v) => onValueChange?.(v),
|
|
304
|
+
...props,
|
|
305
|
+
children: options.map(
|
|
306
|
+
(o) => variant === "card" ? /* @__PURE__ */ jsxRuntime.jsx(ChoiceCard, { ...o, control: /* @__PURE__ */ jsxRuntime.jsx(Radio, { value: o.value, disabled: o.disabled }) }, o.value) : /* @__PURE__ */ jsxRuntime.jsx(Choice, { label: o.label, description: o.description, disabled: o.disabled, control: /* @__PURE__ */ jsxRuntime.jsx(Radio, { value: o.value, disabled: o.disabled }) }, o.value)
|
|
307
|
+
)
|
|
308
|
+
}
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
function ChoiceCard({ label, description, icon, control, disabled }) {
|
|
312
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "u-choice-card", "data-disabled": chunk3O5ELKBH_cjs.dataFlag(disabled), children: [
|
|
313
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "u-choice-card-icon", children: icon }),
|
|
314
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "u-choice-text", children: [
|
|
315
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: label }),
|
|
316
|
+
description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "u-choice-description", children: description })
|
|
317
|
+
] }),
|
|
318
|
+
control
|
|
319
|
+
] });
|
|
320
|
+
}
|
|
321
|
+
function Switch({ className, size, ...props }) {
|
|
322
|
+
return /* @__PURE__ */ jsxRuntime.jsx(_switch.Switch.Root, { className: chunk3O5ELKBH_cjs.cn("u-switch", className), "data-size": size, ...props, children: /* @__PURE__ */ jsxRuntime.jsx(_switch.Switch.Thumb, { className: "u-switch-thumb" }) });
|
|
323
|
+
}
|
|
324
|
+
function NumberField({ className, ...props }) {
|
|
325
|
+
return /* @__PURE__ */ jsxRuntime.jsx(numberField.NumberField.Root, { ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(numberField.NumberField.Group, { className: chunk3O5ELKBH_cjs.cn("u-number-field", className), children: [
|
|
326
|
+
/* @__PURE__ */ jsxRuntime.jsx(numberField.NumberField.Decrement, { className: "u-number-field-button", "aria-label": "Kurangi", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minus, {}) }),
|
|
327
|
+
/* @__PURE__ */ jsxRuntime.jsx(numberField.NumberField.Input, {}),
|
|
328
|
+
/* @__PURE__ */ jsxRuntime.jsx(numberField.NumberField.Increment, { className: "u-number-field-button", "aria-label": "Tambah", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, {}) })
|
|
329
|
+
] }) });
|
|
330
|
+
}
|
|
331
|
+
function OtpField({ length = 6, separatorAfter, className, ...props }) {
|
|
332
|
+
return /* @__PURE__ */ jsxRuntime.jsx(otpField.OTPField.Root, { length, className: chunk3O5ELKBH_cjs.cn("u-otp", className), ...props, children: Array.from({ length }, (_, i) => /* @__PURE__ */ jsxRuntime.jsxs(React__namespace.Fragment, { children: [
|
|
333
|
+
/* @__PURE__ */ jsxRuntime.jsx(otpField.OTPField.Input, { className: "u-otp-input" }),
|
|
334
|
+
separatorAfter === i + 1 && i + 1 < length && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "u-otp-separator", "aria-hidden": true })
|
|
335
|
+
] }, i)) });
|
|
336
|
+
}
|
|
337
|
+
function Slider({ className, ...props }) {
|
|
338
|
+
const value = props.value ?? props.defaultValue;
|
|
339
|
+
const thumbs = Array.isArray(value) ? value.length : 1;
|
|
340
|
+
return /* @__PURE__ */ jsxRuntime.jsx(slider.Slider.Root, { className: chunk3O5ELKBH_cjs.cn("u-slider", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(slider.Slider.Control, { className: "u-slider-control", children: /* @__PURE__ */ jsxRuntime.jsxs(slider.Slider.Track, { className: "u-slider-track", children: [
|
|
341
|
+
/* @__PURE__ */ jsxRuntime.jsx(slider.Slider.Indicator, { className: "u-slider-indicator" }),
|
|
342
|
+
Array.from({ length: thumbs }, (_, i) => /* @__PURE__ */ jsxRuntime.jsx(slider.Slider.Thumb, { index: thumbs > 1 ? i : void 0, className: "u-slider-thumb" }, i))
|
|
343
|
+
] }) }) });
|
|
344
|
+
}
|
|
345
|
+
function Toggle({ className, variant, size, ...props }) {
|
|
346
|
+
return /* @__PURE__ */ jsxRuntime.jsx(toggle.Toggle, { className: chunk3O5ELKBH_cjs.cn("u-toggle", className), "data-variant": variant, "data-size": size, ...props });
|
|
347
|
+
}
|
|
348
|
+
function ToggleGroup({ className, ...props }) {
|
|
349
|
+
return /* @__PURE__ */ jsxRuntime.jsx(toggleGroup.ToggleGroup, { className: chunk3O5ELKBH_cjs.cn("u-toggle-group", className), ...props });
|
|
350
|
+
}
|
|
351
|
+
function SegmentedControl({ options, value, defaultValue, onValueChange, fullWidth, className, ...rest }) {
|
|
352
|
+
const [inner, setInner] = React__namespace.useState(defaultValue ?? options[0]?.value);
|
|
353
|
+
const current = value ?? inner;
|
|
354
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
355
|
+
toggleGroup.ToggleGroup,
|
|
356
|
+
{
|
|
357
|
+
className: chunk3O5ELKBH_cjs.cn("u-segmented", className),
|
|
358
|
+
"data-full-width": chunk3O5ELKBH_cjs.dataFlag(fullWidth),
|
|
359
|
+
value: current ? [current] : [],
|
|
360
|
+
onValueChange: (v) => {
|
|
361
|
+
const next = v[0];
|
|
362
|
+
if (!next) return;
|
|
363
|
+
setInner(next);
|
|
364
|
+
onValueChange?.(next);
|
|
365
|
+
},
|
|
366
|
+
"aria-label": rest["aria-label"],
|
|
367
|
+
children: options.map((o) => /* @__PURE__ */ jsxRuntime.jsxs(toggle.Toggle, { value: o.value, className: "u-toggle", "aria-label": o["aria-label"], children: [
|
|
368
|
+
o.icon,
|
|
369
|
+
o.label
|
|
370
|
+
] }, o.value))
|
|
371
|
+
}
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
function deteksiPlatform() {
|
|
375
|
+
if (typeof window === "undefined") return { platform: "web", os: "lain" };
|
|
376
|
+
const w = window;
|
|
377
|
+
const ua = navigator.userAgent;
|
|
378
|
+
const iOS = /iPhone|iPad|iPod/.test(ua) || /Macintosh/.test(ua) && navigator.maxTouchPoints > 1;
|
|
379
|
+
const os = iOS ? "ios" : /Android/.test(ua) ? "android" : /Mac/.test(ua) ? "macos" : /Win/.test(ua) ? "windows" : /Linux/.test(ua) ? "linux" : "lain";
|
|
380
|
+
const cap = w.Capacitor?.getPlatform?.();
|
|
381
|
+
if (cap === "ios" || cap === "android") return { platform: "mobile", os: cap };
|
|
382
|
+
if (w.cordova) return { platform: "mobile", os };
|
|
383
|
+
if (w.__TAURI__ || w.__TAURI_INTERNALS__ || /Electron/.test(ua)) return { platform: "desktop", os };
|
|
384
|
+
return { platform: "web", os };
|
|
385
|
+
}
|
|
386
|
+
function info(platform, os) {
|
|
387
|
+
const sentuh = typeof window !== "undefined" ? window.matchMedia?.("(pointer: coarse)").matches || platform === "mobile" : platform === "mobile";
|
|
388
|
+
return { platform, os, sentuh, mobile: platform === "mobile", desktop: platform === "desktop", ios: os === "ios", android: os === "android" };
|
|
389
|
+
}
|
|
390
|
+
var sekarang = info("web", "lain");
|
|
391
|
+
var pendengar = /* @__PURE__ */ new Set();
|
|
392
|
+
function setelPlatform({ platform = "auto", os = "auto", target } = {}) {
|
|
393
|
+
const d = deteksiPlatform();
|
|
394
|
+
const p = platform === "auto" ? d.platform : platform;
|
|
395
|
+
let o = os === "auto" ? d.os : os;
|
|
396
|
+
if (p === "mobile" && o !== "ios" && o !== "android") o = "android";
|
|
397
|
+
sekarang = info(p, o);
|
|
398
|
+
const el = target ?? (typeof document !== "undefined" ? document.documentElement : null);
|
|
399
|
+
if (el) {
|
|
400
|
+
el.dataset.uPlatform = p;
|
|
401
|
+
el.dataset.uOs = o;
|
|
402
|
+
if (sekarang.sentuh) el.dataset.uSentuh = "";
|
|
403
|
+
else delete el.dataset.uSentuh;
|
|
404
|
+
}
|
|
405
|
+
pendengar.forEach((l) => l());
|
|
406
|
+
return sekarang;
|
|
407
|
+
}
|
|
408
|
+
function usePlatform() {
|
|
409
|
+
return React__namespace.useSyncExternalStore(
|
|
410
|
+
(l) => {
|
|
411
|
+
pendengar.add(l);
|
|
412
|
+
return () => void pendengar.delete(l);
|
|
413
|
+
},
|
|
414
|
+
() => sekarang,
|
|
415
|
+
() => sekarang
|
|
416
|
+
);
|
|
417
|
+
}
|
|
418
|
+
function platformSekarang() {
|
|
419
|
+
return sekarang;
|
|
420
|
+
}
|
|
421
|
+
function Arrow() {
|
|
422
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "14", height: "7", viewBox: "0 0 14 7", "aria-hidden": true, children: [
|
|
423
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { className: "u-arrow-stroke", d: "M0 7 7 0l7 7h-1.4L7 1.4 1.4 7Z" }),
|
|
424
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { className: "u-arrow-fill", d: "M1.4 7 7 1.4 12.6 7Z" })
|
|
425
|
+
] });
|
|
426
|
+
}
|
|
427
|
+
function Dialog({ open, defaultOpen, onOpenChange, trigger, title, description, footer, size = "md", side: sideProp, children, className }) {
|
|
428
|
+
const plat = usePlatform();
|
|
429
|
+
const side = plat.mobile && size !== "full" && sideProp !== "left" ? "bottom" : sideProp;
|
|
430
|
+
const popup = /* @__PURE__ */ jsxRuntime.jsxs(dialog.Dialog.Popup, { className: chunk3O5ELKBH_cjs.cn(side ? "u-sheet" : "u-dialog", className), "data-size": size, "data-side": side, children: [
|
|
431
|
+
side === "bottom" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "u-sheet-grabber", "aria-hidden": true }),
|
|
432
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "u-dialog-header", children: [
|
|
433
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Title, { className: "u-dialog-title", children: title }),
|
|
434
|
+
description && /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Description, { className: "u-dialog-description", children: description })
|
|
435
|
+
] }),
|
|
436
|
+
children && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "u-dialog-body", children }),
|
|
437
|
+
footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "u-dialog-footer", children: footer }),
|
|
438
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Close, { className: "u-dialog-close", "aria-label": "Tutup", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, {}) })
|
|
439
|
+
] });
|
|
440
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(dialog.Dialog.Root, { open, defaultOpen, onOpenChange: (o) => onOpenChange?.(o), children: [
|
|
441
|
+
trigger && /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Trigger, { render: trigger }),
|
|
442
|
+
/* @__PURE__ */ jsxRuntime.jsxs(dialog.Dialog.Portal, { children: [
|
|
443
|
+
/* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Backdrop, { className: "u-backdrop" }),
|
|
444
|
+
side ? popup : /* @__PURE__ */ jsxRuntime.jsx(dialog.Dialog.Viewport, { className: "u-dialog-viewport", children: popup })
|
|
445
|
+
] })
|
|
446
|
+
] });
|
|
447
|
+
}
|
|
448
|
+
var DialogClose = dialog.Dialog.Close;
|
|
449
|
+
function Sheet(props) {
|
|
450
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { side: "right", ...props });
|
|
451
|
+
}
|
|
452
|
+
function ConfirmDialog({ open, onOpenChange, trigger, title, description, confirmLabel, cancelLabel = "Batal", tone = "danger", icon, onConfirm, children }) {
|
|
453
|
+
const [inner, setInner] = React__namespace.useState(false);
|
|
454
|
+
const [busy, setBusy] = React__namespace.useState(false);
|
|
455
|
+
const isOpen = open ?? inner;
|
|
456
|
+
const setOpen = (o) => {
|
|
457
|
+
setInner(o);
|
|
458
|
+
onOpenChange?.(o);
|
|
459
|
+
};
|
|
460
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(alertDialog.AlertDialog.Root, { open: isOpen, onOpenChange: (o) => !busy && setOpen(o), children: [
|
|
461
|
+
trigger && /* @__PURE__ */ jsxRuntime.jsx(alertDialog.AlertDialog.Trigger, { render: trigger }),
|
|
462
|
+
/* @__PURE__ */ jsxRuntime.jsxs(alertDialog.AlertDialog.Portal, { children: [
|
|
463
|
+
/* @__PURE__ */ jsxRuntime.jsx(alertDialog.AlertDialog.Backdrop, { className: "u-backdrop" }),
|
|
464
|
+
/* @__PURE__ */ jsxRuntime.jsx(alertDialog.AlertDialog.Viewport, { className: "u-dialog-viewport", children: /* @__PURE__ */ jsxRuntime.jsxs(alertDialog.AlertDialog.Popup, { className: "u-dialog", "data-size": "sm", children: [
|
|
465
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "u-dialog-header", style: { paddingInlineEnd: "1.25rem" }, children: [
|
|
466
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "u-alert-dialog-icon", "data-tone": tone, children: icon ?? (tone === "primary" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Info, {}) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TriangleAlert, {})) }),
|
|
467
|
+
/* @__PURE__ */ jsxRuntime.jsx(alertDialog.AlertDialog.Title, { className: "u-dialog-title", children: title }),
|
|
468
|
+
description && /* @__PURE__ */ jsxRuntime.jsx(alertDialog.AlertDialog.Description, { className: "u-dialog-description", children: description })
|
|
469
|
+
] }),
|
|
470
|
+
children && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "u-dialog-body", children }),
|
|
471
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "u-dialog-footer", style: children ? void 0 : { marginTop: "1.25rem" }, children: [
|
|
472
|
+
/* @__PURE__ */ jsxRuntime.jsx(alertDialog.AlertDialog.Close, { render: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline", disabled: busy }), children: cancelLabel }),
|
|
473
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
474
|
+
Button,
|
|
475
|
+
{
|
|
476
|
+
variant: tone === "danger" ? "destructive" : "primary",
|
|
477
|
+
loading: busy,
|
|
478
|
+
onClick: async () => {
|
|
479
|
+
setBusy(true);
|
|
480
|
+
try {
|
|
481
|
+
await onConfirm();
|
|
482
|
+
setOpen(false);
|
|
483
|
+
} finally {
|
|
484
|
+
setBusy(false);
|
|
485
|
+
}
|
|
486
|
+
},
|
|
487
|
+
children: confirmLabel
|
|
488
|
+
}
|
|
489
|
+
)
|
|
490
|
+
] })
|
|
491
|
+
] }) })
|
|
492
|
+
] })
|
|
493
|
+
] });
|
|
494
|
+
}
|
|
495
|
+
function Popover({ trigger, title, description, children, side = "bottom", align = "center", width, open, onOpenChange, className, openOnHover }) {
|
|
496
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(popover.Popover.Root, { open, onOpenChange: (o) => onOpenChange?.(o), children: [
|
|
497
|
+
/* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Trigger, { render: trigger, openOnHover }),
|
|
498
|
+
/* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Positioner, { className: "u-popup-positioner", side, align, sideOffset: 8, children: /* @__PURE__ */ jsxRuntime.jsxs(popover.Popover.Popup, { className: chunk3O5ELKBH_cjs.cn("u-popover", className), style: width ? { "--u-popover-w": typeof width === "number" ? `${width}px` : width } : void 0, children: [
|
|
499
|
+
/* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Arrow, { className: "u-popup-arrow", children: /* @__PURE__ */ jsxRuntime.jsx(Arrow, {}) }),
|
|
500
|
+
title && /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Title, { className: "u-popover-title", children: title }),
|
|
501
|
+
description && /* @__PURE__ */ jsxRuntime.jsx(popover.Popover.Description, { className: "u-popover-description", children: description }),
|
|
502
|
+
children
|
|
503
|
+
] }) }) })
|
|
504
|
+
] });
|
|
505
|
+
}
|
|
506
|
+
var TooltipProvider = tooltip.Tooltip.Provider;
|
|
507
|
+
function Tooltip({ content, children, side = "top", shortcut, delay = 300 }) {
|
|
508
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip.Root, { children: [
|
|
509
|
+
/* @__PURE__ */ jsxRuntime.jsx(tooltip.Tooltip.Trigger, { render: children, delay }),
|
|
510
|
+
/* @__PURE__ */ jsxRuntime.jsx(tooltip.Tooltip.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(tooltip.Tooltip.Positioner, { className: "u-popup-positioner", side, sideOffset: 8, children: /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip.Popup, { className: "u-tooltip", children: [
|
|
511
|
+
/* @__PURE__ */ jsxRuntime.jsx(tooltip.Tooltip.Arrow, { className: "u-popup-arrow", children: /* @__PURE__ */ jsxRuntime.jsx(Arrow, {}) }),
|
|
512
|
+
content,
|
|
513
|
+
shortcut && /* @__PURE__ */ jsxRuntime.jsx(Kbd, { children: shortcut })
|
|
514
|
+
] }) }) })
|
|
515
|
+
] });
|
|
516
|
+
}
|
|
517
|
+
function Menu({ trigger, items, align = "end", side = "bottom" }) {
|
|
518
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(menu.Menu.Root, { children: [
|
|
519
|
+
/* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Trigger, { render: trigger }),
|
|
520
|
+
/* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Positioner, { className: "u-popup-positioner", align, side, sideOffset: 6, children: /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Popup, { className: "u-menu", children: items.map((it, i) => {
|
|
521
|
+
if (it.type === "separator") return /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Separator, { className: "u-menu-separator" }, i);
|
|
522
|
+
if (it.type === "label") return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "u-menu-label", children: it.label }, i);
|
|
523
|
+
const inner = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
524
|
+
it.icon,
|
|
525
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: it.label }),
|
|
526
|
+
it.shortcut && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "u-menu-shortcut", children: it.shortcut })
|
|
527
|
+
] });
|
|
528
|
+
return it.href ? /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.LinkItem, { href: it.href, className: "u-menu-item", children: inner }, i) : /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Item, { className: "u-menu-item", onClick: it.onSelect, disabled: it.disabled, "data-variant": it.destructive ? "destructive" : void 0, children: inner }, i);
|
|
529
|
+
}) }) }) })
|
|
530
|
+
] });
|
|
531
|
+
}
|
|
532
|
+
var ICONS = {
|
|
533
|
+
success: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleCheck, {}),
|
|
534
|
+
error: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleAlert, {}),
|
|
535
|
+
warning: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TriangleAlert, {}),
|
|
536
|
+
info: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Info, {})
|
|
537
|
+
};
|
|
538
|
+
function ToastList() {
|
|
539
|
+
const { toasts } = toast.Toast.useToastManager();
|
|
540
|
+
return toasts.map((t) => /* @__PURE__ */ jsxRuntime.jsxs(toast.Toast.Root, { toast: t, className: "u-toast", children: [
|
|
541
|
+
t.type && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "u-toast-icon", "data-type": t.type, children: t.type === "loading" ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: "sm" }) : ICONS[t.type] }),
|
|
542
|
+
/* @__PURE__ */ jsxRuntime.jsxs(toast.Toast.Content, { className: "u-toast-content", children: [
|
|
543
|
+
/* @__PURE__ */ jsxRuntime.jsx(toast.Toast.Title, { className: "u-toast-title" }),
|
|
544
|
+
/* @__PURE__ */ jsxRuntime.jsx(toast.Toast.Description, { className: "u-toast-description" })
|
|
545
|
+
] }),
|
|
546
|
+
/* @__PURE__ */ jsxRuntime.jsx(toast.Toast.Close, { className: "u-toast-close", "aria-label": "Tutup", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, {}) })
|
|
547
|
+
] }, t.id));
|
|
548
|
+
}
|
|
549
|
+
function Toaster({ children, limit = 3, timeout = 5e3 }) {
|
|
550
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(toast.Toast.Provider, { limit, timeout, children: [
|
|
551
|
+
children,
|
|
552
|
+
/* @__PURE__ */ jsxRuntime.jsx(toast.Toast.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(toast.Toast.Viewport, { className: "u-toast-viewport", children: /* @__PURE__ */ jsxRuntime.jsx(ToastList, {}) }) })
|
|
553
|
+
] });
|
|
554
|
+
}
|
|
555
|
+
var useToast = toast.Toast.useToastManager;
|
|
556
|
+
|
|
557
|
+
exports.Badge = Badge;
|
|
558
|
+
exports.Button = Button;
|
|
559
|
+
exports.ButtonGroup = ButtonGroup;
|
|
560
|
+
exports.Checkbox = Checkbox;
|
|
561
|
+
exports.CheckboxGroup = CheckboxGroup;
|
|
562
|
+
exports.Choice = Choice;
|
|
563
|
+
exports.ChoiceCard = ChoiceCard;
|
|
564
|
+
exports.ConfirmDialog = ConfirmDialog;
|
|
565
|
+
exports.Dialog = Dialog;
|
|
566
|
+
exports.DialogClose = DialogClose;
|
|
567
|
+
exports.Field = Field;
|
|
568
|
+
exports.FieldControl = FieldControl;
|
|
569
|
+
exports.FieldDescription = FieldDescription;
|
|
570
|
+
exports.FieldError = FieldError;
|
|
571
|
+
exports.Fieldset = Fieldset;
|
|
572
|
+
exports.Input = Input;
|
|
573
|
+
exports.InputGroup = InputGroup;
|
|
574
|
+
exports.Kbd = Kbd;
|
|
575
|
+
exports.Label = Label;
|
|
576
|
+
exports.Menu = Menu;
|
|
577
|
+
exports.NumberField = NumberField;
|
|
578
|
+
exports.OtpField = OtpField;
|
|
579
|
+
exports.Popover = Popover;
|
|
580
|
+
exports.Radio = Radio;
|
|
581
|
+
exports.RadioGroup = RadioGroup;
|
|
582
|
+
exports.SegmentedControl = SegmentedControl;
|
|
583
|
+
exports.Separator = Separator;
|
|
584
|
+
exports.Sheet = Sheet;
|
|
585
|
+
exports.Skeleton = Skeleton;
|
|
586
|
+
exports.Slider = Slider;
|
|
587
|
+
exports.Spinner = Spinner;
|
|
588
|
+
exports.Switch = Switch;
|
|
589
|
+
exports.Tag = Tag;
|
|
590
|
+
exports.Textarea = Textarea;
|
|
591
|
+
exports.Toaster = Toaster;
|
|
592
|
+
exports.Toggle = Toggle;
|
|
593
|
+
exports.ToggleGroup = ToggleGroup;
|
|
594
|
+
exports.Tooltip = Tooltip;
|
|
595
|
+
exports.TooltipProvider = TooltipProvider;
|
|
596
|
+
exports.VisuallyHidden = VisuallyHidden;
|
|
597
|
+
exports.deteksiPlatform = deteksiPlatform;
|
|
598
|
+
exports.formatBytes = formatBytes;
|
|
599
|
+
exports.formatCompact = formatCompact;
|
|
600
|
+
exports.formatDate = formatDate;
|
|
601
|
+
exports.formatNumber = formatNumber;
|
|
602
|
+
exports.formatPersen = formatPersen;
|
|
603
|
+
exports.formatRelative = formatRelative;
|
|
604
|
+
exports.formatRupiah = formatRupiah;
|
|
605
|
+
exports.formatRupiahRingkas = formatRupiahRingkas;
|
|
606
|
+
exports.formatTime = formatTime;
|
|
607
|
+
exports.hueFromString = hueFromString;
|
|
608
|
+
exports.initials = initials;
|
|
609
|
+
exports.platformSekarang = platformSekarang;
|
|
610
|
+
exports.setelPlatform = setelPlatform;
|
|
611
|
+
exports.usePlatform = usePlatform;
|
|
612
|
+
exports.useToast = useToast;
|
|
613
|
+
//# sourceMappingURL=chunk-BCHB7R6D.cjs.map
|
|
614
|
+
//# sourceMappingURL=chunk-BCHB7R6D.cjs.map
|