@sudobility/workflow-components 1.0.8
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/blockquote.d.ts +35 -0
- package/dist/blockquote.d.ts.map +1 -0
- package/dist/checklist-progress.d.ts +33 -0
- package/dist/checklist-progress.d.ts.map +1 -0
- package/dist/form-builder.d.ts +33 -0
- package/dist/form-builder.d.ts.map +1 -0
- package/dist/form-template.d.ts +33 -0
- package/dist/form-template.d.ts.map +1 -0
- package/dist/form-validator.d.ts +33 -0
- package/dist/form-validator.d.ts.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +654 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.umd.js +7 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/network-status.d.ts +33 -0
- package/dist/network-status.d.ts.map +1 -0
- package/dist/process-diagram.d.ts +33 -0
- package/dist/process-diagram.d.ts.map +1 -0
- package/dist/quote-generator.d.ts +18 -0
- package/dist/quote-generator.d.ts.map +1 -0
- package/dist/safety-checklist.d.ts +18 -0
- package/dist/safety-checklist.d.ts.map +1 -0
- package/dist/status-badge.d.ts +17 -0
- package/dist/status-badge.d.ts.map +1 -0
- package/dist/sticky-note.d.ts +33 -0
- package/dist/sticky-note.d.ts.map +1 -0
- package/dist/system-status.d.ts +33 -0
- package/dist/system-status.d.ts.map +1 -0
- package/package.json +53 -0
- package/src/blockquote.tsx +89 -0
- package/src/checklist-progress.tsx +60 -0
- package/src/form-builder.tsx +60 -0
- package/src/form-template.tsx +60 -0
- package/src/form-validator.tsx +60 -0
- package/src/index.ts +20 -0
- package/src/network-status.tsx +60 -0
- package/src/process-diagram.tsx +60 -0
- package/src/quote-generator.tsx +41 -0
- package/src/safety-checklist.tsx +41 -0
- package/src/status-badge.tsx +140 -0
- package/src/sticky-note.tsx +60 -0
- package/src/system-status.tsx +60 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { cn } from '@sudobility/components';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* UnetworkUstatus Component
|
|
5
|
+
*
|
|
6
|
+
* A reusable UnetworkUstatus component with full dark mode support.
|
|
7
|
+
* Optimized for accessibility and AI-assisted development.
|
|
8
|
+
*
|
|
9
|
+
* @component
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <UnetworkUstatus className="custom-class" />
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* This component supports:
|
|
17
|
+
* - Light and dark themes automatically
|
|
18
|
+
* - Responsive design
|
|
19
|
+
* - Accessibility features
|
|
20
|
+
* - TypeScript type safety
|
|
21
|
+
*
|
|
22
|
+
* @see {@link https://docs.example.com/components/network-status}
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
export interface UnetworkUstatusProps {
|
|
26
|
+
/** Additional CSS classes */
|
|
27
|
+
className?: string;
|
|
28
|
+
/** Component children */
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
/** Disabled state */
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
/** Callback when component is interacted with */
|
|
33
|
+
onClick?: () => void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const UnetworkUstatus = ({
|
|
37
|
+
className,
|
|
38
|
+
children,
|
|
39
|
+
disabled = false,
|
|
40
|
+
onClick,
|
|
41
|
+
}: UnetworkUstatusProps) => {
|
|
42
|
+
return (
|
|
43
|
+
<div
|
|
44
|
+
className={cn(
|
|
45
|
+
'p-4 rounded-lg border transition-colors',
|
|
46
|
+
'bg-white dark:bg-gray-900',
|
|
47
|
+
'border-gray-200 dark:border-gray-700',
|
|
48
|
+
'text-gray-900 dark:text-white',
|
|
49
|
+
disabled && 'opacity-50 cursor-not-allowed',
|
|
50
|
+
'hover:bg-gray-50 dark:hover:bg-gray-800',
|
|
51
|
+
className
|
|
52
|
+
)}
|
|
53
|
+
onClick={disabled ? undefined : onClick}
|
|
54
|
+
role='region'
|
|
55
|
+
aria-label='UnetworkUstatus'
|
|
56
|
+
>
|
|
57
|
+
{children || 'UnetworkUstatus Component'}
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { cn } from '@sudobility/components';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* UprocessUdiagram Component
|
|
5
|
+
*
|
|
6
|
+
* A reusable UprocessUdiagram component with full dark mode support.
|
|
7
|
+
* Optimized for accessibility and AI-assisted development.
|
|
8
|
+
*
|
|
9
|
+
* @component
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <UprocessUdiagram className="custom-class" />
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* This component supports:
|
|
17
|
+
* - Light and dark themes automatically
|
|
18
|
+
* - Responsive design
|
|
19
|
+
* - Accessibility features
|
|
20
|
+
* - TypeScript type safety
|
|
21
|
+
*
|
|
22
|
+
* @see {@link https://docs.example.com/components/process-diagram}
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
export interface UprocessUdiagramProps {
|
|
26
|
+
/** Additional CSS classes */
|
|
27
|
+
className?: string;
|
|
28
|
+
/** Component children */
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
/** Disabled state */
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
/** Callback when component is interacted with */
|
|
33
|
+
onClick?: () => void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const UprocessUdiagram = ({
|
|
37
|
+
className,
|
|
38
|
+
children,
|
|
39
|
+
disabled = false,
|
|
40
|
+
onClick,
|
|
41
|
+
}: UprocessUdiagramProps) => {
|
|
42
|
+
return (
|
|
43
|
+
<div
|
|
44
|
+
className={cn(
|
|
45
|
+
'p-4 rounded-lg border transition-colors',
|
|
46
|
+
'bg-white dark:bg-gray-900',
|
|
47
|
+
'border-gray-200 dark:border-gray-700',
|
|
48
|
+
'text-gray-900 dark:text-white',
|
|
49
|
+
disabled && 'opacity-50 cursor-not-allowed',
|
|
50
|
+
'hover:bg-gray-50 dark:hover:bg-gray-800',
|
|
51
|
+
className
|
|
52
|
+
)}
|
|
53
|
+
onClick={disabled ? undefined : onClick}
|
|
54
|
+
role='region'
|
|
55
|
+
aria-label='UprocessUdiagram'
|
|
56
|
+
>
|
|
57
|
+
{children || 'UprocessUdiagram Component'}
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { cn } from '@sudobility/components';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* QuoteGenerator Component
|
|
5
|
+
*
|
|
6
|
+
* Insurance component with full dark mode support.
|
|
7
|
+
*
|
|
8
|
+
* @component
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <QuoteGenerator className="custom-class" />
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export interface QuoteGeneratorProps {
|
|
15
|
+
className?: string;
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const QuoteGenerator = ({
|
|
21
|
+
className,
|
|
22
|
+
children,
|
|
23
|
+
disabled,
|
|
24
|
+
}: QuoteGeneratorProps) => {
|
|
25
|
+
return (
|
|
26
|
+
<div
|
|
27
|
+
className={cn(
|
|
28
|
+
'p-4 rounded-lg border transition-colors',
|
|
29
|
+
'bg-white dark:bg-gray-900',
|
|
30
|
+
'border-gray-200 dark:border-gray-700',
|
|
31
|
+
'text-gray-900 dark:text-white',
|
|
32
|
+
disabled && 'opacity-50 cursor-not-allowed',
|
|
33
|
+
className
|
|
34
|
+
)}
|
|
35
|
+
role='region'
|
|
36
|
+
aria-label='QuoteGenerator'
|
|
37
|
+
>
|
|
38
|
+
{children || 'QuoteGenerator Component'}
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { cn } from '@sudobility/components';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* SafetyChecklist Component
|
|
5
|
+
*
|
|
6
|
+
* Construction component with full dark mode support.
|
|
7
|
+
*
|
|
8
|
+
* @component
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <SafetyChecklist className="custom-class" />
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export interface SafetyChecklistProps {
|
|
15
|
+
className?: string;
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const SafetyChecklist = ({
|
|
21
|
+
className,
|
|
22
|
+
children,
|
|
23
|
+
disabled,
|
|
24
|
+
}: SafetyChecklistProps) => {
|
|
25
|
+
return (
|
|
26
|
+
<div
|
|
27
|
+
className={cn(
|
|
28
|
+
'p-4 rounded-lg border transition-colors',
|
|
29
|
+
'bg-white dark:bg-gray-900',
|
|
30
|
+
'border-gray-200 dark:border-gray-700',
|
|
31
|
+
'text-gray-900 dark:text-white',
|
|
32
|
+
disabled && 'opacity-50 cursor-not-allowed',
|
|
33
|
+
className
|
|
34
|
+
)}
|
|
35
|
+
role='region'
|
|
36
|
+
aria-label='SafetyChecklist'
|
|
37
|
+
>
|
|
38
|
+
{children || 'SafetyChecklist Component'}
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { variants, getStatusIndicatorColor } from '@sudobility/design';
|
|
3
|
+
|
|
4
|
+
export type StatusType =
|
|
5
|
+
| 'verified'
|
|
6
|
+
| 'connected'
|
|
7
|
+
| 'disconnected'
|
|
8
|
+
| 'pending'
|
|
9
|
+
| 'error'
|
|
10
|
+
| 'success'
|
|
11
|
+
| 'warning';
|
|
12
|
+
|
|
13
|
+
// Local ChainType enum to avoid @johnqh/lib dependency
|
|
14
|
+
export type ChainType = 'evm' | 'solana' | 'unknown';
|
|
15
|
+
|
|
16
|
+
interface StatusBadgeProps {
|
|
17
|
+
status: StatusType;
|
|
18
|
+
label?: string;
|
|
19
|
+
showDot?: boolean;
|
|
20
|
+
size?: 'sm' | 'md' | 'lg';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface ChainBadgeProps {
|
|
24
|
+
chainType: ChainType;
|
|
25
|
+
size?: 'sm' | 'md' | 'lg';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Map StatusType to design system status indicator types
|
|
29
|
+
const getStatusDotColor = (status: StatusType) => {
|
|
30
|
+
switch (status) {
|
|
31
|
+
case 'verified':
|
|
32
|
+
case 'success':
|
|
33
|
+
return getStatusIndicatorColor('success');
|
|
34
|
+
case 'connected':
|
|
35
|
+
case 'warning':
|
|
36
|
+
return getStatusIndicatorColor('warning');
|
|
37
|
+
case 'disconnected':
|
|
38
|
+
case 'error':
|
|
39
|
+
return getStatusIndicatorColor('error');
|
|
40
|
+
case 'pending':
|
|
41
|
+
return getStatusIndicatorColor('info');
|
|
42
|
+
default:
|
|
43
|
+
return getStatusIndicatorColor('neutral');
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// Dot size classes for different badge sizes
|
|
48
|
+
const getDotSizeClass = (size: 'sm' | 'md' | 'lg') => {
|
|
49
|
+
switch (size) {
|
|
50
|
+
case 'sm':
|
|
51
|
+
return 'w-1.5 h-1.5';
|
|
52
|
+
case 'lg':
|
|
53
|
+
return 'w-3 h-3';
|
|
54
|
+
default: // md
|
|
55
|
+
return 'w-2 h-2';
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const StatusBadge: React.FC<StatusBadgeProps> = ({
|
|
60
|
+
status,
|
|
61
|
+
label,
|
|
62
|
+
showDot = true,
|
|
63
|
+
size = 'md',
|
|
64
|
+
}) => {
|
|
65
|
+
const defaultLabels: Record<StatusType, string> = {
|
|
66
|
+
verified: 'Verified',
|
|
67
|
+
connected: 'Connected',
|
|
68
|
+
disconnected: 'Disconnected',
|
|
69
|
+
pending: 'Pending',
|
|
70
|
+
error: 'Error',
|
|
71
|
+
success: 'Success',
|
|
72
|
+
warning: 'Warning',
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const displayLabel = label || defaultLabels[status];
|
|
76
|
+
|
|
77
|
+
// Use design system badge variants for consistent styling
|
|
78
|
+
const getDesignSystemVariant = (
|
|
79
|
+
status: StatusType,
|
|
80
|
+
size: 'sm' | 'md' | 'lg'
|
|
81
|
+
) => {
|
|
82
|
+
const sizeMap = { sm: 'small', md: 'default', lg: 'large' } as const;
|
|
83
|
+
const variantMap = {
|
|
84
|
+
verified: 'success',
|
|
85
|
+
success: 'success',
|
|
86
|
+
connected: 'warning',
|
|
87
|
+
warning: 'warning',
|
|
88
|
+
disconnected: 'error',
|
|
89
|
+
error: 'error',
|
|
90
|
+
pending: 'primary',
|
|
91
|
+
} as const;
|
|
92
|
+
|
|
93
|
+
const variant = variantMap[status] || 'default';
|
|
94
|
+
const badgeSize = sizeMap[size];
|
|
95
|
+
|
|
96
|
+
if (badgeSize === 'default') {
|
|
97
|
+
return variants.badge[variant as keyof typeof variants.badge]() as string;
|
|
98
|
+
} else {
|
|
99
|
+
return variants.badge[badgeSize](variant) as string;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const badgeClass = getDesignSystemVariant(status, size);
|
|
104
|
+
const dotColor = getStatusDotColor(status);
|
|
105
|
+
const dotSize = getDotSizeClass(size);
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
<span className={badgeClass}>
|
|
109
|
+
{showDot && (
|
|
110
|
+
<span
|
|
111
|
+
className={`inline-block ${dotSize} rounded-full ${dotColor} mr-1`}
|
|
112
|
+
/>
|
|
113
|
+
)}
|
|
114
|
+
{displayLabel}
|
|
115
|
+
</span>
|
|
116
|
+
);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export const ChainBadge: React.FC<ChainBadgeProps> = ({
|
|
120
|
+
chainType,
|
|
121
|
+
size = 'md',
|
|
122
|
+
}) => {
|
|
123
|
+
if (chainType === 'unknown') return null;
|
|
124
|
+
|
|
125
|
+
const chainLabel = chainType === 'solana' ? 'SOL' : 'ETH';
|
|
126
|
+
const sizeMap = { sm: 'small', md: 'default', lg: 'large' } as const;
|
|
127
|
+
const badgeSize = sizeMap[size];
|
|
128
|
+
|
|
129
|
+
// Use design system Web3 badge variants
|
|
130
|
+
const getBadgeClass = () => {
|
|
131
|
+
const badgeType = chainType === 'solana' ? 'solana' : 'ethereum';
|
|
132
|
+
if (badgeSize === 'default') {
|
|
133
|
+
return variants.badge[badgeType]();
|
|
134
|
+
} else {
|
|
135
|
+
return variants.badge[badgeSize](badgeType);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
return <span className={getBadgeClass() as string}>{chainLabel}</span>;
|
|
140
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { cn } from '@sudobility/components';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* UstickyUnote Component
|
|
5
|
+
*
|
|
6
|
+
* A reusable UstickyUnote component with full dark mode support.
|
|
7
|
+
* Optimized for accessibility and AI-assisted development.
|
|
8
|
+
*
|
|
9
|
+
* @component
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <UstickyUnote className="custom-class" />
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* This component supports:
|
|
17
|
+
* - Light and dark themes automatically
|
|
18
|
+
* - Responsive design
|
|
19
|
+
* - Accessibility features
|
|
20
|
+
* - TypeScript type safety
|
|
21
|
+
*
|
|
22
|
+
* @see {@link https://docs.example.com/components/sticky-note}
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
export interface UstickyUnoteProps {
|
|
26
|
+
/** Additional CSS classes */
|
|
27
|
+
className?: string;
|
|
28
|
+
/** Component children */
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
/** Disabled state */
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
/** Callback when component is interacted with */
|
|
33
|
+
onClick?: () => void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const UstickyUnote = ({
|
|
37
|
+
className,
|
|
38
|
+
children,
|
|
39
|
+
disabled = false,
|
|
40
|
+
onClick,
|
|
41
|
+
}: UstickyUnoteProps) => {
|
|
42
|
+
return (
|
|
43
|
+
<div
|
|
44
|
+
className={cn(
|
|
45
|
+
'p-4 rounded-lg border transition-colors',
|
|
46
|
+
'bg-white dark:bg-gray-900',
|
|
47
|
+
'border-gray-200 dark:border-gray-700',
|
|
48
|
+
'text-gray-900 dark:text-white',
|
|
49
|
+
disabled && 'opacity-50 cursor-not-allowed',
|
|
50
|
+
'hover:bg-gray-50 dark:hover:bg-gray-800',
|
|
51
|
+
className
|
|
52
|
+
)}
|
|
53
|
+
onClick={disabled ? undefined : onClick}
|
|
54
|
+
role='region'
|
|
55
|
+
aria-label='UstickyUnote'
|
|
56
|
+
>
|
|
57
|
+
{children || 'UstickyUnote Component'}
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { cn } from '@sudobility/components';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* UsystemUstatus Component
|
|
5
|
+
*
|
|
6
|
+
* A reusable UsystemUstatus component with full dark mode support.
|
|
7
|
+
* Optimized for accessibility and AI-assisted development.
|
|
8
|
+
*
|
|
9
|
+
* @component
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <UsystemUstatus className="custom-class" />
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* This component supports:
|
|
17
|
+
* - Light and dark themes automatically
|
|
18
|
+
* - Responsive design
|
|
19
|
+
* - Accessibility features
|
|
20
|
+
* - TypeScript type safety
|
|
21
|
+
*
|
|
22
|
+
* @see {@link https://docs.example.com/components/system-status}
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
export interface UsystemUstatusProps {
|
|
26
|
+
/** Additional CSS classes */
|
|
27
|
+
className?: string;
|
|
28
|
+
/** Component children */
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
/** Disabled state */
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
/** Callback when component is interacted with */
|
|
33
|
+
onClick?: () => void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const UsystemUstatus = ({
|
|
37
|
+
className,
|
|
38
|
+
children,
|
|
39
|
+
disabled = false,
|
|
40
|
+
onClick,
|
|
41
|
+
}: UsystemUstatusProps) => {
|
|
42
|
+
return (
|
|
43
|
+
<div
|
|
44
|
+
className={cn(
|
|
45
|
+
'p-4 rounded-lg border transition-colors',
|
|
46
|
+
'bg-white dark:bg-gray-900',
|
|
47
|
+
'border-gray-200 dark:border-gray-700',
|
|
48
|
+
'text-gray-900 dark:text-white',
|
|
49
|
+
disabled && 'opacity-50 cursor-not-allowed',
|
|
50
|
+
'hover:bg-gray-50 dark:hover:bg-gray-800',
|
|
51
|
+
className
|
|
52
|
+
)}
|
|
53
|
+
onClick={disabled ? undefined : onClick}
|
|
54
|
+
role='region'
|
|
55
|
+
aria-label='UsystemUstatus'
|
|
56
|
+
>
|
|
57
|
+
{children || 'UsystemUstatus Component'}
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
};
|