@bzync/rui 0.0.3
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/LICENSE +15 -0
- package/README.md +115 -0
- package/dist/autocomplete-CaysJRpk.cjs +1 -0
- package/dist/autocomplete-CfbfpcO4.js +453 -0
- package/dist/calendar-Bnld4G59.cjs +1 -0
- package/dist/calendar-CdICOROs.js +573 -0
- package/dist/charts-CxEy2c3M.js +1248 -0
- package/dist/charts-UDqS1BH1.cjs +1 -0
- package/dist/cn-BdjraxxU.cjs +1 -0
- package/dist/cn-DpgY2leY.js +1736 -0
- package/dist/component-styles-Ce56hn9T.js +16 -0
- package/dist/component-styles-TkZ7v6Ef.cjs +1 -0
- package/dist/components/accordion.cjs +1 -0
- package/dist/components/accordion.d.ts +22 -0
- package/dist/components/accordion.js +122 -0
- package/dist/components/alert.cjs +1 -0
- package/dist/components/alert.d.ts +13 -0
- package/dist/components/alert.js +165 -0
- package/dist/components/auth-backdrop.cjs +1 -0
- package/dist/components/auth-backdrop.d.ts +7 -0
- package/dist/components/auth-backdrop.js +10 -0
- package/dist/components/autocomplete/dropdown.d.ts +21 -0
- package/dist/components/autocomplete/icons.d.ts +8 -0
- package/dist/components/autocomplete/multi-trigger.d.ts +25 -0
- package/dist/components/autocomplete/single-trigger.d.ts +21 -0
- package/dist/components/autocomplete/types.d.ts +34 -0
- package/dist/components/autocomplete.cjs +1 -0
- package/dist/components/autocomplete.d.ts +5 -0
- package/dist/components/autocomplete.js +3 -0
- package/dist/components/avatar.cjs +1 -0
- package/dist/components/avatar.d.ts +17 -0
- package/dist/components/avatar.js +56 -0
- package/dist/components/badge.cjs +1 -0
- package/dist/components/badge.d.ts +12 -0
- package/dist/components/badge.js +32 -0
- package/dist/components/billing-interval-toggle.cjs +1 -0
- package/dist/components/billing-interval-toggle.d.ts +18 -0
- package/dist/components/billing-interval-toggle.js +39 -0
- package/dist/components/breadcrumb.cjs +1 -0
- package/dist/components/breadcrumb.d.ts +11 -0
- package/dist/components/breadcrumb.js +52 -0
- package/dist/components/button.cjs +1 -0
- package/dist/components/button.d.ts +17 -0
- package/dist/components/button.js +90 -0
- package/dist/components/calendar/month-view.d.ts +17 -0
- package/dist/components/calendar/types.d.ts +54 -0
- package/dist/components/calendar/week-view.d.ts +17 -0
- package/dist/components/calendar.cjs +1 -0
- package/dist/components/calendar.d.ts +3 -0
- package/dist/components/calendar.js +3 -0
- package/dist/components/callout.cjs +1 -0
- package/dist/components/callout.d.ts +9 -0
- package/dist/components/callout.js +131 -0
- package/dist/components/card.cjs +1 -0
- package/dist/components/card.d.ts +17 -0
- package/dist/components/card.js +59 -0
- package/dist/components/charts/bar-chart.d.ts +16 -0
- package/dist/components/charts/donut-chart.d.ts +10 -0
- package/dist/components/charts/funnel-chart.d.ts +8 -0
- package/dist/components/charts/gantt-chart.d.ts +15 -0
- package/dist/components/charts/heatmap-chart.d.ts +10 -0
- package/dist/components/charts/index.d.ts +11 -0
- package/dist/components/charts/line-chart.d.ts +16 -0
- package/dist/components/charts/multi-line-chart.d.ts +18 -0
- package/dist/components/charts/radar-chart.d.ts +13 -0
- package/dist/components/charts/scatter-chart.d.ts +24 -0
- package/dist/components/charts/shared.d.ts +15 -0
- package/dist/components/charts/waterfall-chart.d.ts +14 -0
- package/dist/components/charts.cjs +1 -0
- package/dist/components/charts.d.ts +2 -0
- package/dist/components/charts.js +2 -0
- package/dist/components/checkbox.cjs +1 -0
- package/dist/components/checkbox.d.ts +9 -0
- package/dist/components/checkbox.js +135 -0
- package/dist/components/code.cjs +7 -0
- package/dist/components/code.d.ts +23 -0
- package/dist/components/code.js +276 -0
- package/dist/components/command.cjs +1 -0
- package/dist/components/command.d.ts +29 -0
- package/dist/components/command.js +208 -0
- package/dist/components/confirm-dialog.cjs +1 -0
- package/dist/components/confirm-dialog.d.ts +14 -0
- package/dist/components/confirm-dialog.js +69 -0
- package/dist/components/copy-button.cjs +1 -0
- package/dist/components/copy-button.d.ts +8 -0
- package/dist/components/copy-button.js +87 -0
- package/dist/components/datatable/pagination-footer.d.ts +10 -0
- package/dist/components/datatable/rows-dropdown.d.ts +5 -0
- package/dist/components/datatable/skeleton-row.d.ts +3 -0
- package/dist/components/datatable/sort-icon.d.ts +4 -0
- package/dist/components/datatable/types.d.ts +30 -0
- package/dist/components/datatable.cjs +1 -0
- package/dist/components/datatable.d.ts +9 -0
- package/dist/components/datatable.js +3 -0
- package/dist/components/datepicker.cjs +1 -0
- package/dist/components/datepicker.d.ts +14 -0
- package/dist/components/datepicker.js +267 -0
- package/dist/components/drawer.cjs +1 -0
- package/dist/components/drawer.d.ts +18 -0
- package/dist/components/drawer.js +3 -0
- package/dist/components/dropdown-menu.cjs +1 -0
- package/dist/components/dropdown-menu.d.ts +26 -0
- package/dist/components/dropdown-menu.js +122 -0
- package/dist/components/empty-state.cjs +1 -0
- package/dist/components/empty-state.d.ts +10 -0
- package/dist/components/empty-state.js +68 -0
- package/dist/components/error-state.cjs +1 -0
- package/dist/components/error-state.d.ts +10 -0
- package/dist/components/error-state.js +80 -0
- package/dist/components/file-upload.cjs +1 -0
- package/dist/components/file-upload.d.ts +10 -0
- package/dist/components/file-upload.js +173 -0
- package/dist/components/form-field.cjs +1 -0
- package/dist/components/form-field.d.ts +10 -0
- package/dist/components/form-field.js +36 -0
- package/dist/components/info-button.cjs +1 -0
- package/dist/components/info-button.d.ts +4 -0
- package/dist/components/info-button.js +32 -0
- package/dist/components/input.cjs +1 -0
- package/dist/components/input.d.ts +19 -0
- package/dist/components/input.js +117 -0
- package/dist/components/kbd.cjs +1 -0
- package/dist/components/kbd.d.ts +6 -0
- package/dist/components/kbd.js +16 -0
- package/dist/components/label.cjs +1 -0
- package/dist/components/label.d.ts +6 -0
- package/dist/components/label.js +31 -0
- package/dist/components/layout.cjs +1 -0
- package/dist/components/layout.d.ts +51 -0
- package/dist/components/layout.js +117 -0
- package/dist/components/link.cjs +1 -0
- package/dist/components/link.d.ts +9 -0
- package/dist/components/link.js +48 -0
- package/dist/components/list.cjs +1 -0
- package/dist/components/list.d.ts +13 -0
- package/dist/components/list.js +46 -0
- package/dist/components/modal.cjs +1 -0
- package/dist/components/modal.d.ts +31 -0
- package/dist/components/modal.js +219 -0
- package/dist/components/navigation.cjs +1 -0
- package/dist/components/navigation.d.ts +42 -0
- package/dist/components/navigation.js +127 -0
- package/dist/components/number-input.cjs +1 -0
- package/dist/components/number-input.d.ts +16 -0
- package/dist/components/number-input.js +142 -0
- package/dist/components/otp-input.cjs +1 -0
- package/dist/components/otp-input.d.ts +13 -0
- package/dist/components/otp-input.js +71 -0
- package/dist/components/pagination.cjs +1 -0
- package/dist/components/pagination.d.ts +8 -0
- package/dist/components/pagination.js +77 -0
- package/dist/components/popover.cjs +1 -0
- package/dist/components/popover.d.ts +16 -0
- package/dist/components/popover.js +115 -0
- package/dist/components/progressbar.cjs +1 -0
- package/dist/components/progressbar.d.ts +15 -0
- package/dist/components/progressbar.js +108 -0
- package/dist/components/radio.cjs +1 -0
- package/dist/components/radio.d.ts +22 -0
- package/dist/components/radio.js +96 -0
- package/dist/components/richtext.cjs +1 -0
- package/dist/components/richtext.d.ts +10 -0
- package/dist/components/richtext.js +370 -0
- package/dist/components/select/option-list.d.ts +16 -0
- package/dist/components/select/select-multi.d.ts +2 -0
- package/dist/components/select/select-single.d.ts +2 -0
- package/dist/components/select/types.d.ts +54 -0
- package/dist/components/select/utils.d.ts +10 -0
- package/dist/components/select.cjs +1 -0
- package/dist/components/select.d.ts +3 -0
- package/dist/components/select.js +2 -0
- package/dist/components/seo.cjs +1 -0
- package/dist/components/seo.d.ts +45 -0
- package/dist/components/seo.js +64 -0
- package/dist/components/separator.cjs +1 -0
- package/dist/components/separator.d.ts +6 -0
- package/dist/components/separator.js +25 -0
- package/dist/components/skeleton.cjs +1 -0
- package/dist/components/skeleton.d.ts +37 -0
- package/dist/components/skeleton.js +146 -0
- package/dist/components/slider.cjs +1 -0
- package/dist/components/slider.d.ts +12 -0
- package/dist/components/slider.js +72 -0
- package/dist/components/snackbar.cjs +1 -0
- package/dist/components/snackbar.d.ts +35 -0
- package/dist/components/snackbar.js +220 -0
- package/dist/components/spinner.cjs +1 -0
- package/dist/components/spinner.d.ts +7 -0
- package/dist/components/spinner.js +31 -0
- package/dist/components/stat.cjs +1 -0
- package/dist/components/stat.d.ts +18 -0
- package/dist/components/stat.js +90 -0
- package/dist/components/status-dot.cjs +1 -0
- package/dist/components/status-dot.d.ts +10 -0
- package/dist/components/status-dot.js +29 -0
- package/dist/components/stepper.cjs +1 -0
- package/dist/components/stepper.d.ts +11 -0
- package/dist/components/stepper.js +67 -0
- package/dist/components/switch.cjs +1 -0
- package/dist/components/switch.d.ts +8 -0
- package/dist/components/switch.js +79 -0
- package/dist/components/table.cjs +1 -0
- package/dist/components/table.d.ts +12 -0
- package/dist/components/table.js +54 -0
- package/dist/components/tabs.cjs +1 -0
- package/dist/components/tabs.d.ts +22 -0
- package/dist/components/tabs.js +120 -0
- package/dist/components/tag.cjs +1 -0
- package/dist/components/tag.d.ts +12 -0
- package/dist/components/tag.js +58 -0
- package/dist/components/terminal/fs.d.ts +10 -0
- package/dist/components/terminal/shell-commands-sim.d.ts +5 -0
- package/dist/components/terminal/shell-commands.d.ts +16 -0
- package/dist/components/terminal/shell-run.d.ts +11 -0
- package/dist/components/terminal/terminal-block.d.ts +13 -0
- package/dist/components/terminal/terminal-emulator.d.ts +10 -0
- package/dist/components/terminal/types.d.ts +35 -0
- package/dist/components/terminal.cjs +1 -0
- package/dist/components/terminal.d.ts +2 -0
- package/dist/components/terminal.js +2 -0
- package/dist/components/textarea.cjs +1 -0
- package/dist/components/textarea.d.ts +13 -0
- package/dist/components/textarea.js +54 -0
- package/dist/components/theme-provider.cjs +1 -0
- package/dist/components/theme-provider.d.ts +89 -0
- package/dist/components/theme-provider.js +93 -0
- package/dist/components/theme-toggle.cjs +1 -0
- package/dist/components/theme-toggle.d.ts +9 -0
- package/dist/components/theme-toggle.js +4 -0
- package/dist/components/timeline.cjs +1 -0
- package/dist/components/timeline.d.ts +14 -0
- package/dist/components/timeline.js +54 -0
- package/dist/components/tooltip.cjs +1 -0
- package/dist/components/tooltip.d.ts +11 -0
- package/dist/components/tooltip.js +84 -0
- package/dist/components/tree.cjs +1 -0
- package/dist/components/tree.d.ts +16 -0
- package/dist/components/tree.js +92 -0
- package/dist/createLucideIcon-DDY8HuQR.js +42 -0
- package/dist/createLucideIcon-b_X_3fj-.cjs +1 -0
- package/dist/datatable-BB3v__r5.cjs +1 -0
- package/dist/datatable-DlBhUhuO.js +316 -0
- package/dist/drawer-Cbuh6qdL.cjs +1 -0
- package/dist/drawer-CqkVZT9Y.js +189 -0
- package/dist/focus-Dk1YWVPN.js +42 -0
- package/dist/focus-DmG6Ge7X.cjs +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +70 -0
- package/dist/index.js +215 -0
- package/dist/lib/cn.d.ts +2 -0
- package/dist/lib/component-styles.d.ts +10 -0
- package/dist/select-Ch5fp1GT.js +461 -0
- package/dist/select-q0YCMhBP.cjs +1 -0
- package/dist/styles.css +3 -0
- package/dist/terminal-BOR2cFi1.js +1060 -0
- package/dist/terminal-CpraMs50.cjs +77 -0
- package/dist/theme-toggle-CnoiorKV.js +71 -0
- package/dist/theme-toggle-Dp1-24zH.cjs +1 -0
- package/dist/use-event-callback-DGkfO_uu.js +10 -0
- package/dist/use-event-callback-Du9_9eAi.cjs +1 -0
- package/dist/utils-CQ8pvCtk.js +72 -0
- package/dist/utils-DOFJTw8o.cjs +1 -0
- package/package.json +88 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/tag.tsx
|
|
5
|
+
var r = {
|
|
6
|
+
default: "bg-black/8 dark:bg-white/8 text-slate-700 dark:text-slate-200 border-black/12 dark:border-white/12",
|
|
7
|
+
success: "bg-emerald-500/12 text-emerald-400 border-emerald-500/20",
|
|
8
|
+
warning: "bg-amber-500/12 text-amber-400 border-amber-500/20",
|
|
9
|
+
error: "bg-red-500/12 text-red-400 border-red-500/20",
|
|
10
|
+
info: "bg-sky-500/12 text-sky-400 border-sky-500/20"
|
|
11
|
+
}, i = {
|
|
12
|
+
default: "text-slate-500 hover:text-slate-700 dark:hover:text-slate-200",
|
|
13
|
+
success: "text-emerald-400 hover:text-emerald-300",
|
|
14
|
+
warning: "text-amber-400 hover:text-amber-300",
|
|
15
|
+
error: "text-red-400 hover:text-red-300",
|
|
16
|
+
info: "text-sky-400 hover:text-sky-300"
|
|
17
|
+
}, a = {
|
|
18
|
+
sm: "px-2 py-0.5 text-xs gap-1 rounded-md",
|
|
19
|
+
md: "px-2.5 py-1 text-xs gap-1.5 rounded-lg"
|
|
20
|
+
};
|
|
21
|
+
function o({ variant: o = "default", size: s = "md", onRemove: c, icon: l, disabled: u, className: d, children: f, ...p }) {
|
|
22
|
+
return /* @__PURE__ */ n("span", {
|
|
23
|
+
className: e("inline-flex items-center font-medium border transition-colors", r[o], a[s], u && "opacity-50", d),
|
|
24
|
+
...p,
|
|
25
|
+
children: [
|
|
26
|
+
l && /* @__PURE__ */ t("span", {
|
|
27
|
+
className: "shrink-0 w-3 h-3 flex items-center justify-center",
|
|
28
|
+
children: l
|
|
29
|
+
}),
|
|
30
|
+
/* @__PURE__ */ t("span", {
|
|
31
|
+
className: "truncate",
|
|
32
|
+
children: f
|
|
33
|
+
}),
|
|
34
|
+
c && !u && /* @__PURE__ */ t("button", {
|
|
35
|
+
type: "button",
|
|
36
|
+
tabIndex: -1,
|
|
37
|
+
onClick: (e) => {
|
|
38
|
+
e.stopPropagation(), c();
|
|
39
|
+
},
|
|
40
|
+
className: e("shrink-0 ml-0.5 transition-colors cursor-pointer", i[o]),
|
|
41
|
+
"aria-label": `Remove${typeof f == "string" ? ` ${f}` : ""}`,
|
|
42
|
+
children: /* @__PURE__ */ t("svg", {
|
|
43
|
+
width: "10",
|
|
44
|
+
height: "10",
|
|
45
|
+
viewBox: "0 0 24 24",
|
|
46
|
+
fill: "none",
|
|
47
|
+
stroke: "currentColor",
|
|
48
|
+
strokeWidth: "3",
|
|
49
|
+
strokeLinecap: "round",
|
|
50
|
+
strokeLinejoin: "round",
|
|
51
|
+
children: /* @__PURE__ */ t("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
52
|
+
})
|
|
53
|
+
})
|
|
54
|
+
]
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
export { o as Tag };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FSDir, FSEntry, FSFile, ShellState } from './types';
|
|
2
|
+
export declare function mkfile(content: string, executable?: boolean): FSFile;
|
|
3
|
+
export declare function mkdir(children?: Record<string, FSEntry>): FSDir;
|
|
4
|
+
export declare function buildFS(): FSDir;
|
|
5
|
+
export declare function pathJoin(...parts: string[]): string;
|
|
6
|
+
export declare function pathParts(p: string): string[];
|
|
7
|
+
export declare function resolve(s: ShellState, p: string): string;
|
|
8
|
+
export declare function getEntry(root: FSDir, path: string): FSEntry | null;
|
|
9
|
+
export declare function getParent(root: FSDir, path: string): [FSDir, string] | null;
|
|
10
|
+
export declare function cwdStr(s: ShellState): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CmdResult, ShellState } from './types';
|
|
2
|
+
export declare function cmdGit(s: ShellState, args: string[]): CmdResult;
|
|
3
|
+
export declare function cmdApt(args: string[]): CmdResult;
|
|
4
|
+
export declare function cmdPing(args: string[]): CmdResult;
|
|
5
|
+
export declare function cmdHelp(): CmdResult;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CmdResult, ShellState } from './types';
|
|
2
|
+
export declare function parseArgs(input: string): string[];
|
|
3
|
+
export declare function expandEnv(s: ShellState, str: string): string;
|
|
4
|
+
export declare function err(msg: string): CmdResult;
|
|
5
|
+
export declare function out(...lines: string[]): CmdResult;
|
|
6
|
+
export declare function cmdLs(s: ShellState, args: string[]): CmdResult;
|
|
7
|
+
export declare function cmdCd(s: ShellState, args: string[]): CmdResult;
|
|
8
|
+
export declare function cmdCat(s: ShellState, args: string[]): CmdResult;
|
|
9
|
+
export declare function cmdMkdir(s: ShellState, args: string[]): CmdResult;
|
|
10
|
+
export declare function cmdTouch(s: ShellState, args: string[]): CmdResult;
|
|
11
|
+
export declare function cmdRm(s: ShellState, args: string[]): CmdResult;
|
|
12
|
+
export declare function cmdCpMv(s: ShellState, args: string[], move: boolean): CmdResult;
|
|
13
|
+
export declare function cmdGrep(s: ShellState, args: string[]): CmdResult;
|
|
14
|
+
export declare function cmdFind(s: ShellState, args: string[]): CmdResult;
|
|
15
|
+
export declare function cmdWc(s: ShellState, args: string[]): CmdResult;
|
|
16
|
+
export declare function cmdHeadTail(s: ShellState, args: string[], tail: boolean): CmdResult;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OutLine, ShellState, Span } from './types';
|
|
2
|
+
export declare function run(s: ShellState, raw: string): {
|
|
3
|
+
lines: OutLine[];
|
|
4
|
+
next: ShellState;
|
|
5
|
+
clear?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare function tabComplete(s: ShellState, input: string): {
|
|
8
|
+
value: string;
|
|
9
|
+
completions: string[];
|
|
10
|
+
};
|
|
11
|
+
export declare function promptSpans(s: ShellState): Span[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type TerminalLineType = "command" | "output" | "error" | "success" | "info" | "muted";
|
|
2
|
+
export interface TerminalLine {
|
|
3
|
+
type?: TerminalLineType;
|
|
4
|
+
text: string;
|
|
5
|
+
prompt?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface TerminalBlockProps {
|
|
8
|
+
lines: TerminalLine[];
|
|
9
|
+
title?: string;
|
|
10
|
+
prompt?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function TerminalBlock({ lines, title, prompt, className }: TerminalBlockProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TerminalLine } from './terminal-block';
|
|
2
|
+
export interface TerminalEmulatorProps {
|
|
3
|
+
title?: string;
|
|
4
|
+
user?: string;
|
|
5
|
+
hostname?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
/** @deprecated use built-in shell — pass initialLines for welcome text */
|
|
8
|
+
initialLines?: TerminalLine[];
|
|
9
|
+
}
|
|
10
|
+
export declare function TerminalEmulator({ title, user, hostname, className }: TerminalEmulatorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface Span {
|
|
2
|
+
text: string;
|
|
3
|
+
cls?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface OutLine {
|
|
6
|
+
spans: Span[];
|
|
7
|
+
}
|
|
8
|
+
export interface FSFile {
|
|
9
|
+
type: "file";
|
|
10
|
+
content: string;
|
|
11
|
+
permissions: string;
|
|
12
|
+
mtime: Date;
|
|
13
|
+
executable?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface FSDir {
|
|
16
|
+
type: "dir";
|
|
17
|
+
children: Map<string, FSEntry>;
|
|
18
|
+
permissions: string;
|
|
19
|
+
mtime: Date;
|
|
20
|
+
}
|
|
21
|
+
export type FSEntry = FSFile | FSDir;
|
|
22
|
+
export interface ShellState {
|
|
23
|
+
root: FSDir;
|
|
24
|
+
cwd: string[];
|
|
25
|
+
env: Record<string, string>;
|
|
26
|
+
history: string[];
|
|
27
|
+
user: string;
|
|
28
|
+
hostname: string;
|
|
29
|
+
startTime: Date;
|
|
30
|
+
}
|
|
31
|
+
export type CmdResult = {
|
|
32
|
+
lines: OutLine[];
|
|
33
|
+
patch?: Partial<ShellState>;
|
|
34
|
+
clear?: boolean;
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../terminal-CpraMs50.cjs");exports.TerminalBlock=e.n,exports.TerminalEmulator=e.t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs"),t=require("../component-styles-TkZ7v6Ef.cjs");let n=require("react"),r=require("react/jsx-runtime");var i={sm:`min-h-[64px] px-2 py-1.5 text-xs`,md:`min-h-[88px] px-3 py-2.5 text-sm`,lg:`min-h-[120px] px-4 py-3 text-sm`},a=(0,n.forwardRef)(({className:a,wrapperClassName:o,labelClassName:s,messageClassName:c,label:l,hint:u,error:d,size:f=`md`,id:p,autoComplete:m=`on`,required:h,...g},_)=>{let v=(0,n.useId)(),y=p??v,b=`${y}-message`;return(0,r.jsxs)(`div`,{className:e.t(t.o,o),children:[l&&(0,r.jsxs)(`label`,{htmlFor:y,className:e.t(`text-sm font-medium leading-5 text-foreground`,s),children:[l,h&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`span`,{"aria-hidden":`true`,className:`ml-1 text-destructive`,children:`*`}),(0,r.jsx)(`span`,{className:`sr-only`,children:` (required)`})]})]}),(0,r.jsx)(`textarea`,{ref:_,id:y,required:h,"aria-invalid":d?!0:void 0,"aria-describedby":d||u?b:void 0,autoComplete:m,className:e.t(`w-full rounded-[var(--radius-md)] text-foreground placeholder:text-muted-foreground outline-none resize-y`,t.t,i[f],`focus:border-accent-500 focus:ring-2 focus:ring-focus-ring/20`,d&&`border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/20`,`disabled:cursor-not-allowed disabled:opacity-50`,a),...g}),d&&(0,r.jsx)(`p`,{id:b,"aria-live":`polite`,className:e.t(`text-xs leading-5 text-destructive`,c),children:d}),u&&!d&&(0,r.jsx)(`p`,{id:b,className:e.t(`text-xs leading-5 text-muted-foreground`,c),children:u})]})});a.displayName=`Textarea`,exports.Textarea=a;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TextareaHTMLAttributes } from 'react';
|
|
2
|
+
type TextareaSize = "sm" | "md" | "lg";
|
|
3
|
+
export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
4
|
+
label?: string;
|
|
5
|
+
hint?: string;
|
|
6
|
+
error?: string;
|
|
7
|
+
size?: TextareaSize;
|
|
8
|
+
wrapperClassName?: string;
|
|
9
|
+
labelClassName?: string;
|
|
10
|
+
messageClassName?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const Textarea: import('react').ForwardRefExoticComponent<TextareaProps & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
+
import { o as t, t as n } from "../component-styles-Ce56hn9T.js";
|
|
4
|
+
import { forwardRef as r, useId as i } from "react";
|
|
5
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/textarea.tsx
|
|
7
|
+
var c = {
|
|
8
|
+
sm: "min-h-[64px] px-2 py-1.5 text-xs",
|
|
9
|
+
md: "min-h-[88px] px-3 py-2.5 text-sm",
|
|
10
|
+
lg: "min-h-[120px] px-4 py-3 text-sm"
|
|
11
|
+
}, l = r(({ className: r, wrapperClassName: l, labelClassName: u, messageClassName: d, label: f, hint: p, error: m, size: h = "md", id: g, autoComplete: _ = "on", required: v, ...y }, b) => {
|
|
12
|
+
let x = i(), S = g ?? x, C = `${S}-message`;
|
|
13
|
+
return /* @__PURE__ */ s("div", {
|
|
14
|
+
className: e(t, l),
|
|
15
|
+
children: [
|
|
16
|
+
f && /* @__PURE__ */ s("label", {
|
|
17
|
+
htmlFor: S,
|
|
18
|
+
className: e("text-sm font-medium leading-5 text-foreground", u),
|
|
19
|
+
children: [f, v && /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("span", {
|
|
20
|
+
"aria-hidden": "true",
|
|
21
|
+
className: "ml-1 text-destructive",
|
|
22
|
+
children: "*"
|
|
23
|
+
}), /* @__PURE__ */ o("span", {
|
|
24
|
+
className: "sr-only",
|
|
25
|
+
children: " (required)"
|
|
26
|
+
})] })]
|
|
27
|
+
}),
|
|
28
|
+
/* @__PURE__ */ o("textarea", {
|
|
29
|
+
ref: b,
|
|
30
|
+
id: S,
|
|
31
|
+
required: v,
|
|
32
|
+
"aria-invalid": m ? !0 : void 0,
|
|
33
|
+
"aria-describedby": m || p ? C : void 0,
|
|
34
|
+
autoComplete: _,
|
|
35
|
+
className: e("w-full rounded-[var(--radius-md)] text-foreground placeholder:text-muted-foreground outline-none resize-y", n, c[h], "focus:border-accent-500 focus:ring-2 focus:ring-focus-ring/20", m && "border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/20", "disabled:cursor-not-allowed disabled:opacity-50", r),
|
|
36
|
+
...y
|
|
37
|
+
}),
|
|
38
|
+
m && /* @__PURE__ */ o("p", {
|
|
39
|
+
id: C,
|
|
40
|
+
"aria-live": "polite",
|
|
41
|
+
className: e("text-xs leading-5 text-destructive", d),
|
|
42
|
+
children: m
|
|
43
|
+
}),
|
|
44
|
+
p && !m && /* @__PURE__ */ o("p", {
|
|
45
|
+
id: C,
|
|
46
|
+
className: e("text-xs leading-5 text-muted-foreground", d),
|
|
47
|
+
children: p
|
|
48
|
+
})
|
|
49
|
+
]
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
l.displayName = "Textarea";
|
|
53
|
+
//#endregion
|
|
54
|
+
export { l as Textarea };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");let t=require("react"),n=require("react/jsx-runtime");var r=(0,t.createContext)(null);function i(){return typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}function a(...e){let t={};for(let n of e)if(n){for(let[e,r]of Object.entries(n.accent??{}))t[`--color-blue-${e}`]=r,t[`--color-accent-${e}`]=r;for(let[e,r]of Object.entries(n.neutral??{}))t[`--color-slate-${e}`]=r,t[`--color-gray-${e}`]=r;if(n.colors&&(n.colors.bg!==void 0&&(t[`--color-bg`]=n.colors.bg),n.colors.surface!==void 0&&(t[`--color-surface`]=n.colors.surface),n.colors.surfaceRaised!==void 0&&(t[`--color-surface-raised`]=n.colors.surfaceRaised),n.colors.surfaceMuted!==void 0&&(t[`--color-surface-muted`]=n.colors.surfaceMuted),n.colors.border!==void 0&&(t[`--color-border`]=n.colors.border),n.colors.borderStrong!==void 0&&(t[`--color-border-strong`]=n.colors.borderStrong),n.colors.text!==void 0&&(t[`--color-text`]=n.colors.text,t[`--color-foreground`]=n.colors.text),n.colors.muted!==void 0&&(t[`--color-muted`]=n.colors.muted),n.colors.mutedForeground!==void 0&&(t[`--color-muted-foreground`]=n.colors.mutedForeground),n.colors.primary!==void 0&&(t[`--color-primary`]=n.colors.primary),n.colors.primaryHover!==void 0&&(t[`--color-primary-hover`]=n.colors.primaryHover),n.colors.primaryForeground!==void 0&&(t[`--color-primary-foreground`]=n.colors.primaryForeground),n.colors.danger!==void 0&&(t[`--color-danger`]=n.colors.danger,t[`--color-destructive`]=n.colors.danger),n.colors.dangerForeground!==void 0&&(t[`--color-destructive-foreground`]=n.colors.dangerForeground),n.colors.success!==void 0&&(t[`--color-success`]=n.colors.success),n.colors.warning!==void 0&&(t[`--color-warning`]=n.colors.warning),n.colors.info!==void 0&&(t[`--color-info`]=n.colors.info),n.colors.focusRing!==void 0&&(t[`--color-focus-ring`]=n.colors.focusRing)),n.radius)for(let[e,r]of Object.entries(n.radius))t[`--radius-${e}`]=r;if(n.fonts&&(n.fonts.sans!==void 0&&(t[`--font-sans`]=n.fonts.sans,t[`--rui-font-family`]=n.fonts.sans,t[`--rtui-font-family`]=n.fonts.sans),n.fonts.mono!==void 0&&(t[`--font-mono`]=n.fonts.mono),n.fonts.display!==void 0&&(t[`--font-display`]=n.fonts.display,t[`--rui-heading-family`]=n.fonts.display,t[`--rtui-heading-family`]=n.fonts.display),n.fonts.heading!==void 0&&(t[`--rui-heading-family`]=n.fonts.heading,t[`--rtui-heading-family`]=n.fonts.heading)),n.spacing)for(let[e,r]of Object.entries(n.spacing))t[`--spacing-${e}`]=r,t[`--padding-${e}`]=r;if(n.shadows)for(let[e,r]of Object.entries(n.shadows))t[`--shadow-${e}`]=r;Object.assign(t,n.tokens)}return t}function o({children:o,defaultTheme:s=`system`,theme:c,onThemeChange:l,storageKey:u=`rui-theme`,palette:d,lightPalette:f,darkPalette:p,applyToRoot:m=!1,className:h,style:g,..._}){let[v,y]=(0,t.useState)(()=>{if(c||!u||typeof window>`u`)return s;let e=window.localStorage.getItem(u)??(u===`rui-theme`?window.localStorage.getItem(`rtui-theme`):null);return e===`light`||e===`dark`||e===`system`?e:s}),[b,x]=(0,t.useState)(i),S=c??v,C=S===`system`?b:S;(0,t.useEffect)(()=>{let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>x(e.matches?`dark`:`light`);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let w=(0,t.useCallback)(e=>{c||y(e),u&&window.localStorage.setItem(u,e),l?.(e)},[c,l,u]),T=(0,t.useCallback)(()=>{w(C===`dark`?`light`:`dark`)},[C,w]),E=(0,t.useMemo)(()=>({theme:S,resolvedTheme:C,setTheme:w,toggleTheme:T}),[C,w,S,T]),D=(0,t.useMemo)(()=>a(d,C===`dark`?p:f),[p,f,d,C]),O={...D,...g};return(0,t.useEffect)(()=>{if(!m)return;let e=document.documentElement,t=e.classList.contains(`dark`),n=e.classList.contains(`rui-theme`),r=e.classList.contains(`rtui-theme`),i=e.dataset.theme,a=e.style.colorScheme,o=Object.keys(D).map(t=>[t,e.style.getPropertyValue(t)]);e.classList.toggle(`dark`,C===`dark`),e.classList.add(`rui-theme`,`rtui-theme`),e.dataset.theme=C,e.style.colorScheme=C;for(let[t,n]of Object.entries(D))e.style.setProperty(t,String(n));return()=>{e.classList.toggle(`dark`,t),e.classList.toggle(`rui-theme`,n),e.classList.toggle(`rtui-theme`,r),i===void 0?delete e.dataset.theme:e.dataset.theme=i,e.style.colorScheme=a;for(let[t,n]of o)n?e.style.setProperty(t,n):e.style.removeProperty(t)}},[m,D,C]),(0,n.jsx)(r.Provider,{value:E,children:(0,n.jsx)(`div`,{"data-theme":C,"data-theme-preference":S,className:e.t(`rui-theme rtui-theme`,C===`dark`&&`dark`,h),style:{colorScheme:C,...O},..._,children:o})})}function s(){let e=(0,t.useContext)(r);if(!e)throw Error(`useTheme must be used inside a ThemeProvider`);return e}exports.ThemeProvider=o,exports.useTheme=s;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type Theme = "light" | "dark" | "system";
|
|
3
|
+
export type ResolvedTheme = Exclude<Theme, "system">;
|
|
4
|
+
export type ColorShade = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 950;
|
|
5
|
+
export type ColorPalette = Partial<Record<ColorShade, string>>;
|
|
6
|
+
export type ThemeTokens = Partial<Record<`--${string}`, string | number>>;
|
|
7
|
+
/** Radius scale — maps to --radius-* */
|
|
8
|
+
export type ThemeRadius = Partial<Record<"sm" | "md" | "lg" | "xl" | "2xl" | "full", string>>;
|
|
9
|
+
/** Font families — maps to --font-* and scoped rui font variables. */
|
|
10
|
+
export interface ThemeFonts {
|
|
11
|
+
/** Main sans stack -> --font-sans & --rui-font-family */
|
|
12
|
+
sans?: string;
|
|
13
|
+
/** Monospace stack -> --font-mono */
|
|
14
|
+
mono?: string;
|
|
15
|
+
/** Display/heading stack -> --font-display & --rui-heading-family */
|
|
16
|
+
display?: string;
|
|
17
|
+
/** Explicit heading override -> --rui-heading-family */
|
|
18
|
+
heading?: string;
|
|
19
|
+
}
|
|
20
|
+
/** Spacing / padding scale — keys become --spacing-* and --padding-* */
|
|
21
|
+
export type ThemeSpacing = Record<string, string>;
|
|
22
|
+
/** Shadow scale — maps to --shadow-* */
|
|
23
|
+
export type ThemeShadows = Partial<Record<"xs" | "sm" | "md" | "lg" | "xl" | "2xl", string>>;
|
|
24
|
+
/** Semantic surface colors */
|
|
25
|
+
export interface ThemeColors {
|
|
26
|
+
bg?: string;
|
|
27
|
+
surface?: string;
|
|
28
|
+
surfaceRaised?: string;
|
|
29
|
+
surfaceMuted?: string;
|
|
30
|
+
border?: string;
|
|
31
|
+
borderStrong?: string;
|
|
32
|
+
text?: string;
|
|
33
|
+
muted?: string;
|
|
34
|
+
mutedForeground?: string;
|
|
35
|
+
primary?: string;
|
|
36
|
+
primaryHover?: string;
|
|
37
|
+
primaryForeground?: string;
|
|
38
|
+
danger?: string;
|
|
39
|
+
dangerForeground?: string;
|
|
40
|
+
success?: string;
|
|
41
|
+
warning?: string;
|
|
42
|
+
info?: string;
|
|
43
|
+
focusRing?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface ThemePalette {
|
|
46
|
+
/** Replaces the blue scale used for primary actions, focus rings, and selected states. */
|
|
47
|
+
accent?: ColorPalette;
|
|
48
|
+
/** Replaces both the slate and gray scales used by text, borders, and neutral surfaces. */
|
|
49
|
+
neutral?: ColorPalette;
|
|
50
|
+
/** Semantic colors (bg, surface, border, etc.) -> --color-* */
|
|
51
|
+
colors?: ThemeColors;
|
|
52
|
+
/** Border radii -> --radius-* */
|
|
53
|
+
radius?: ThemeRadius;
|
|
54
|
+
/** Font stacks -> --font-* / --rui-* */
|
|
55
|
+
fonts?: ThemeFonts;
|
|
56
|
+
/** Spacing / padding -> --spacing-* & --padding-* */
|
|
57
|
+
spacing?: ThemeSpacing;
|
|
58
|
+
/** Shadows -> --shadow-* */
|
|
59
|
+
shadows?: ThemeShadows;
|
|
60
|
+
/** Arbitrary CSS custom properties, such as `--color-bg` or `--radius-lg`. Escape hatch for anything not covered above. */
|
|
61
|
+
tokens?: ThemeTokens;
|
|
62
|
+
}
|
|
63
|
+
interface ThemeContextValue {
|
|
64
|
+
theme: Theme;
|
|
65
|
+
resolvedTheme: ResolvedTheme;
|
|
66
|
+
setTheme: (theme: Theme) => void;
|
|
67
|
+
toggleTheme: () => void;
|
|
68
|
+
}
|
|
69
|
+
export interface ThemeProviderProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "onChange"> {
|
|
70
|
+
children: ReactNode;
|
|
71
|
+
/** Initial theme when the provider is uncontrolled. */
|
|
72
|
+
defaultTheme?: Theme;
|
|
73
|
+
/** Controlled theme value. */
|
|
74
|
+
theme?: Theme;
|
|
75
|
+
onThemeChange?: (theme: Theme) => void;
|
|
76
|
+
/** localStorage key. Set to false to disable persistence. */
|
|
77
|
+
storageKey?: string | false;
|
|
78
|
+
/** Theme-independent colors and tokens. */
|
|
79
|
+
palette?: ThemePalette;
|
|
80
|
+
/** Overrides only active in light mode. */
|
|
81
|
+
lightPalette?: ThemePalette;
|
|
82
|
+
/** Overrides only active in dark mode. */
|
|
83
|
+
darkPalette?: ThemePalette;
|
|
84
|
+
/** Also sync the theme class to `<html>`, useful for portals and document backgrounds. */
|
|
85
|
+
applyToRoot?: boolean;
|
|
86
|
+
}
|
|
87
|
+
export declare function ThemeProvider({ children, defaultTheme, theme: controlledTheme, onThemeChange, storageKey, palette, lightPalette, darkPalette, applyToRoot, className, style, ...props }: ThemeProviderProps): import("react").JSX.Element;
|
|
88
|
+
export declare function useTheme(): ThemeContextValue;
|
|
89
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "../cn-DpgY2leY.js";
|
|
3
|
+
import { createContext as t, useCallback as n, useContext as r, useEffect as i, useMemo as a, useState as o } from "react";
|
|
4
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/theme-provider.tsx
|
|
6
|
+
var c = t(null);
|
|
7
|
+
function l() {
|
|
8
|
+
return typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
9
|
+
}
|
|
10
|
+
function u(...e) {
|
|
11
|
+
let t = {};
|
|
12
|
+
for (let n of e) if (n) {
|
|
13
|
+
for (let [e, r] of Object.entries(n.accent ?? {})) t[`--color-blue-${e}`] = r, t[`--color-accent-${e}`] = r;
|
|
14
|
+
for (let [e, r] of Object.entries(n.neutral ?? {})) t[`--color-slate-${e}`] = r, t[`--color-gray-${e}`] = r;
|
|
15
|
+
if (n.colors && (n.colors.bg !== void 0 && (t["--color-bg"] = n.colors.bg), n.colors.surface !== void 0 && (t["--color-surface"] = n.colors.surface), n.colors.surfaceRaised !== void 0 && (t["--color-surface-raised"] = n.colors.surfaceRaised), n.colors.surfaceMuted !== void 0 && (t["--color-surface-muted"] = n.colors.surfaceMuted), n.colors.border !== void 0 && (t["--color-border"] = n.colors.border), n.colors.borderStrong !== void 0 && (t["--color-border-strong"] = n.colors.borderStrong), n.colors.text !== void 0 && (t["--color-text"] = n.colors.text, t["--color-foreground"] = n.colors.text), n.colors.muted !== void 0 && (t["--color-muted"] = n.colors.muted), n.colors.mutedForeground !== void 0 && (t["--color-muted-foreground"] = n.colors.mutedForeground), n.colors.primary !== void 0 && (t["--color-primary"] = n.colors.primary), n.colors.primaryHover !== void 0 && (t["--color-primary-hover"] = n.colors.primaryHover), n.colors.primaryForeground !== void 0 && (t["--color-primary-foreground"] = n.colors.primaryForeground), n.colors.danger !== void 0 && (t["--color-danger"] = n.colors.danger, t["--color-destructive"] = n.colors.danger), n.colors.dangerForeground !== void 0 && (t["--color-destructive-foreground"] = n.colors.dangerForeground), n.colors.success !== void 0 && (t["--color-success"] = n.colors.success), n.colors.warning !== void 0 && (t["--color-warning"] = n.colors.warning), n.colors.info !== void 0 && (t["--color-info"] = n.colors.info), n.colors.focusRing !== void 0 && (t["--color-focus-ring"] = n.colors.focusRing)), n.radius) for (let [e, r] of Object.entries(n.radius)) t[`--radius-${e}`] = r;
|
|
16
|
+
if (n.fonts && (n.fonts.sans !== void 0 && (t["--font-sans"] = n.fonts.sans, t["--rui-font-family"] = n.fonts.sans, t["--rtui-font-family"] = n.fonts.sans), n.fonts.mono !== void 0 && (t["--font-mono"] = n.fonts.mono), n.fonts.display !== void 0 && (t["--font-display"] = n.fonts.display, t["--rui-heading-family"] = n.fonts.display, t["--rtui-heading-family"] = n.fonts.display), n.fonts.heading !== void 0 && (t["--rui-heading-family"] = n.fonts.heading, t["--rtui-heading-family"] = n.fonts.heading)), n.spacing) for (let [e, r] of Object.entries(n.spacing)) t[`--spacing-${e}`] = r, t[`--padding-${e}`] = r;
|
|
17
|
+
if (n.shadows) for (let [e, r] of Object.entries(n.shadows)) t[`--shadow-${e}`] = r;
|
|
18
|
+
Object.assign(t, n.tokens);
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
}
|
|
22
|
+
function d({ children: t, defaultTheme: r = "system", theme: d, onThemeChange: f, storageKey: p = "rui-theme", palette: m, lightPalette: h, darkPalette: g, applyToRoot: _ = !1, className: v, style: y, ...b }) {
|
|
23
|
+
let [x, S] = o(() => {
|
|
24
|
+
if (d || !p || typeof window > "u") return r;
|
|
25
|
+
let e = window.localStorage.getItem(p) ?? (p === "rui-theme" ? window.localStorage.getItem("rtui-theme") : null);
|
|
26
|
+
return e === "light" || e === "dark" || e === "system" ? e : r;
|
|
27
|
+
}), [C, w] = o(l), T = d ?? x, E = T === "system" ? C : T;
|
|
28
|
+
i(() => {
|
|
29
|
+
let e = window.matchMedia("(prefers-color-scheme: dark)"), t = () => w(e.matches ? "dark" : "light");
|
|
30
|
+
return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
31
|
+
}, []);
|
|
32
|
+
let D = n((e) => {
|
|
33
|
+
d || S(e), p && window.localStorage.setItem(p, e), f?.(e);
|
|
34
|
+
}, [
|
|
35
|
+
d,
|
|
36
|
+
f,
|
|
37
|
+
p
|
|
38
|
+
]), O = n(() => {
|
|
39
|
+
D(E === "dark" ? "light" : "dark");
|
|
40
|
+
}, [E, D]), k = a(() => ({
|
|
41
|
+
theme: T,
|
|
42
|
+
resolvedTheme: E,
|
|
43
|
+
setTheme: D,
|
|
44
|
+
toggleTheme: O
|
|
45
|
+
}), [
|
|
46
|
+
E,
|
|
47
|
+
D,
|
|
48
|
+
T,
|
|
49
|
+
O
|
|
50
|
+
]), A = a(() => u(m, E === "dark" ? g : h), [
|
|
51
|
+
g,
|
|
52
|
+
h,
|
|
53
|
+
m,
|
|
54
|
+
E
|
|
55
|
+
]), j = {
|
|
56
|
+
...A,
|
|
57
|
+
...y
|
|
58
|
+
};
|
|
59
|
+
return i(() => {
|
|
60
|
+
if (!_) return;
|
|
61
|
+
let e = document.documentElement, t = e.classList.contains("dark"), n = e.classList.contains("rui-theme"), r = e.classList.contains("rtui-theme"), i = e.dataset.theme, a = e.style.colorScheme, o = Object.keys(A).map((t) => [t, e.style.getPropertyValue(t)]);
|
|
62
|
+
e.classList.toggle("dark", E === "dark"), e.classList.add("rui-theme", "rtui-theme"), e.dataset.theme = E, e.style.colorScheme = E;
|
|
63
|
+
for (let [t, n] of Object.entries(A)) e.style.setProperty(t, String(n));
|
|
64
|
+
return () => {
|
|
65
|
+
e.classList.toggle("dark", t), e.classList.toggle("rui-theme", n), e.classList.toggle("rtui-theme", r), i === void 0 ? delete e.dataset.theme : e.dataset.theme = i, e.style.colorScheme = a;
|
|
66
|
+
for (let [t, n] of o) n ? e.style.setProperty(t, n) : e.style.removeProperty(t);
|
|
67
|
+
};
|
|
68
|
+
}, [
|
|
69
|
+
_,
|
|
70
|
+
A,
|
|
71
|
+
E
|
|
72
|
+
]), /* @__PURE__ */ s(c.Provider, {
|
|
73
|
+
value: k,
|
|
74
|
+
children: /* @__PURE__ */ s("div", {
|
|
75
|
+
"data-theme": E,
|
|
76
|
+
"data-theme-preference": T,
|
|
77
|
+
className: e("rui-theme rtui-theme", E === "dark" && "dark", v),
|
|
78
|
+
style: {
|
|
79
|
+
colorScheme: E,
|
|
80
|
+
...j
|
|
81
|
+
},
|
|
82
|
+
...b,
|
|
83
|
+
children: t
|
|
84
|
+
})
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function f() {
|
|
88
|
+
let e = r(c);
|
|
89
|
+
if (!e) throw Error("useTheme must be used inside a ThemeProvider");
|
|
90
|
+
return e;
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
export { d as ThemeProvider, f as useTheme };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../theme-toggle-Dp1-24zH.cjs");require("./theme-provider.cjs"),exports.ThemeToggle=e.t;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ThemeToggleProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
lightIcon?: ReactNode;
|
|
4
|
+
darkIcon?: ReactNode;
|
|
5
|
+
showLabel?: boolean;
|
|
6
|
+
lightLabel?: string;
|
|
7
|
+
darkLabel?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function ThemeToggle({ lightIcon, darkIcon, showLabel, lightLabel, darkLabel, className, onClick, type, ...props }: ThemeToggleProps): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");let t=require("react/jsx-runtime");var n={default:`bg-slate-400 border-slate-400/30`,success:`bg-emerald-400 border-emerald-400/30`,warning:`bg-amber-400 border-amber-400/30`,error:`bg-red-400 border-red-400/30`,info:`bg-sky-400 border-sky-400/30`},r={default:`bg-slate-500/15 text-slate-400`,success:`bg-emerald-500/15 text-emerald-400`,warning:`bg-amber-500/15 text-amber-400`,error:`bg-red-500/15 text-red-400`,info:`bg-sky-500/15 text-sky-400`};function i({events:i,className:a}){return(0,t.jsx)(`div`,{className:e.t(`flex flex-col`,a),children:i.map((a,o)=>{let s=o===i.length-1,c=a.variant??`default`;return(0,t.jsxs)(`div`,{className:`flex gap-3`,children:[(0,t.jsxs)(`div`,{className:`flex flex-col items-center`,children:[a.icon?(0,t.jsx)(`div`,{className:e.t(`w-8 h-8 rounded-full flex items-center justify-center shrink-0`,r[c]),children:(0,t.jsx)(`span`,{className:`w-4 h-4 flex items-center justify-center`,children:a.icon})}):(0,t.jsx)(`div`,{className:e.t(`w-2.5 h-2.5 rounded-full shrink-0 border-2 mt-1.5`,n[c])}),!s&&(0,t.jsx)(`div`,{className:`flex-1 w-px bg-black/10 dark:bg-white/10 my-1`})]}),(0,t.jsxs)(`div`,{className:e.t(`pb-5 min-w-0`,s&&`pb-0`),children:[(0,t.jsxs)(`div`,{className:`flex items-baseline gap-2 flex-wrap`,children:[(0,t.jsx)(`p`,{className:`text-sm font-medium text-slate-700 dark:text-slate-200`,children:a.title}),a.timestamp&&(0,t.jsx)(`span`,{className:`text-xs text-slate-500`,children:a.timestamp})]}),a.description&&(0,t.jsx)(`p`,{className:`text-sm text-slate-500 mt-0.5`,children:a.description})]})]},a.id)})})}exports.Timeline=i;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface TimelineEvent {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
timestamp?: string;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
variant?: "default" | "success" | "warning" | "error" | "info";
|
|
9
|
+
}
|
|
10
|
+
export interface TimelineProps {
|
|
11
|
+
events: TimelineEvent[];
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function Timeline({ events, className }: TimelineProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { t as e } from "../cn-DpgY2leY.js";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/timeline.tsx
|
|
4
|
+
var r = {
|
|
5
|
+
default: "bg-slate-400 border-slate-400/30",
|
|
6
|
+
success: "bg-emerald-400 border-emerald-400/30",
|
|
7
|
+
warning: "bg-amber-400 border-amber-400/30",
|
|
8
|
+
error: "bg-red-400 border-red-400/30",
|
|
9
|
+
info: "bg-sky-400 border-sky-400/30"
|
|
10
|
+
}, i = {
|
|
11
|
+
default: "bg-slate-500/15 text-slate-400",
|
|
12
|
+
success: "bg-emerald-500/15 text-emerald-400",
|
|
13
|
+
warning: "bg-amber-500/15 text-amber-400",
|
|
14
|
+
error: "bg-red-500/15 text-red-400",
|
|
15
|
+
info: "bg-sky-500/15 text-sky-400"
|
|
16
|
+
};
|
|
17
|
+
function a({ events: a, className: o }) {
|
|
18
|
+
return /* @__PURE__ */ t("div", {
|
|
19
|
+
className: e("flex flex-col", o),
|
|
20
|
+
children: a.map((o, s) => {
|
|
21
|
+
let c = s === a.length - 1, l = o.variant ?? "default";
|
|
22
|
+
return /* @__PURE__ */ n("div", {
|
|
23
|
+
className: "flex gap-3",
|
|
24
|
+
children: [/* @__PURE__ */ n("div", {
|
|
25
|
+
className: "flex flex-col items-center",
|
|
26
|
+
children: [o.icon ? /* @__PURE__ */ t("div", {
|
|
27
|
+
className: e("w-8 h-8 rounded-full flex items-center justify-center shrink-0", i[l]),
|
|
28
|
+
children: /* @__PURE__ */ t("span", {
|
|
29
|
+
className: "w-4 h-4 flex items-center justify-center",
|
|
30
|
+
children: o.icon
|
|
31
|
+
})
|
|
32
|
+
}) : /* @__PURE__ */ t("div", { className: e("w-2.5 h-2.5 rounded-full shrink-0 border-2 mt-1.5", r[l]) }), !c && /* @__PURE__ */ t("div", { className: "flex-1 w-px bg-black/10 dark:bg-white/10 my-1" })]
|
|
33
|
+
}), /* @__PURE__ */ n("div", {
|
|
34
|
+
className: e("pb-5 min-w-0", c && "pb-0"),
|
|
35
|
+
children: [/* @__PURE__ */ n("div", {
|
|
36
|
+
className: "flex items-baseline gap-2 flex-wrap",
|
|
37
|
+
children: [/* @__PURE__ */ t("p", {
|
|
38
|
+
className: "text-sm font-medium text-slate-700 dark:text-slate-200",
|
|
39
|
+
children: o.title
|
|
40
|
+
}), o.timestamp && /* @__PURE__ */ t("span", {
|
|
41
|
+
className: "text-xs text-slate-500",
|
|
42
|
+
children: o.timestamp
|
|
43
|
+
})]
|
|
44
|
+
}), o.description && /* @__PURE__ */ t("p", {
|
|
45
|
+
className: "text-sm text-slate-500 mt-0.5",
|
|
46
|
+
children: o.description
|
|
47
|
+
})]
|
|
48
|
+
})]
|
|
49
|
+
}, o.id);
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { a as Timeline };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-BdjraxxU.cjs");let t=require("framer-motion"),n=require("react"),r=require("react/jsx-runtime");var i={top:{container:`bottom-full left-1/2 -translate-x-1/2 mb-2`,initial:{y:4}},bottom:{container:`top-full left-1/2 -translate-x-1/2 mt-2`,initial:{y:-4}},left:{container:`right-full top-1/2 -translate-y-1/2 mr-2`,initial:{x:4}},right:{container:`left-full top-1/2 -translate-y-1/2 ml-2`,initial:{x:-4}}};function a({content:a,children:o,position:s=`top`,delayMs:c=0,className:l}){let[u,d]=(0,n.useState)(!1),f=(0,n.useRef)(null),p=(0,n.useId)(),{container:m,initial:h}=i[s];function g(){c>0?f.current=setTimeout(()=>d(!0),c):d(!0)}function _(){f.current&&clearTimeout(f.current),d(!1)}(0,n.useEffect)(()=>()=>{f.current&&clearTimeout(f.current)},[]);let v=(0,n.isValidElement)(o)?(0,n.cloneElement)(o,{"aria-describedby":u?p:void 0,onMouseEnter:e=>{o.props.onMouseEnter?.(e),e.defaultPrevented||g()},onMouseLeave:e=>{o.props.onMouseLeave?.(e),_()},onFocus:e=>{o.props.onFocus?.(e),e.defaultPrevented||g()},onBlur:e=>{o.props.onBlur?.(e),_()}}):(0,r.jsx)(`span`,{tabIndex:0,"aria-describedby":u?p:void 0,onMouseEnter:g,onMouseLeave:_,onFocus:g,onBlur:_,children:o});return(0,r.jsxs)(`div`,{className:`relative inline-flex`,children:[v,(0,r.jsx)(t.AnimatePresence,{children:u&&(0,r.jsx)(t.motion.div,{id:p,role:`tooltip`,initial:{opacity:0,...h},animate:{opacity:1,y:0,x:0},exit:{opacity:0,...h},transition:{duration:.12},className:e.t(`absolute z-50 pointer-events-none`,`max-w-[min(20rem,calc(100vw-2rem))] rounded-md px-2.5 py-1.5 text-xs font-medium leading-4`,`border border-slate-700 bg-slate-900 text-slate-50 shadow-floating dark:border-border-strong dark:bg-surface-raised dark:text-foreground`,m,l),children:a})})]})}exports.Tooltip=a;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type Position = "top" | "bottom" | "left" | "right";
|
|
3
|
+
export interface TooltipProps {
|
|
4
|
+
content: ReactNode;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
position?: Position;
|
|
7
|
+
delayMs?: number;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function Tooltip({ content, children, position, delayMs, className, }: TooltipProps): import("react").JSX.Element;
|
|
11
|
+
export {};
|