@rakeyshgidwani/roger-ui-bank-theme-stan-design 0.2.25 → 0.2.27
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/CHANGELOG.md +1 -1
- package/dist/components/ui/data-display/data-grid.d.ts.map +1 -1
- package/dist/components/ui/data-display/table.d.ts.map +1 -1
- package/dist/components/ui/data-display/types.d.ts +7 -5
- package/dist/components/ui/data-display/types.d.ts.map +1 -1
- package/dist/components/ui/feedback/alert.d.ts.map +1 -1
- package/dist/components/ui/feedback/alert.esm.js +2 -2
- package/dist/components/ui/feedback/alert.js +2 -2
- package/dist/components/ui/feedback/index.d.ts +7 -0
- package/dist/components/ui/feedback/index.d.ts.map +1 -0
- package/dist/components/ui/feedback/index.esm.js +7 -0
- package/dist/components/ui/feedback/index.js +7 -0
- package/dist/components/ui/feedback/progress.d.ts.map +1 -1
- package/dist/components/ui/feedback/progress.esm.js +8 -21
- package/dist/components/ui/feedback/progress.js +8 -21
- package/dist/components/ui/feedback/status-alert-example.d.ts +3 -0
- package/dist/components/ui/feedback/status-alert-example.d.ts.map +1 -0
- package/dist/components/ui/feedback/status-alert-example.esm.js +68 -0
- package/dist/components/ui/feedback/status-alert-example.js +68 -0
- package/dist/components/ui/feedback/types.d.ts +22 -3
- package/dist/components/ui/feedback/types.d.ts.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/themes/types.d.ts +1 -0
- package/dist/themes/types.d.ts.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/ui/data-display/data-grid.tsx +8 -7
- package/src/components/ui/data-display/table.tsx +10 -9
- package/src/components/ui/data-display/types.ts +9 -5
- package/src/components/ui/feedback/alert.tsx +6 -3
- package/src/components/ui/feedback/index.ts +25 -0
- package/src/components/ui/feedback/progress.tsx +16 -32
- package/src/components/ui/feedback/status-alert-example.ts +71 -0
- package/src/components/ui/feedback/types.ts +24 -3
- package/src/index.ts +3 -1
- package/src/styles/components/feedback/progress.css +33 -0
- package/src/themes/types.ts +4 -0
- package/src/types.ts +4 -0
|
@@ -2,18 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useEffect, useState } from 'react';;
|
|
5
|
-
import { useTheme } from '../../../themes/useTheme.js';
|
|
6
5
|
import { ProgressProps, ProgressStep } from './types.js';
|
|
7
6
|
|
|
8
|
-
// Default color fallbacks for when theme is not available
|
|
9
|
-
const getDefaultColors = () => ({
|
|
10
|
-
surface: { background: '#ffffff', surface: '#f3f4f6', border: '#d1d5db', divider: '#e5e7eb' },
|
|
11
|
-
text: { primary: '#111827', secondary: '#6b7280', muted: '#9ca3af', inverse: '#ffffff', onPrimary: '#ffffff', onSecondary: '#ffffff', onSurface: '#111827' },
|
|
12
|
-
interactive: { hover: '#f3f4f6', active: '#e5e7eb', focus: '#3b82f6', disabled: '#d1d5db' },
|
|
13
|
-
primary: { 500: '#3b82f6' },
|
|
14
|
-
semantic: { success: '#10b981', warning: '#f59e0b', error: '#ef4444', info: '#3b82f6' }
|
|
15
|
-
});
|
|
16
|
-
|
|
17
7
|
// Linear Progress Component
|
|
18
8
|
const LinearProgress: React.FC<ProgressProps> = ({
|
|
19
9
|
value,
|
|
@@ -48,13 +38,11 @@ const CircularProgress: React.FC<ProgressProps> = ({
|
|
|
48
38
|
color,
|
|
49
39
|
size = 'md',
|
|
50
40
|
thickness = 4,
|
|
51
|
-
trackColor,
|
|
52
|
-
progressColor,
|
|
41
|
+
trackColor: _trackColor,
|
|
42
|
+
progressColor: _progressColor,
|
|
53
43
|
className = ''
|
|
54
44
|
}) => {
|
|
55
|
-
|
|
56
|
-
const themeConfig = getTheme('stan-design');
|
|
57
|
-
const colors = themeConfig?.colors || getDefaultColors();
|
|
45
|
+
// Note: theme colors not needed as we're using semantic CSS classes
|
|
58
46
|
|
|
59
47
|
const percentage = Math.min(Math.max(((value - min) / (max - min)) * 100, 0), 100);
|
|
60
48
|
const radius = 50 - (thickness / 2);
|
|
@@ -71,7 +59,6 @@ const CircularProgress: React.FC<ProgressProps> = ({
|
|
|
71
59
|
cy="50"
|
|
72
60
|
r={radius}
|
|
73
61
|
className="progress__circle-track"
|
|
74
|
-
stroke={trackColor || colors.surface.border}
|
|
75
62
|
strokeWidth={thickness}
|
|
76
63
|
/>
|
|
77
64
|
{/* Progress */}
|
|
@@ -79,8 +66,7 @@ const CircularProgress: React.FC<ProgressProps> = ({
|
|
|
79
66
|
cx="50"
|
|
80
67
|
cy="50"
|
|
81
68
|
r={radius}
|
|
82
|
-
className={`progress__circle-progress ${animated ? 'progress__circle-progress--animated' : ''}`}
|
|
83
|
-
stroke={progressColor || color || colors.primary[500]}
|
|
69
|
+
className={`progress__circle-progress ${animated ? 'progress__circle-progress--animated' : ''} ${color ? `progress__circle-progress--${color}` : ''}`}
|
|
84
70
|
strokeWidth={thickness}
|
|
85
71
|
strokeDasharray={strokeDasharray}
|
|
86
72
|
strokeDashoffset={strokeDashoffset}
|
|
@@ -185,16 +171,14 @@ export const Progress: React.FC<ProgressProps> = ({
|
|
|
185
171
|
size = 'md',
|
|
186
172
|
variant = 'linear',
|
|
187
173
|
thickness,
|
|
188
|
-
trackColor,
|
|
189
|
-
progressColor,
|
|
174
|
+
trackColor: _trackColor,
|
|
175
|
+
progressColor: _progressColor,
|
|
190
176
|
indeterminate = false,
|
|
191
177
|
onComplete,
|
|
192
178
|
className = '',
|
|
193
179
|
theme = 'stan-design'
|
|
194
180
|
}) => {
|
|
195
|
-
|
|
196
|
-
const themeConfig = getTheme(theme);
|
|
197
|
-
const colors = themeConfig?.colors || getDefaultColors();
|
|
181
|
+
// Note: theme colors not needed as we're using semantic CSS classes
|
|
198
182
|
|
|
199
183
|
const [currentValue, setCurrentValue] = useState(value);
|
|
200
184
|
|
|
@@ -231,8 +215,8 @@ export const Progress: React.FC<ProgressProps> = ({
|
|
|
231
215
|
color={color}
|
|
232
216
|
size={size}
|
|
233
217
|
thickness={thickness}
|
|
234
|
-
trackColor={
|
|
235
|
-
progressColor={
|
|
218
|
+
trackColor={_trackColor}
|
|
219
|
+
progressColor={_progressColor}
|
|
236
220
|
className={className}
|
|
237
221
|
/>
|
|
238
222
|
);
|
|
@@ -258,8 +242,8 @@ export const Progress: React.FC<ProgressProps> = ({
|
|
|
258
242
|
color={color}
|
|
259
243
|
size={size}
|
|
260
244
|
thickness={thickness}
|
|
261
|
-
trackColor={
|
|
262
|
-
progressColor={
|
|
245
|
+
trackColor={_trackColor}
|
|
246
|
+
progressColor={_progressColor}
|
|
263
247
|
className={className}
|
|
264
248
|
/>
|
|
265
249
|
);
|
|
@@ -267,17 +251,17 @@ export const Progress: React.FC<ProgressProps> = ({
|
|
|
267
251
|
};
|
|
268
252
|
|
|
269
253
|
return (
|
|
270
|
-
<div className=
|
|
254
|
+
<div className={`progress__wrapper progress__wrapper--${theme} ${className}`}>
|
|
271
255
|
{/* Label and Value Display */}
|
|
272
256
|
{(showLabel || showValue || showPercentage) && (
|
|
273
|
-
<div className="
|
|
257
|
+
<div className="progress__header">
|
|
274
258
|
{showLabel && label && (
|
|
275
|
-
<span className="
|
|
259
|
+
<span className="progress__label">
|
|
276
260
|
{label}
|
|
277
261
|
</span>
|
|
278
262
|
)}
|
|
279
263
|
{(showValue || showPercentage) && (
|
|
280
|
-
<span className="
|
|
264
|
+
<span className="progress__value">
|
|
281
265
|
{showValue && `${currentValue}/${max}`}
|
|
282
266
|
{showValue && showPercentage && ' - '}
|
|
283
267
|
{showPercentage && `${Math.round(((currentValue - min) / (max - min)) * 100)}%`}
|
|
@@ -285,7 +269,7 @@ export const Progress: React.FC<ProgressProps> = ({
|
|
|
285
269
|
)}
|
|
286
270
|
</div>
|
|
287
271
|
)}
|
|
288
|
-
|
|
272
|
+
|
|
289
273
|
{/* Progress Component */}
|
|
290
274
|
{renderProgress()}
|
|
291
275
|
</div>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// StatusAlertData Usage Example
|
|
2
|
+
import { StatusAlertData } from './types.js';
|
|
3
|
+
|
|
4
|
+
// Simple StatusAlertData examples
|
|
5
|
+
export const statusAlertExamples: StatusAlertData[] = [
|
|
6
|
+
{
|
|
7
|
+
id: 'success-alert',
|
|
8
|
+
title: 'Success',
|
|
9
|
+
message: 'Your changes have been saved successfully.',
|
|
10
|
+
type: 'success',
|
|
11
|
+
dismissible: true,
|
|
12
|
+
onDismiss: () => console.log('Success alert dismissed'),
|
|
13
|
+
showIcon: true,
|
|
14
|
+
closable: true,
|
|
15
|
+
size: 'md',
|
|
16
|
+
variant: 'default'
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: 'warning-alert',
|
|
20
|
+
title: 'Warning',
|
|
21
|
+
message: 'Please review your settings before proceeding.',
|
|
22
|
+
type: 'warning',
|
|
23
|
+
dismissible: true,
|
|
24
|
+
actions: [
|
|
25
|
+
{
|
|
26
|
+
label: 'Review Settings',
|
|
27
|
+
onClick: () => console.log('Review settings clicked'),
|
|
28
|
+
variant: 'primary'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: 'Dismiss',
|
|
32
|
+
onClick: () => console.log('Dismissed'),
|
|
33
|
+
variant: 'secondary'
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
showIcon: true,
|
|
37
|
+
size: 'md',
|
|
38
|
+
variant: 'bordered'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: 'error-alert',
|
|
42
|
+
title: 'Error',
|
|
43
|
+
message: 'An error occurred while processing your request.',
|
|
44
|
+
type: 'error',
|
|
45
|
+
dismissible: true,
|
|
46
|
+
onDismiss: () => console.log('Error alert dismissed'),
|
|
47
|
+
actions: [
|
|
48
|
+
{
|
|
49
|
+
label: 'Retry',
|
|
50
|
+
onClick: () => console.log('Retry clicked'),
|
|
51
|
+
variant: 'primary'
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
showIcon: true,
|
|
55
|
+
closable: true,
|
|
56
|
+
size: 'lg',
|
|
57
|
+
variant: 'filled'
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: 'info-alert',
|
|
61
|
+
title: 'Information',
|
|
62
|
+
message: 'System maintenance is scheduled for tonight.',
|
|
63
|
+
type: 'info',
|
|
64
|
+
dismissible: false,
|
|
65
|
+
persistent: true,
|
|
66
|
+
showIcon: true,
|
|
67
|
+
size: 'md',
|
|
68
|
+
variant: 'default',
|
|
69
|
+
theme: 'stan-design'
|
|
70
|
+
}
|
|
71
|
+
];
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';;
|
|
2
|
+
import { ThemeName } from '../../../themes/types.js';
|
|
2
3
|
|
|
3
4
|
// Base props for all feedback components
|
|
4
5
|
export interface FeedbackBaseProps {
|
|
5
6
|
className?: string;
|
|
6
|
-
theme?:
|
|
7
|
+
theme?: ThemeName;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
// Alert Component Types
|
|
10
11
|
export interface AlertProps extends FeedbackBaseProps {
|
|
11
12
|
title?: string;
|
|
12
|
-
message
|
|
13
|
+
message?: string;
|
|
14
|
+
children?: React.ReactNode;
|
|
13
15
|
type: 'success' | 'warning' | 'error' | 'info';
|
|
14
16
|
dismissible?: boolean;
|
|
15
17
|
onDismiss?: () => void;
|
|
@@ -29,6 +31,25 @@ export interface AlertAction {
|
|
|
29
31
|
size?: 'sm' | 'md' | 'lg';
|
|
30
32
|
}
|
|
31
33
|
|
|
34
|
+
// Status Alert Data Interface
|
|
35
|
+
export interface StatusAlertData {
|
|
36
|
+
id?: string;
|
|
37
|
+
title?: string;
|
|
38
|
+
message?: string;
|
|
39
|
+
children?: React.ReactNode;
|
|
40
|
+
type: 'success' | 'warning' | 'error' | 'info';
|
|
41
|
+
dismissible?: boolean;
|
|
42
|
+
onDismiss?: () => void;
|
|
43
|
+
icon?: React.ReactNode;
|
|
44
|
+
actions?: AlertAction[];
|
|
45
|
+
showIcon?: boolean;
|
|
46
|
+
closable?: boolean;
|
|
47
|
+
persistent?: boolean;
|
|
48
|
+
size?: 'sm' | 'md' | 'lg';
|
|
49
|
+
variant?: 'default' | 'bordered' | 'filled';
|
|
50
|
+
theme?: ThemeName;
|
|
51
|
+
}
|
|
52
|
+
|
|
32
53
|
// Toast Component Types
|
|
33
54
|
export interface ToastProps extends FeedbackBaseProps {
|
|
34
55
|
id: string;
|
|
@@ -65,7 +86,7 @@ export interface ToastContainerProps {
|
|
|
65
86
|
draggable?: boolean;
|
|
66
87
|
progress?: boolean;
|
|
67
88
|
className?: string;
|
|
68
|
-
theme?:
|
|
89
|
+
theme?: ThemeName;
|
|
69
90
|
}
|
|
70
91
|
|
|
71
92
|
// Progress Component Types
|
package/src/index.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - 67 custom hooks
|
|
8
8
|
* - 6 utility functions
|
|
9
9
|
* - 29 theme system components
|
|
10
|
-
* -
|
|
10
|
+
* - 133 TypeScript types
|
|
11
11
|
* - 4 design tokens
|
|
12
12
|
* - 0 build plugins
|
|
13
13
|
* - Complete CSS system (61+ files)
|
|
@@ -200,6 +200,7 @@ export type { NavigationAccessibility } from './components/ui/navigation/types.j
|
|
|
200
200
|
export type { FeedbackBaseProps } from './components/ui/feedback/types.js';
|
|
201
201
|
export type { AlertProps } from './components/ui/feedback/types.js';
|
|
202
202
|
export type { AlertAction } from './components/ui/feedback/types.js';
|
|
203
|
+
export type { StatusAlertData } from './components/ui/feedback/types.js';
|
|
203
204
|
export type { ToastProps } from './components/ui/feedback/types.js';
|
|
204
205
|
export type { ToastAction } from './components/ui/feedback/types.js';
|
|
205
206
|
export type { ToastContainerProps } from './components/ui/feedback/types.js';
|
|
@@ -255,6 +256,7 @@ export type { PopoverContentProps } from './components/ui/overlay/types.js';
|
|
|
255
256
|
export type { PopoverHeaderProps } from './components/ui/overlay/types.js';
|
|
256
257
|
export type { PopoverBodyProps } from './components/ui/overlay/types.js';
|
|
257
258
|
export type { PopoverFooterProps } from './components/ui/overlay/types.js';
|
|
259
|
+
export type { ThemeName } from './themes/types.js';
|
|
258
260
|
export type { MultiThemeConfig } from './themes/types.js';
|
|
259
261
|
export type { FontThemeConfig } from './themes/types.js';
|
|
260
262
|
export type { FontConfig } from './themes/types.js';
|
|
@@ -109,6 +109,22 @@
|
|
|
109
109
|
background-color: var(--cs-colors-primary-500);
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
+
/* ============================================================================ */
|
|
113
|
+
/* PROGRESS WRAPPER */
|
|
114
|
+
/* ============================================================================ */
|
|
115
|
+
|
|
116
|
+
.progress__wrapper {
|
|
117
|
+
width: 100%;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
.progress__header {
|
|
122
|
+
display: flex;
|
|
123
|
+
justify-content: space-between;
|
|
124
|
+
align-items: center;
|
|
125
|
+
margin-bottom: var(--cs-spacing-scale-2);
|
|
126
|
+
}
|
|
127
|
+
|
|
112
128
|
/* ============================================================================ */
|
|
113
129
|
/* PROGRESS LABEL */
|
|
114
130
|
/* ============================================================================ */
|
|
@@ -214,6 +230,23 @@
|
|
|
214
230
|
font-size: var(--cs-fonts-primary-sizes-lg);
|
|
215
231
|
}
|
|
216
232
|
|
|
233
|
+
/* Circular progress colors */
|
|
234
|
+
.progress__circle-progress--success {
|
|
235
|
+
stroke: var(--cs-colors-semantic-success-500);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.progress__circle-progress--warning {
|
|
239
|
+
stroke: var(--cs-colors-semantic-warning-500);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.progress__circle-progress--error {
|
|
243
|
+
stroke: var(--cs-colors-semantic-error-500);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.progress__circle-progress--info {
|
|
247
|
+
stroke: var(--cs-colors-primary-500);
|
|
248
|
+
}
|
|
249
|
+
|
|
217
250
|
/* ============================================================================ */
|
|
218
251
|
/* STEPPED PROGRESS */
|
|
219
252
|
/* ============================================================================ */
|
package/src/themes/types.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
// Multi-Theme System Type Definitions
|
|
2
2
|
// This file defines the core interfaces for theme configuration
|
|
3
3
|
|
|
4
|
+
// Theme Name Type - extensible for new themes
|
|
5
|
+
// Note: 'enterprise' is used in tests but may not have a full theme implementation
|
|
6
|
+
export type ThemeName = 'default' | 'stan-design' | 'harvey' | 'enterprise' | string;
|
|
7
|
+
|
|
4
8
|
export interface MultiThemeConfig {
|
|
5
9
|
fonts: FontThemeConfig;
|
|
6
10
|
colors: ColorThemeConfig;
|
package/src/types.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
// Multi-Theme System Type Definitions
|
|
2
2
|
// This file defines the core interfaces for theme configuration
|
|
3
3
|
|
|
4
|
+
// Theme Name Type - extensible for new themes
|
|
5
|
+
// Note: 'enterprise' is used in tests but may not have a full theme implementation
|
|
6
|
+
export type ThemeName = 'default' | 'stan-design' | 'harvey' | 'enterprise' | string;
|
|
7
|
+
|
|
4
8
|
export interface MultiThemeConfig {
|
|
5
9
|
fonts: FontThemeConfig;
|
|
6
10
|
colors: ColorThemeConfig;
|