@datatechsolutions/ui 3.7.4 → 3.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/astrlabe/contracts.d.mts +517 -0
- package/dist/astrlabe/contracts.d.ts +517 -0
- package/dist/astrlabe/graph-node.d.mts +28 -0
- package/dist/astrlabe/graph-node.d.ts +28 -0
- package/dist/astrlabe/index.d.mts +743 -0
- package/dist/astrlabe/index.d.ts +743 -0
- package/dist/astrlabe/utils.d.mts +60 -0
- package/dist/astrlabe/utils.d.ts +60 -0
- package/dist/astrlabe/workflow-canvas.d.mts +6 -0
- package/dist/astrlabe/workflow-canvas.d.ts +6 -0
- package/dist/astrlabe/workflow-preview-canvas.d.mts +10 -0
- package/dist/astrlabe/workflow-preview-canvas.d.ts +10 -0
- package/dist/billing-panel-DsHhhJqG.d.mts +18 -0
- package/dist/billing-panel-DsHhhJqG.d.ts +18 -0
- package/dist/brand/index.d.mts +71 -0
- package/dist/brand/index.d.ts +71 -0
- package/dist/{chunk-ZWLMKOHZ.mjs → chunk-KZSL7AXW.mjs} +3 -3
- package/dist/{chunk-ZWLMKOHZ.mjs.map → chunk-KZSL7AXW.mjs.map} +1 -1
- package/dist/{chunk-VDO6MDQW.js → chunk-Y2FR242F.js} +3 -3
- package/dist/{chunk-VDO6MDQW.js.map → chunk-Y2FR242F.js.map} +1 -1
- package/dist/dynamic-island-confirm-BKsZkAEP.d.mts +17 -0
- package/dist/dynamic-island-confirm-BKsZkAEP.d.ts +17 -0
- package/dist/index-BNRGVAS5.d.mts +222 -0
- package/dist/index-BoebbJ44.d.mts +49 -0
- package/dist/index-BoebbJ44.d.ts +49 -0
- package/dist/index-CnCY-b5V.d.ts +222 -0
- package/dist/index.d.mts +5316 -0
- package/dist/index.d.ts +5316 -0
- package/dist/layout-engine-YZcVr20M.d.mts +19 -0
- package/dist/layout-engine-YZcVr20M.d.ts +19 -0
- package/dist/lib/i18n-context.d.mts +36 -0
- package/dist/lib/i18n-context.d.ts +36 -0
- package/dist/lib/router-context.d.mts +35 -0
- package/dist/lib/router-context.d.ts +35 -0
- package/dist/navigation-BiWVffAN.d.mts +49 -0
- package/dist/navigation-BiWVffAN.d.ts +49 -0
- package/dist/platform/admin/index.d.mts +17 -0
- package/dist/platform/admin/index.d.ts +17 -0
- package/dist/platform/agents-workspace.d.mts +19 -0
- package/dist/platform/agents-workspace.d.ts +19 -0
- package/dist/platform/app-shell.d.mts +64 -0
- package/dist/platform/app-shell.d.ts +64 -0
- package/dist/platform/auth/index.d.mts +73 -0
- package/dist/platform/auth/index.d.ts +73 -0
- package/dist/platform/billing/index.d.mts +29 -0
- package/dist/platform/billing/index.d.ts +29 -0
- package/dist/platform/impersonation/index.d.mts +19 -0
- package/dist/platform/impersonation/index.d.ts +19 -0
- package/dist/platform/index.d.mts +188 -0
- package/dist/platform/index.d.ts +188 -0
- package/dist/platform/index.js +17 -17
- package/dist/platform/index.mjs +4 -4
- package/dist/platform/pages/index.d.mts +538 -0
- package/dist/platform/pages/index.d.ts +538 -0
- package/dist/platform/pages/index.js +6 -6
- package/dist/platform/pages/index.js.map +1 -1
- package/dist/platform/pages/index.mjs +6 -6
- package/dist/platform/pages/index.mjs.map +1 -1
- package/dist/platform/rbac.d.mts +42 -0
- package/dist/platform/rbac.d.ts +42 -0
- package/dist/platform/settings/index.d.mts +31 -0
- package/dist/platform/settings/index.d.ts +31 -0
- package/dist/platform/settings/index.js +3 -3
- package/dist/platform/settings/index.mjs +2 -2
- package/dist/platform/telemetry/index.d.mts +51 -0
- package/dist/platform/telemetry/index.d.ts +51 -0
- package/dist/platform/utils/index.d.mts +32 -0
- package/dist/platform/utils/index.d.ts +32 -0
- package/dist/platform/windsock-admin-client.d.mts +57 -0
- package/dist/platform/windsock-admin-client.d.ts +57 -0
- package/dist/platform/workflow-api-client.d.mts +6 -0
- package/dist/platform/workflow-api-client.d.ts +6 -0
- package/dist/platform/workflow-canvas-shell.d.mts +18 -0
- package/dist/platform/workflow-canvas-shell.d.ts +18 -0
- package/dist/rule-form-BYJzyork.d.mts +128 -0
- package/dist/rule-form-BYJzyork.d.ts +128 -0
- package/dist/workflow-api-client-CpFl3WcG.d.mts +468 -0
- package/dist/workflow-api-client-uLICOanv.d.ts +468 -0
- package/dist/workflow-canvas--qaYKuMm.d.ts +113 -0
- package/dist/workflow-canvas-B80fmD_n.d.mts +113 -0
- package/dist/workflow-store-o17I6L6A.d.ts +79 -0
- package/dist/workflow-store-ppVHdMZi.d.mts +79 -0
- package/package.json +1 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { WorkflowNodeType, LogicNodeConfig, WorkflowNode, WorkflowEdge, WorkflowGraph } from './contracts.mjs';
|
|
2
|
+
export { L as LayoutDirection, a as applyDagreLayout } from '../layout-engine-YZcVr20M.mjs';
|
|
3
|
+
import '@xyflow/react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Logic Node Default Configs
|
|
7
|
+
* ==========================
|
|
8
|
+
* Factory function to create default configs for each logic node type.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
declare function createDefaultLogicNodeConfig(nodeType: WorkflowNodeType): LogicNodeConfig | null;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Workflow Validator
|
|
15
|
+
* =================
|
|
16
|
+
* Localizes validation output inside the UI package while keeping issue codes
|
|
17
|
+
* stable enough for future contract tests against the backend validator.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
type SupportedLocale = 'en' | 'pt-BR' | 'es' | 'fr' | 'de' | 'it';
|
|
21
|
+
type ValidationParams = Record<string, string | number | undefined>;
|
|
22
|
+
type ValidationLocale = SupportedLocale | string;
|
|
23
|
+
type ValidationIssueCode = 'graph.noAgents' | 'graph.missingSource' | 'graph.missingTarget' | 'graph.orphanNode' | 'graph.toolToNonAgent' | 'graph.ruleNoAgent' | 'graph.cycleDetected' | 'graph.multipleStartNodes' | 'graph.multipleEndNodes' | 'graph.startHasIncoming' | 'graph.endHasOutgoing' | 'graph.iterationNoOutgoing' | 'node.required' | 'node.requiredWhenLanguageSet' | 'node.codeShapeRequired' | 'node.mustBeArray' | 'node.mustBeReferenceArray' | 'node.mustBeNonEmptyReferenceArray' | 'node.assignmentNeedsSourceOrValue' | 'node.invalidAggregationMode' | 'node.invalidListOperation' | 'node.invalidLogicalOperator' | 'node.mustBeNumber' | 'node.invalidHttpMethod' | 'node.providerIdentityRequired' | 'node.inputOrInstructionsRequired' | 'node.invalidExtractionMode' | 'node.s3WriteSourceOrBodyRequired' | 'node.unknownType';
|
|
24
|
+
type ValidationIssue = {
|
|
25
|
+
code: ValidationIssueCode;
|
|
26
|
+
message: string;
|
|
27
|
+
params?: ValidationParams;
|
|
28
|
+
};
|
|
29
|
+
type NodeValidationIssue = ValidationIssue & {
|
|
30
|
+
nodeId: string;
|
|
31
|
+
nodeType: string;
|
|
32
|
+
field?: string;
|
|
33
|
+
};
|
|
34
|
+
type ValidationResult = {
|
|
35
|
+
valid: boolean;
|
|
36
|
+
errors: string[];
|
|
37
|
+
issues: ValidationIssue[];
|
|
38
|
+
nodeIssues: NodeValidationIssue[];
|
|
39
|
+
};
|
|
40
|
+
type ValidationOptions = {
|
|
41
|
+
locale?: ValidationLocale;
|
|
42
|
+
};
|
|
43
|
+
declare function validateNodeConfig(node: WorkflowNode, options?: ValidationOptions): NodeValidationIssue[];
|
|
44
|
+
declare function validateGraphNodeConfigs(graph: WorkflowGraph, options?: ValidationOptions): NodeValidationIssue[];
|
|
45
|
+
declare function validateWorkflowGraph(graph: WorkflowGraph, options?: ValidationOptions): ValidationResult;
|
|
46
|
+
declare function topologicalSortAgents(agentNodes: WorkflowNode[], edges: WorkflowEdge[], nodeMap: Map<string, WorkflowNode>): WorkflowNode[];
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Agent ELO Tier
|
|
50
|
+
* ==============
|
|
51
|
+
* Derives difficulty tier from agent ELO rating.
|
|
52
|
+
* Used in node palette, agent flow node, and agent modal.
|
|
53
|
+
*/
|
|
54
|
+
type AgentTier = {
|
|
55
|
+
key: 'beginner' | 'intermediate' | 'advanced' | 'expert';
|
|
56
|
+
pillColor: string;
|
|
57
|
+
};
|
|
58
|
+
declare function getAgentTier(elo: number | undefined): AgentTier;
|
|
59
|
+
|
|
60
|
+
export { type AgentTier, type NodeValidationIssue, type ValidationResult, createDefaultLogicNodeConfig, getAgentTier, topologicalSortAgents, validateGraphNodeConfigs, validateNodeConfig, validateWorkflowGraph };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { WorkflowNodeType, LogicNodeConfig, WorkflowNode, WorkflowEdge, WorkflowGraph } from './contracts.js';
|
|
2
|
+
export { L as LayoutDirection, a as applyDagreLayout } from '../layout-engine-YZcVr20M.js';
|
|
3
|
+
import '@xyflow/react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Logic Node Default Configs
|
|
7
|
+
* ==========================
|
|
8
|
+
* Factory function to create default configs for each logic node type.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
declare function createDefaultLogicNodeConfig(nodeType: WorkflowNodeType): LogicNodeConfig | null;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Workflow Validator
|
|
15
|
+
* =================
|
|
16
|
+
* Localizes validation output inside the UI package while keeping issue codes
|
|
17
|
+
* stable enough for future contract tests against the backend validator.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
type SupportedLocale = 'en' | 'pt-BR' | 'es' | 'fr' | 'de' | 'it';
|
|
21
|
+
type ValidationParams = Record<string, string | number | undefined>;
|
|
22
|
+
type ValidationLocale = SupportedLocale | string;
|
|
23
|
+
type ValidationIssueCode = 'graph.noAgents' | 'graph.missingSource' | 'graph.missingTarget' | 'graph.orphanNode' | 'graph.toolToNonAgent' | 'graph.ruleNoAgent' | 'graph.cycleDetected' | 'graph.multipleStartNodes' | 'graph.multipleEndNodes' | 'graph.startHasIncoming' | 'graph.endHasOutgoing' | 'graph.iterationNoOutgoing' | 'node.required' | 'node.requiredWhenLanguageSet' | 'node.codeShapeRequired' | 'node.mustBeArray' | 'node.mustBeReferenceArray' | 'node.mustBeNonEmptyReferenceArray' | 'node.assignmentNeedsSourceOrValue' | 'node.invalidAggregationMode' | 'node.invalidListOperation' | 'node.invalidLogicalOperator' | 'node.mustBeNumber' | 'node.invalidHttpMethod' | 'node.providerIdentityRequired' | 'node.inputOrInstructionsRequired' | 'node.invalidExtractionMode' | 'node.s3WriteSourceOrBodyRequired' | 'node.unknownType';
|
|
24
|
+
type ValidationIssue = {
|
|
25
|
+
code: ValidationIssueCode;
|
|
26
|
+
message: string;
|
|
27
|
+
params?: ValidationParams;
|
|
28
|
+
};
|
|
29
|
+
type NodeValidationIssue = ValidationIssue & {
|
|
30
|
+
nodeId: string;
|
|
31
|
+
nodeType: string;
|
|
32
|
+
field?: string;
|
|
33
|
+
};
|
|
34
|
+
type ValidationResult = {
|
|
35
|
+
valid: boolean;
|
|
36
|
+
errors: string[];
|
|
37
|
+
issues: ValidationIssue[];
|
|
38
|
+
nodeIssues: NodeValidationIssue[];
|
|
39
|
+
};
|
|
40
|
+
type ValidationOptions = {
|
|
41
|
+
locale?: ValidationLocale;
|
|
42
|
+
};
|
|
43
|
+
declare function validateNodeConfig(node: WorkflowNode, options?: ValidationOptions): NodeValidationIssue[];
|
|
44
|
+
declare function validateGraphNodeConfigs(graph: WorkflowGraph, options?: ValidationOptions): NodeValidationIssue[];
|
|
45
|
+
declare function validateWorkflowGraph(graph: WorkflowGraph, options?: ValidationOptions): ValidationResult;
|
|
46
|
+
declare function topologicalSortAgents(agentNodes: WorkflowNode[], edges: WorkflowEdge[], nodeMap: Map<string, WorkflowNode>): WorkflowNode[];
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Agent ELO Tier
|
|
50
|
+
* ==============
|
|
51
|
+
* Derives difficulty tier from agent ELO rating.
|
|
52
|
+
* Used in node palette, agent flow node, and agent modal.
|
|
53
|
+
*/
|
|
54
|
+
type AgentTier = {
|
|
55
|
+
key: 'beginner' | 'intermediate' | 'advanced' | 'expert';
|
|
56
|
+
pillColor: string;
|
|
57
|
+
};
|
|
58
|
+
declare function getAgentTier(elo: number | undefined): AgentTier;
|
|
59
|
+
|
|
60
|
+
export { type AgentTier, type NodeValidationIssue, type ValidationResult, createDefaultLogicNodeConfig, getAgentTier, topologicalSortAgents, validateGraphNodeConfigs, validateNodeConfig, validateWorkflowGraph };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { WorkflowGraph } from './contracts.mjs';
|
|
3
|
+
|
|
4
|
+
type WorkflowPreviewCanvasProps = {
|
|
5
|
+
graph: WorkflowGraph;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
declare function WorkflowPreviewCanvas({ graph, className }: WorkflowPreviewCanvasProps): react_jsx_runtime.JSX.Element;
|
|
9
|
+
|
|
10
|
+
export { WorkflowPreviewCanvas, type WorkflowPreviewCanvasProps };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { WorkflowGraph } from './contracts.js';
|
|
3
|
+
|
|
4
|
+
type WorkflowPreviewCanvasProps = {
|
|
5
|
+
graph: WorkflowGraph;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
declare function WorkflowPreviewCanvas({ graph, className }: WorkflowPreviewCanvasProps): react_jsx_runtime.JSX.Element;
|
|
9
|
+
|
|
10
|
+
export { WorkflowPreviewCanvas, type WorkflowPreviewCanvasProps };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface BillingPanelProps {
|
|
4
|
+
/**
|
|
5
|
+
* Which billing interval to prefer when starting checkout. Defaults to
|
|
6
|
+
* `'monthly'`. Surface a toggle in the host app if both matter.
|
|
7
|
+
*/
|
|
8
|
+
defaultBillingInterval?: 'monthly' | 'yearly';
|
|
9
|
+
/**
|
|
10
|
+
* Called after the portal/checkout URL is resolved. Defaults to
|
|
11
|
+
* `window.location.assign(url)`. Override to open in a new tab, use a
|
|
12
|
+
* router, etc.
|
|
13
|
+
*/
|
|
14
|
+
onRedirect?: (url: string) => void;
|
|
15
|
+
}
|
|
16
|
+
declare function BillingPanel({ defaultBillingInterval, onRedirect, }: BillingPanelProps): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { BillingPanel as B, type BillingPanelProps as a };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface BillingPanelProps {
|
|
4
|
+
/**
|
|
5
|
+
* Which billing interval to prefer when starting checkout. Defaults to
|
|
6
|
+
* `'monthly'`. Surface a toggle in the host app if both matter.
|
|
7
|
+
*/
|
|
8
|
+
defaultBillingInterval?: 'monthly' | 'yearly';
|
|
9
|
+
/**
|
|
10
|
+
* Called after the portal/checkout URL is resolved. Defaults to
|
|
11
|
+
* `window.location.assign(url)`. Override to open in a new tab, use a
|
|
12
|
+
* router, etc.
|
|
13
|
+
*/
|
|
14
|
+
onRedirect?: (url: string) => void;
|
|
15
|
+
}
|
|
16
|
+
declare function BillingPanel({ defaultBillingInterval, onRedirect, }: BillingPanelProps): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { BillingPanel as B, type BillingPanelProps as a };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Brand — centralized app themes, icons, and logos
|
|
3
|
+
* =================================================
|
|
4
|
+
* Single source of truth for all app branding across the platform.
|
|
5
|
+
*
|
|
6
|
+
* Logo SVGs live in src/brand/logos/ and are published as-is.
|
|
7
|
+
* Vite apps can import them directly:
|
|
8
|
+
* import astrlabeIcon from '@datatechsolutions/ui/src/brand/logos/astrlabe-icon.svg'
|
|
9
|
+
* Or use the APP_LOGOS/APP_THEMES which re-export them (works in Vite).
|
|
10
|
+
*/
|
|
11
|
+
interface AppTheme {
|
|
12
|
+
text: string;
|
|
13
|
+
textLight: string;
|
|
14
|
+
badgeBg: string;
|
|
15
|
+
badgeText: string;
|
|
16
|
+
ring: string;
|
|
17
|
+
border: string;
|
|
18
|
+
borderGlow: string;
|
|
19
|
+
surfaceBg: string;
|
|
20
|
+
dot: string;
|
|
21
|
+
tileGradient: string;
|
|
22
|
+
tileShadow: string;
|
|
23
|
+
gradient: string;
|
|
24
|
+
}
|
|
25
|
+
declare const APP_THEMES: {
|
|
26
|
+
readonly astrlabe: {
|
|
27
|
+
readonly text: "text-violet-400";
|
|
28
|
+
readonly textLight: "text-violet-300";
|
|
29
|
+
readonly badgeBg: "bg-violet-500/10";
|
|
30
|
+
readonly badgeText: "text-violet-300";
|
|
31
|
+
readonly ring: "ring-violet-500/30";
|
|
32
|
+
readonly border: "border-violet-500/30";
|
|
33
|
+
readonly borderGlow: "border-violet-500/20";
|
|
34
|
+
readonly surfaceBg: "bg-violet-500/[0.06]";
|
|
35
|
+
readonly dot: "bg-violet-400";
|
|
36
|
+
readonly tileGradient: "from-violet-600/80 to-purple-600/80";
|
|
37
|
+
readonly tileShadow: "shadow-violet-500/20";
|
|
38
|
+
readonly gradient: "from-violet-400 to-purple-400";
|
|
39
|
+
};
|
|
40
|
+
readonly windsock: {
|
|
41
|
+
readonly text: "text-emerald-400";
|
|
42
|
+
readonly textLight: "text-emerald-300";
|
|
43
|
+
readonly badgeBg: "bg-emerald-500/10";
|
|
44
|
+
readonly badgeText: "text-emerald-300";
|
|
45
|
+
readonly ring: "ring-emerald-500/30";
|
|
46
|
+
readonly border: "border-emerald-500/30";
|
|
47
|
+
readonly borderGlow: "border-emerald-500/20";
|
|
48
|
+
readonly surfaceBg: "bg-emerald-500/[0.06]";
|
|
49
|
+
readonly dot: "bg-emerald-400";
|
|
50
|
+
readonly tileGradient: "from-emerald-600/80 to-teal-600/80";
|
|
51
|
+
readonly tileShadow: "shadow-emerald-500/20";
|
|
52
|
+
readonly gradient: "from-emerald-400 to-teal-400";
|
|
53
|
+
};
|
|
54
|
+
readonly fakhir: {
|
|
55
|
+
readonly text: "text-red-400";
|
|
56
|
+
readonly textLight: "text-red-300";
|
|
57
|
+
readonly badgeBg: "bg-red-500/10";
|
|
58
|
+
readonly badgeText: "text-red-300";
|
|
59
|
+
readonly ring: "ring-red-500/30";
|
|
60
|
+
readonly border: "border-red-500/30";
|
|
61
|
+
readonly borderGlow: "border-red-500/20";
|
|
62
|
+
readonly surfaceBg: "bg-red-500/[0.06]";
|
|
63
|
+
readonly dot: "bg-red-400";
|
|
64
|
+
readonly tileGradient: "from-red-600/80 to-rose-600/80";
|
|
65
|
+
readonly tileShadow: "shadow-red-500/20";
|
|
66
|
+
readonly gradient: "from-red-400 to-rose-400";
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
type AppId = keyof typeof APP_THEMES;
|
|
70
|
+
|
|
71
|
+
export { APP_THEMES, type AppId, type AppTheme };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Brand — centralized app themes, icons, and logos
|
|
3
|
+
* =================================================
|
|
4
|
+
* Single source of truth for all app branding across the platform.
|
|
5
|
+
*
|
|
6
|
+
* Logo SVGs live in src/brand/logos/ and are published as-is.
|
|
7
|
+
* Vite apps can import them directly:
|
|
8
|
+
* import astrlabeIcon from '@datatechsolutions/ui/src/brand/logos/astrlabe-icon.svg'
|
|
9
|
+
* Or use the APP_LOGOS/APP_THEMES which re-export them (works in Vite).
|
|
10
|
+
*/
|
|
11
|
+
interface AppTheme {
|
|
12
|
+
text: string;
|
|
13
|
+
textLight: string;
|
|
14
|
+
badgeBg: string;
|
|
15
|
+
badgeText: string;
|
|
16
|
+
ring: string;
|
|
17
|
+
border: string;
|
|
18
|
+
borderGlow: string;
|
|
19
|
+
surfaceBg: string;
|
|
20
|
+
dot: string;
|
|
21
|
+
tileGradient: string;
|
|
22
|
+
tileShadow: string;
|
|
23
|
+
gradient: string;
|
|
24
|
+
}
|
|
25
|
+
declare const APP_THEMES: {
|
|
26
|
+
readonly astrlabe: {
|
|
27
|
+
readonly text: "text-violet-400";
|
|
28
|
+
readonly textLight: "text-violet-300";
|
|
29
|
+
readonly badgeBg: "bg-violet-500/10";
|
|
30
|
+
readonly badgeText: "text-violet-300";
|
|
31
|
+
readonly ring: "ring-violet-500/30";
|
|
32
|
+
readonly border: "border-violet-500/30";
|
|
33
|
+
readonly borderGlow: "border-violet-500/20";
|
|
34
|
+
readonly surfaceBg: "bg-violet-500/[0.06]";
|
|
35
|
+
readonly dot: "bg-violet-400";
|
|
36
|
+
readonly tileGradient: "from-violet-600/80 to-purple-600/80";
|
|
37
|
+
readonly tileShadow: "shadow-violet-500/20";
|
|
38
|
+
readonly gradient: "from-violet-400 to-purple-400";
|
|
39
|
+
};
|
|
40
|
+
readonly windsock: {
|
|
41
|
+
readonly text: "text-emerald-400";
|
|
42
|
+
readonly textLight: "text-emerald-300";
|
|
43
|
+
readonly badgeBg: "bg-emerald-500/10";
|
|
44
|
+
readonly badgeText: "text-emerald-300";
|
|
45
|
+
readonly ring: "ring-emerald-500/30";
|
|
46
|
+
readonly border: "border-emerald-500/30";
|
|
47
|
+
readonly borderGlow: "border-emerald-500/20";
|
|
48
|
+
readonly surfaceBg: "bg-emerald-500/[0.06]";
|
|
49
|
+
readonly dot: "bg-emerald-400";
|
|
50
|
+
readonly tileGradient: "from-emerald-600/80 to-teal-600/80";
|
|
51
|
+
readonly tileShadow: "shadow-emerald-500/20";
|
|
52
|
+
readonly gradient: "from-emerald-400 to-teal-400";
|
|
53
|
+
};
|
|
54
|
+
readonly fakhir: {
|
|
55
|
+
readonly text: "text-red-400";
|
|
56
|
+
readonly textLight: "text-red-300";
|
|
57
|
+
readonly badgeBg: "bg-red-500/10";
|
|
58
|
+
readonly badgeText: "text-red-300";
|
|
59
|
+
readonly ring: "ring-red-500/30";
|
|
60
|
+
readonly border: "border-red-500/30";
|
|
61
|
+
readonly borderGlow: "border-red-500/20";
|
|
62
|
+
readonly surfaceBg: "bg-red-500/[0.06]";
|
|
63
|
+
readonly dot: "bg-red-400";
|
|
64
|
+
readonly tileGradient: "from-red-600/80 to-rose-600/80";
|
|
65
|
+
readonly tileShadow: "shadow-red-500/20";
|
|
66
|
+
readonly gradient: "from-red-400 to-rose-400";
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
type AppId = keyof typeof APP_THEMES;
|
|
70
|
+
|
|
71
|
+
export { APP_THEMES, type AppId, type AppTheme };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { BillingPanel } from './chunk-YNHQ36UU.mjs';
|
|
3
2
|
import { AdminOrganizationDetail } from './chunk-MGZTZELL.mjs';
|
|
4
3
|
import { UserProfile } from './chunk-CTCO2YI5.mjs';
|
|
4
|
+
import { BillingPanel } from './chunk-YNHQ36UU.mjs';
|
|
5
5
|
import { useAuth, InlineSpinner, SegmentedControl } from './chunk-Z3BMHKKH.mjs';
|
|
6
6
|
import { useTranslations } from './chunk-7VJ7CMMT.mjs';
|
|
7
7
|
import { useMemo, useState, useEffect } from 'react';
|
|
@@ -94,5 +94,5 @@ function PlatformSettings({
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
export { PlatformSettings };
|
|
97
|
-
//# sourceMappingURL=chunk-
|
|
98
|
-
//# sourceMappingURL=chunk-
|
|
97
|
+
//# sourceMappingURL=chunk-KZSL7AXW.mjs.map
|
|
98
|
+
//# sourceMappingURL=chunk-KZSL7AXW.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/platform/settings/platform-settings.tsx"],"names":[],"mappings":";;;;;;;;AA+CA,IAAM,gBAAA,GAA8C,CAAC,SAAA,EAAW,cAAA,EAAgB,SAAS,CAAA;AAElF,SAAS,gBAAA,CAAiB;AAAA,EAC/B,QAAA,GAAW,gBAAA;AAAA,EACX,cAA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AAA,KACX;AAAA,IAGD,aAAA,KAAkB,SAAA,oBAAa,GAAA,CAAC,WAAA,EAAA,EAAY,CAAA;AAAA,IAE5C,aAAA,KAAkB,cAAA,IAAkB,WAAA,IAAe,cAAA,KAClD,YAAA,mBACE,GAAA;AAAA,MAAC,uBAAA;AAAA,MAAA;AAAA,QACC,MAAA,EAAQ,WAAA;AAAA,QACR;AAAA;AAAA,QAEA,YAAA,mBACF,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,IAAA,EAAK,OAAA;AAAA,QACL,SAAA,EAAU,6IAAA;AAAA,QAET,QAAA,EAAA;AAAA;AAAA,wBAGH,GAAA,CAAC,KAAA,EAAA,EAAI,WAAU,wCAAA,EACb,QAAA,kBAAA,GAAA,CAAC,iBAAc,CAAA,EACjB,CAAA,CAAA;AAAA,IAIH,aAAA,KAAkB,SAAA,oBAAa,GAAA,CAAC,YAAA,EAAA,EAAc,GAAG,OAAA,EAAS;AAAA,GAAA,EAC7D,CAAA;AAEJ","file":"chunk-KZSL7AXW.mjs","sourcesContent":["// =============================================================================\n// @datatechsolutions/windsock/ui — PlatformSettings\n// Unified settings shell consumed by every product (astrlabe, kori).\n// Composes existing building blocks:\n// - `<UserProfile>` — Profile / Security / Sessions / Linked accounts\n// - `<AdminOrganizationDetail>` — Members / Invitations / Domains\n// - `<BillingPanel>` — Current subscription + plan catalogue\n// Apps mount this at their `/settings` route; feature toggles hide sections\n// that a given user's role cannot access.\n// =============================================================================\n\nimport { useEffect, useMemo, useState } from 'react'\nimport { useTranslations } from '@ui/lib/i18n-context'\nimport { SegmentedControl, InlineSpinner } from '@ui/index'\nimport type { AdminClient, AuthOrganization } from '@datatechsolutions/shared-domain'\n\nimport { useAuth } from '../../_auth'\nimport { UserProfile } from '../auth/user-profile'\nimport { AdminOrganizationDetail } from '../admin/admin-organization-detail'\nimport { BillingPanel, type BillingPanelProps } from '../billing/billing-panel'\n\nexport type PlatformSettingsSection = 'account' | 'organization' | 'billing'\n\nexport interface PlatformSettingsProps {\n /**\n * Sections to surface to the current user. The host app is responsible for\n * picking the right set based on RBAC — e.g. hide `organization` for users\n * without `org:manage` and hide `billing` for users without `billing:read`.\n * Defaults to all three.\n */\n sections?: PlatformSettingsSection[]\n /** Starting section. Defaults to the first item in `sections`. */\n defaultSection?: PlatformSettingsSection\n /**\n * Windsock admin API client. Required when `organization` is in `sections`.\n * Create it once with `createAdminClient({ issuer, authClient })` and reuse.\n */\n adminClient?: AdminClient\n /**\n * Current organization id (usually `ctx.organizationId` from the JWT).\n * Required when `organization` is in `sections`.\n */\n organizationId?: string\n /** Forwarded to `<BillingPanel>` — e.g. redirect handler, billing interval. */\n billing?: BillingPanelProps\n}\n\nconst DEFAULT_SECTIONS: PlatformSettingsSection[] = ['account', 'organization', 'billing']\n\nexport function PlatformSettings({\n sections = DEFAULT_SECTIONS,\n defaultSection,\n adminClient,\n organizationId,\n billing,\n}: PlatformSettingsProps) {\n const t = useTranslations('windsock')\n const { status } = useAuth()\n\n const visibleSections = useMemo(() => {\n // Drop `organization` if the caller didn't pass an admin client + org id.\n return sections.filter((section) => {\n if (section === 'organization') {\n return Boolean(adminClient && organizationId)\n }\n return true\n })\n }, [sections, adminClient, organizationId])\n\n const initialSection: PlatformSettingsSection = (\n defaultSection && visibleSections.includes(defaultSection)\n ? defaultSection\n : visibleSections[0] ?? 'account'\n )\n\n const [activeSection, setActiveSection] = useState<PlatformSettingsSection>(initialSection)\n const [organization, setOrganization] = useState<AuthOrganization | null>(null)\n const [orgLoadError, setOrgLoadError] = useState<string | null>(null)\n\n // Resolve the org detail record (AdminOrganizationDetail needs the full\n // AuthOrganization, not just the id). Fires once the organization tab is\n // first selected so the listOrganizations round-trip is lazy.\n useEffect(() => {\n if (activeSection !== 'organization') return\n if (!adminClient || !organizationId) return\n if (organization?.id === organizationId) return\n\n let cancelled = false\n setOrgLoadError(null)\n void adminClient.listOrganizations()\n .then((orgs) => {\n if (cancelled) return\n const match = orgs.find((org) => org.id === organizationId)\n if (match) {\n setOrganization(match)\n } else {\n setOrgLoadError('Organization not found')\n }\n })\n .catch((loadError: unknown) => {\n if (cancelled) return\n setOrgLoadError(loadError instanceof Error ? loadError.message : String(loadError))\n })\n return () => {\n cancelled = true\n }\n }, [activeSection, adminClient, organizationId, organization?.id])\n\n if (status === 'loading') {\n return (\n <div className=\"flex items-center justify-center py-12\">\n <InlineSpinner />\n </div>\n )\n }\n\n if (status !== 'authenticated') {\n return null\n }\n\n if (visibleSections.length === 0) {\n return null\n }\n\n const segments = visibleSections.map((section) => ({\n value: section,\n label: t(`platformSettings.sections.${section}`),\n }))\n\n return (\n <div className=\"space-y-6\">\n {visibleSections.length > 1 && (\n <SegmentedControl\n segments={segments}\n value={activeSection}\n onChange={(value: string) => setActiveSection(value as PlatformSettingsSection)}\n fullWidth\n />\n )}\n\n {activeSection === 'account' && <UserProfile />}\n\n {activeSection === 'organization' && adminClient && organizationId && (\n organization ? (\n <AdminOrganizationDetail\n client={adminClient}\n organization={organization}\n />\n ) : orgLoadError ? (\n <div\n role=\"alert\"\n className=\"rounded-xl border border-red-300/40 bg-red-50/80 px-4 py-3 text-sm text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300\"\n >\n {orgLoadError}\n </div>\n ) : (\n <div className=\"flex items-center justify-center py-12\">\n <InlineSpinner />\n </div>\n )\n )}\n\n {activeSection === 'billing' && <BillingPanel {...billing} />}\n </div>\n )\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var chunkMFAVWJWE_js = require('./chunk-MFAVWJWE.js');
|
|
5
4
|
var chunkDWIBK7GV_js = require('./chunk-DWIBK7GV.js');
|
|
6
5
|
var chunkZF7RJNPD_js = require('./chunk-ZF7RJNPD.js');
|
|
6
|
+
var chunkMFAVWJWE_js = require('./chunk-MFAVWJWE.js');
|
|
7
7
|
var chunkGD6FHRHV_js = require('./chunk-GD6FHRHV.js');
|
|
8
8
|
var chunkYXN2K77G_js = require('./chunk-YXN2K77G.js');
|
|
9
9
|
var react = require('react');
|
|
@@ -96,5 +96,5 @@ function PlatformSettings({
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
exports.PlatformSettings = PlatformSettings;
|
|
99
|
-
//# sourceMappingURL=chunk-
|
|
100
|
-
//# sourceMappingURL=chunk-
|
|
99
|
+
//# sourceMappingURL=chunk-Y2FR242F.js.map
|
|
100
|
+
//# sourceMappingURL=chunk-Y2FR242F.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/platform/settings/platform-settings.tsx"],"names":["useTranslations","useAuth","useMemo","useState","useEffect","jsx","InlineSpinner","jsxs","SegmentedControl","UserProfile","AdminOrganizationDetail","BillingPanel"],"mappings":";;;;;;;;;;AA+CA,IAAM,gBAAA,GAA8C,CAAC,SAAA,EAAW,cAAA,EAAgB,SAAS,CAAA;AAElF,SAAS,gBAAA,CAAiB;AAAA,EAC/B,QAAA,GAAW,gBAAA;AAAA,EACX,cAAA;AAAA,EACA,WAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA,EAA0B;AACxB,EAAA,MAAM,CAAA,GAAIA,iCAAgB,UAAU,CAAA;AACpC,EAAA,MAAM,EAAE,MAAA,EAAO,GAAIC,wBAAA,EAAQ;AAE3B,EAAA,MAAM,eAAA,GAAkBC,cAAQ,MAAM;AAEpC,IAAA,OAAO,QAAA,CAAS,MAAA,CAAO,CAAC,OAAA,KAAY;AAClC,MAAA,IAAI,YAAY,cAAA,EAAgB;AAC9B,QAAA,OAAO,OAAA,CAAQ,eAAe,cAAc,CAAA;AAAA,MAC9C;AACA,MAAA,OAAO,IAAA;AAAA,IACT,CAAC,CAAA;AAAA,EACH,CAAA,EAAG,CAAC,QAAA,EAAU,WAAA,EAAa,cAAc,CAAC,CAAA;AAE1C,EAAA,MAAM,cAAA,GACJ,kBAAkB,eAAA,CAAgB,QAAA,CAAS,cAAc,CA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AA,QAET,QAAA,EAAA;AAAA;AAAA,wBAGHA,cAAA,CAAC,KAAA,EAAA,EAAI,WAAU,wCAAA,EACb,QAAA,kBAAAA,cAAA,CAACC,kCAAc,CAAA,EACjB,CAAA,CAAA;AAAA,IAIH,aAAA,KAAkB,SAAA,oBAAaD,cAAA,CAACM,6BAAA,EAAA,EAAc,GAAG,OAAA,EAAS;AAAA,GAAA,EAC7D,CAAA;AAEJ","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/platform/settings/platform-settings.tsx"],"names":["useTranslations","useAuth","useMemo","useState","useEffect","jsx","InlineSpinner","jsxs","SegmentedControl","UserProfile","AdminOrganizationDetail","BillingPanel"],"mappings":";;;;;;;;;;AA+CA,IAAM,gBAAA,GAA8C,CAAC,SAAA,EAAW,cAAA,EAAgB,SAAS,CAAA;AAElF,SAAS,gBAAA,CAAiB;AAAA,EAC/B,QAAA,GAAW,gBAAA;AAAA,EACX,cAAA;AAAA,EACA,WAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA,EAA0B;AACxB,EAAA,MAAM,CAAA,GAAIA,iCAAgB,UAAU,CAAA;AACpC,EAAA,MAAM,EAAE,MAAA,EAAO,GAAIC,wBAAA,EAAQ;AAE3B,EAAA,MAAM,eAAA,GAAkBC,cAAQ,MAAM;AAEpC,IAAA,OAAO,QAAA,CAAS,MAAA,CAAO,CAAC,OAAA,KAAY;AAClC,MAAA,IAAI,YAAY,cAAA,EAAgB;AAC9B,QAAA,OAAO,OAAA,CAAQ,eAAe,cAAc,CAAA;AAAA,MAC9C;AACA,MAAA,OAAO,IAAA;AAAA,IACT,CAAC,CAAA;AAAA,EACH,CAAA,EAAG,CAAC,QAAA,EAAU,WAAA,EAAa,cAAc,CAAC,CAAA;AAE1C,EAAA,MAAM,cAAA,GACJ,kBAAkB,eAAA,CAAgB,QAAA,CAAS,cAAc,CAAA,GACrD,cAAA,GACA,eAAA,CAAgB,CAAC,CAAA,IAAK,SAAA;AAG5B,EAAA,MA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AU,wCAAA,EACb,QAAA,kBAAAA,cAAA,CAACC,kCAAc,CAAA,EACjB,CAAA,CAAA;AAAA,IAIH,aAAA,KAAkB,SAAA,oBAAaD,cAAA,CAACM,6BAAA,EAAA,EAAc,GAAG,OAAA,EAAS;AAAA,GAAA,EAC7D,CAAA;AAEJ","file":"chunk-Y2FR242F.js","sourcesContent":["// =============================================================================\n// @datatechsolutions/windsock/ui — PlatformSettings\n// Unified settings shell consumed by every product (astrlabe, kori).\n// Composes existing building blocks:\n// - `<UserProfile>` — Profile / Security / Sessions / Linked accounts\n// - `<AdminOrganizationDetail>` — Members / Invitations / Domains\n// - `<BillingPanel>` — Current subscription + plan catalogue\n// Apps mount this at their `/settings` route; feature toggles hide sections\n// that a given user's role cannot access.\n// =============================================================================\n\nimport { useEffect, useMemo, useState } from 'react'\nimport { useTranslations } from '@ui/lib/i18n-context'\nimport { SegmentedControl, InlineSpinner } from '@ui/index'\nimport type { AdminClient, AuthOrganization } from '@datatechsolutions/shared-domain'\n\nimport { useAuth } from '../../_auth'\nimport { UserProfile } from '../auth/user-profile'\nimport { AdminOrganizationDetail } from '../admin/admin-organization-detail'\nimport { BillingPanel, type BillingPanelProps } from '../billing/billing-panel'\n\nexport type PlatformSettingsSection = 'account' | 'organization' | 'billing'\n\nexport interface PlatformSettingsProps {\n /**\n * Sections to surface to the current user. The host app is responsible for\n * picking the right set based on RBAC — e.g. hide `organization` for users\n * without `org:manage` and hide `billing` for users without `billing:read`.\n * Defaults to all three.\n */\n sections?: PlatformSettingsSection[]\n /** Starting section. Defaults to the first item in `sections`. */\n defaultSection?: PlatformSettingsSection\n /**\n * Windsock admin API client. Required when `organization` is in `sections`.\n * Create it once with `createAdminClient({ issuer, authClient })` and reuse.\n */\n adminClient?: AdminClient\n /**\n * Current organization id (usually `ctx.organizationId` from the JWT).\n * Required when `organization` is in `sections`.\n */\n organizationId?: string\n /** Forwarded to `<BillingPanel>` — e.g. redirect handler, billing interval. */\n billing?: BillingPanelProps\n}\n\nconst DEFAULT_SECTIONS: PlatformSettingsSection[] = ['account', 'organization', 'billing']\n\nexport function PlatformSettings({\n sections = DEFAULT_SECTIONS,\n defaultSection,\n adminClient,\n organizationId,\n billing,\n}: PlatformSettingsProps) {\n const t = useTranslations('windsock')\n const { status } = useAuth()\n\n const visibleSections = useMemo(() => {\n // Drop `organization` if the caller didn't pass an admin client + org id.\n return sections.filter((section) => {\n if (section === 'organization') {\n return Boolean(adminClient && organizationId)\n }\n return true\n })\n }, [sections, adminClient, organizationId])\n\n const initialSection: PlatformSettingsSection = (\n defaultSection && visibleSections.includes(defaultSection)\n ? defaultSection\n : visibleSections[0] ?? 'account'\n )\n\n const [activeSection, setActiveSection] = useState<PlatformSettingsSection>(initialSection)\n const [organization, setOrganization] = useState<AuthOrganization | null>(null)\n const [orgLoadError, setOrgLoadError] = useState<string | null>(null)\n\n // Resolve the org detail record (AdminOrganizationDetail needs the full\n // AuthOrganization, not just the id). Fires once the organization tab is\n // first selected so the listOrganizations round-trip is lazy.\n useEffect(() => {\n if (activeSection !== 'organization') return\n if (!adminClient || !organizationId) return\n if (organization?.id === organizationId) return\n\n let cancelled = false\n setOrgLoadError(null)\n void adminClient.listOrganizations()\n .then((orgs) => {\n if (cancelled) return\n const match = orgs.find((org) => org.id === organizationId)\n if (match) {\n setOrganization(match)\n } else {\n setOrgLoadError('Organization not found')\n }\n })\n .catch((loadError: unknown) => {\n if (cancelled) return\n setOrgLoadError(loadError instanceof Error ? loadError.message : String(loadError))\n })\n return () => {\n cancelled = true\n }\n }, [activeSection, adminClient, organizationId, organization?.id])\n\n if (status === 'loading') {\n return (\n <div className=\"flex items-center justify-center py-12\">\n <InlineSpinner />\n </div>\n )\n }\n\n if (status !== 'authenticated') {\n return null\n }\n\n if (visibleSections.length === 0) {\n return null\n }\n\n const segments = visibleSections.map((section) => ({\n value: section,\n label: t(`platformSettings.sections.${section}`),\n }))\n\n return (\n <div className=\"space-y-6\">\n {visibleSections.length > 1 && (\n <SegmentedControl\n segments={segments}\n value={activeSection}\n onChange={(value: string) => setActiveSection(value as PlatformSettingsSection)}\n fullWidth\n />\n )}\n\n {activeSection === 'account' && <UserProfile />}\n\n {activeSection === 'organization' && adminClient && organizationId && (\n organization ? (\n <AdminOrganizationDetail\n client={adminClient}\n organization={organization}\n />\n ) : orgLoadError ? (\n <div\n role=\"alert\"\n className=\"rounded-xl border border-red-300/40 bg-red-50/80 px-4 py-3 text-sm text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300\"\n >\n {orgLoadError}\n </div>\n ) : (\n <div className=\"flex items-center justify-center py-12\">\n <InlineSpinner />\n </div>\n )\n )}\n\n {activeSection === 'billing' && <BillingPanel {...billing} />}\n </div>\n )\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type DynamicIslandConfirmProps = {
|
|
5
|
+
open: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
onConfirm: () => void;
|
|
8
|
+
title: string;
|
|
9
|
+
icon?: ReactNode;
|
|
10
|
+
iconBackground?: string;
|
|
11
|
+
appName?: string;
|
|
12
|
+
confirmLabel?: string;
|
|
13
|
+
cancelLabel?: string;
|
|
14
|
+
};
|
|
15
|
+
declare function DynamicIslandConfirm({ open, onClose, onConfirm, title, icon, iconBackground, appName, confirmLabel, cancelLabel, }: DynamicIslandConfirmProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { DynamicIslandConfirm as D };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type DynamicIslandConfirmProps = {
|
|
5
|
+
open: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
onConfirm: () => void;
|
|
8
|
+
title: string;
|
|
9
|
+
icon?: ReactNode;
|
|
10
|
+
iconBackground?: string;
|
|
11
|
+
appName?: string;
|
|
12
|
+
confirmLabel?: string;
|
|
13
|
+
cancelLabel?: string;
|
|
14
|
+
};
|
|
15
|
+
declare function DynamicIslandConfirm({ open, onClose, onConfirm, title, icon, iconBackground, appName, confirmLabel, cancelLabel, }: DynamicIslandConfirmProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { DynamicIslandConfirm as D };
|