@processengine/uikit 0.1.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.
@@ -0,0 +1,46 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import JsonView from "@uiw/react-json-view";
3
+ const JSON_EXPLORER_THEME = {
4
+ "--w-rjv-background-color": "transparent",
5
+ "--w-rjv-font-family": "var(--font-mono)",
6
+ "--w-rjv-color": "var(--text-medium)",
7
+ "--w-rjv-line-color": "rgba(29, 31, 53, 0.08)",
8
+ "--w-rjv-arrow-color": "var(--text-faint)",
9
+ "--w-rjv-curlybraces-color": "var(--text-faint)",
10
+ "--w-rjv-brackets-color": "var(--text-faint)",
11
+ "--w-rjv-colon-color": "var(--text-faint)",
12
+ "--w-rjv-quotes-color": "var(--text-faint)",
13
+ "--w-rjv-quotes-string-color": "var(--text-medium)",
14
+ "--w-rjv-ellipsis-color": "var(--text-faint)",
15
+ "--w-rjv-type-string-color": "var(--accent-color)",
16
+ "--w-rjv-type-int-color": "#2563eb",
17
+ "--w-rjv-type-float-color": "#2563eb",
18
+ "--w-rjv-type-bigint-color": "#2563eb",
19
+ "--w-rjv-type-boolean-color": "#7c3aed",
20
+ "--w-rjv-type-date-color": "#0f766e",
21
+ "--w-rjv-type-url-color": "#0369a1",
22
+ "--w-rjv-type-null-color": "var(--text-faint)",
23
+ "--w-rjv-type-nan-color": "#b45309",
24
+ "--w-rjv-type-undefined-color": "var(--text-faint)",
25
+ "--w-rjv-key-string": "var(--text-strong)",
26
+ "--w-rjv-key-number": "var(--text-strong)",
27
+ };
28
+ function shouldExpandPath(defaultExpanded) {
29
+ return (_isExpanded, { keys }) => {
30
+ if (keys.length === 0) {
31
+ return true;
32
+ }
33
+ const path = keys.join(".");
34
+ return defaultExpanded.some((expectedPath) => path === expectedPath ||
35
+ path.startsWith(`${expectedPath}.`) ||
36
+ expectedPath.startsWith(`${path}.`));
37
+ };
38
+ }
39
+ export function JsonExplorer({ data, defaultExpanded = [], collapsed = 2, className, }) {
40
+ if (data == null) {
41
+ return _jsx("p", { className: "app-empty-text", children: "\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445 \u0434\u043B\u044F \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F." });
42
+ }
43
+ return (_jsx("div", { className: className, children: _jsx(JsonView, { value: data, collapsed: collapsed, shouldExpandNodeInitially: defaultExpanded.length > 0
44
+ ? shouldExpandPath(defaultExpanded)
45
+ : undefined, displayDataTypes: false, shortenTextAfterLength: 80, enableClipboard: true, style: JSON_EXPLORER_THEME }) }));
46
+ }
@@ -0,0 +1,9 @@
1
+ type JsonPanelProps = {
2
+ value: unknown;
3
+ emptyMessage?: string;
4
+ defaultExpanded?: string[];
5
+ collapsed?: boolean | number;
6
+ };
7
+ export declare function JsonPanel({ value, emptyMessage, defaultExpanded, collapsed, }: JsonPanelProps): import("react").JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=JsonPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonPanel.d.ts","sourceRoot":"","sources":["../../src/react/JsonPanel.tsx"],"names":[],"mappings":"AAEA,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAC9B,CAAC;AAEF,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,YAA2B,EAC3B,eAAe,EACf,SAAS,GACV,EAAE,cAAc,+BAchB"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { JsonExplorer } from "./JsonExplorer";
3
+ export function JsonPanel({ value, emptyMessage = "Нет данных", defaultExpanded, collapsed, }) {
4
+ if (value == null) {
5
+ return _jsx("p", { className: "app-empty-text", children: emptyMessage });
6
+ }
7
+ return (_jsx("div", { className: "app-json-panel", children: _jsx(JsonExplorer, { data: value, collapsed: collapsed, defaultExpanded: defaultExpanded }) }));
8
+ }
@@ -0,0 +1,10 @@
1
+ import type { ReactNode } from "react";
2
+ type PageHeaderProps = {
3
+ title: string;
4
+ subtitle?: ReactNode;
5
+ eyebrow?: string;
6
+ detail?: boolean;
7
+ };
8
+ export declare function PageHeader({ title, subtitle, eyebrow, detail }: PageHeaderProps): import("react").JSX.Element;
9
+ export {};
10
+ //# sourceMappingURL=PageHeader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageHeader.d.ts","sourceRoot":"","sources":["../../src/react/PageHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,KAAK,eAAe,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,eAAe,+BAU/E"}
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from "./cn";
3
+ export function PageHeader({ title, subtitle, eyebrow, detail }) {
4
+ return (_jsxs("header", { className: cn("app-page-header", detail && "app-page-header--detail"), children: [eyebrow ? _jsx("div", { className: "app-page-header__eyebrow", children: eyebrow }) : null, _jsx("h1", { className: "app-page-header__title", id: "page-title", children: title }), subtitle ? _jsx("div", { className: "app-page-header__subtitle", children: subtitle }) : null] }));
5
+ }
@@ -0,0 +1,10 @@
1
+ type SearchInputProps = {
2
+ label: string;
3
+ name: string;
4
+ placeholder: string;
5
+ value: string;
6
+ onChange: (value: string) => void;
7
+ };
8
+ export declare function SearchInput({ label, name, placeholder, value, onChange, }: SearchInputProps): import("react").JSX.Element;
9
+ export {};
10
+ //# sourceMappingURL=SearchInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchInput.d.ts","sourceRoot":"","sources":["../../src/react/SearchInput.tsx"],"names":[],"mappings":"AAEA,KAAK,gBAAgB,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,IAAI,EACJ,WAAW,EACX,KAAK,EACL,QAAQ,GACT,EAAE,gBAAgB,+BAiClB"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId } from "react";
3
+ export function SearchInput({ label, name, placeholder, value, onChange, }) {
4
+ const inputId = useId();
5
+ return (_jsxs("div", { className: "app-search", children: [_jsx("label", { className: "app-visually-hidden", htmlFor: inputId, children: label }), _jsxs("div", { className: "app-search__field", children: [_jsx("span", { className: "app-search__icon", "aria-hidden": "true", children: _jsxs("svg", { viewBox: "0 0 20 20", fill: "none", children: [_jsx("circle", { cx: "9", cy: "9", r: "5.5", stroke: "currentColor", strokeWidth: "1.5" }), _jsx("path", { d: "M13.5 13.5L17 17", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })] }) }), _jsx("input", { className: "app-search__input", id: inputId, type: "search", name: name, value: value, onChange: (event) => onChange(event.target.value), placeholder: placeholder, autoComplete: "off" })] })] }));
6
+ }
@@ -0,0 +1,9 @@
1
+ type StateCardProps = {
2
+ title: string;
3
+ text: string;
4
+ actionLabel?: string;
5
+ onAction?: () => void;
6
+ };
7
+ export declare function StateCard({ title, text, actionLabel, onAction, }: StateCardProps): import("react").JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=StateCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StateCard.d.ts","sourceRoot":"","sources":["../../src/react/StateCard.tsx"],"names":[],"mappings":"AAAA,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,IAAI,EACJ,WAAW,EACX,QAAQ,GACT,EAAE,cAAc,+BAahB"}
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function StateCard({ title, text, actionLabel, onAction, }) {
3
+ return (_jsxs("div", { className: "app-state-card", children: [_jsx("p", { className: "app-state-card__title", children: title }), _jsx("p", { className: "app-state-card__text", children: text }), actionLabel && onAction ? (_jsx("button", { className: "app-state-card__action", type: "button", onClick: onAction, children: actionLabel })) : null] }));
4
+ }
@@ -0,0 +1,13 @@
1
+ export type TabOption<T extends string> = {
2
+ id: T;
3
+ label: string;
4
+ };
5
+ type TabsProps<T extends string> = {
6
+ activeTab: T;
7
+ tabs: TabOption<T>[];
8
+ ariaLabel: string;
9
+ onChange: (tab: T) => void;
10
+ };
11
+ export declare function Tabs<T extends string>({ activeTab, tabs, ariaLabel, onChange, }: TabsProps<T>): import("react").JSX.Element;
12
+ export {};
13
+ //# sourceMappingURL=Tabs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../src/react/Tabs.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,IAAI;IACxC,EAAE,EAAE,CAAC,CAAC;IACN,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,SAAS,CAAC,CAAC,SAAS,MAAM,IAAI;IACjC,SAAS,EAAE,CAAC,CAAC;IACb,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC;CAC5B,CAAC;AAEF,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,EACrC,SAAS,EACT,IAAI,EACJ,SAAS,EACT,QAAQ,GACT,EAAE,SAAS,CAAC,CAAC,CAAC,+BAqBd"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "./cn";
3
+ export function Tabs({ activeTab, tabs, ariaLabel, onChange, }) {
4
+ return (_jsx("div", { className: "app-tabs", role: "tablist", "aria-label": ariaLabel, children: tabs.map((tab) => {
5
+ const isActive = tab.id === activeTab;
6
+ return (_jsx("button", { className: cn("app-tabs__tab", isActive && "app-tabs__tab--active"), type: "button", role: "tab", "aria-selected": isActive, onClick: () => onChange(tab.id), children: tab.label }, tab.id));
7
+ }) }));
8
+ }
@@ -0,0 +1,3 @@
1
+ export type ClassValue = string | false | null | undefined;
2
+ export declare function cn(...classes: ClassValue[]): string;
3
+ //# sourceMappingURL=cn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/react/cn.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC;AAE3D,wBAAgB,EAAE,CAAC,GAAG,OAAO,EAAE,UAAU,EAAE,UAE1C"}
@@ -0,0 +1,3 @@
1
+ export function cn(...classes) {
2
+ return classes.filter(Boolean).join(" ");
3
+ }
@@ -0,0 +1,9 @@
1
+ export { cn, type ClassValue } from "./cn";
2
+ export { CopyableValue } from "./CopyableValue";
3
+ export { JsonExplorer } from "./JsonExplorer";
4
+ export { JsonPanel } from "./JsonPanel";
5
+ export { PageHeader } from "./PageHeader";
6
+ export { SearchInput } from "./SearchInput";
7
+ export { StateCard } from "./StateCard";
8
+ export { Tabs, type TabOption } from "./Tabs";
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,8 @@
1
+ export { cn } from "./cn";
2
+ export { CopyableValue } from "./CopyableValue";
3
+ export { JsonExplorer } from "./JsonExplorer";
4
+ export { JsonPanel } from "./JsonPanel";
5
+ export { PageHeader } from "./PageHeader";
6
+ export { SearchInput } from "./SearchInput";
7
+ export { StateCard } from "./StateCard";
8
+ export { Tabs } from "./Tabs";