@rakeyshgidwani/roger-ui-bank-theme-stan-design 0.2.9 → 0.2.10
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/accessibility-demo.esm.js +30 -24
- package/dist/components/ui/accessibility-demo.js +30 -24
- package/dist/components/ui/advanced-component-architecture-demo.esm.js +235 -179
- package/dist/components/ui/advanced-component-architecture-demo.js +235 -179
- package/dist/components/ui/advanced-transition-system-demo.esm.js +110 -64
- package/dist/components/ui/advanced-transition-system-demo.js +110 -64
- package/dist/components/ui/advanced-transition-system.esm.js +166 -122
- package/dist/components/ui/advanced-transition-system.js +166 -122
- package/dist/components/ui/animation/animated-container.esm.js +52 -29
- package/dist/components/ui/animation/animated-container.js +52 -29
- package/dist/components/ui/animation/staggered-container.esm.js +18 -9
- package/dist/components/ui/animation/staggered-container.js +18 -9
- package/dist/components/ui/animation-demo.esm.js +67 -35
- package/dist/components/ui/animation-demo.js +67 -35
- package/dist/components/ui/badge.esm.js +9 -6
- package/dist/components/ui/badge.js +9 -6
- package/dist/components/ui/battery-conscious-animation-demo.esm.js +122 -87
- package/dist/components/ui/battery-conscious-animation-demo.js +122 -87
- package/dist/components/ui/border-radius-shadow-demo.esm.js +23 -12
- package/dist/components/ui/border-radius-shadow-demo.js +23 -12
- package/dist/components/ui/button.esm.js +8 -2
- package/dist/components/ui/button.js +8 -2
- package/dist/components/ui/card.esm.js +33 -8
- package/dist/components/ui/card.js +33 -8
- package/dist/components/ui/checkbox.esm.js +3 -3
- package/dist/components/ui/checkbox.js +3 -3
- package/dist/components/ui/color-preview.esm.js +68 -45
- package/dist/components/ui/color-preview.js +68 -45
- package/dist/components/ui/data-display/chart.esm.js +112 -84
- package/dist/components/ui/data-display/chart.js +112 -84
- package/dist/components/ui/data-display/data-grid-simple.esm.js +1 -1
- package/dist/components/ui/data-display/data-grid-simple.js +1 -1
- package/dist/components/ui/data-display/data-grid.esm.js +80 -67
- package/dist/components/ui/data-display/data-grid.js +80 -67
- package/dist/components/ui/data-display/list.esm.js +53 -45
- package/dist/components/ui/data-display/list.js +53 -45
- package/dist/components/ui/data-display/table.esm.js +62 -54
- package/dist/components/ui/data-display/table.js +62 -54
- package/dist/components/ui/data-display/timeline.esm.js +39 -34
- package/dist/components/ui/data-display/timeline.js +39 -34
- package/dist/components/ui/data-display/tree.esm.js +116 -84
- package/dist/components/ui/data-display/tree.js +116 -84
- package/dist/components/ui/data-display/types.esm.js +389 -364
- package/dist/components/ui/data-display/types.js +389 -364
- package/dist/components/ui/enterprise-mobile-experience-demo.esm.js +120 -70
- package/dist/components/ui/enterprise-mobile-experience-demo.js +120 -70
- package/dist/components/ui/enterprise-mobile-experience.esm.js +124 -73
- package/dist/components/ui/enterprise-mobile-experience.js +124 -73
- package/dist/components/ui/feedback/alert.esm.js +22 -15
- package/dist/components/ui/feedback/alert.js +22 -15
- package/dist/components/ui/feedback/progress.esm.js +47 -24
- package/dist/components/ui/feedback/progress.js +47 -24
- package/dist/components/ui/feedback/skeleton.esm.js +39 -29
- package/dist/components/ui/feedback/skeleton.js +39 -29
- package/dist/components/ui/feedback/toast.esm.js +62 -38
- package/dist/components/ui/feedback/toast.js +62 -38
- package/dist/components/ui/feedback/types.esm.js +83 -83
- package/dist/components/ui/feedback/types.js +83 -83
- package/dist/components/ui/font-preview.esm.js +41 -39
- package/dist/components/ui/font-preview.js +41 -39
- package/dist/components/ui/form-demo.esm.js +150 -113
- package/dist/components/ui/form-demo.js +150 -113
- package/dist/components/ui/hardware-acceleration-demo.esm.js +137 -87
- package/dist/components/ui/hardware-acceleration-demo.js +137 -87
- package/dist/components/ui/input.esm.js +4 -1
- package/dist/components/ui/input.js +4 -1
- package/dist/components/ui/layout-demo.esm.js +81 -56
- package/dist/components/ui/layout-demo.js +81 -56
- package/dist/components/ui/layouts/adaptive-layout.esm.js +27 -8
- package/dist/components/ui/layouts/adaptive-layout.js +27 -8
- package/dist/components/ui/layouts/desktop-layout.esm.js +39 -19
- package/dist/components/ui/layouts/desktop-layout.js +39 -19
- package/dist/components/ui/layouts/mobile-layout.esm.js +19 -9
- package/dist/components/ui/layouts/mobile-layout.js +19 -9
- package/dist/components/ui/layouts/tablet-layout.esm.js +28 -14
- package/dist/components/ui/layouts/tablet-layout.js +28 -14
- package/dist/components/ui/mobile-form-validation.esm.js +120 -87
- package/dist/components/ui/mobile-form-validation.js +120 -87
- package/dist/components/ui/mobile-input-demo.esm.js +19 -13
- package/dist/components/ui/mobile-input-demo.js +19 -13
- package/dist/components/ui/mobile-input.esm.js +185 -120
- package/dist/components/ui/mobile-input.js +185 -120
- package/dist/components/ui/mobile-skeleton-loading-demo.esm.js +128 -111
- package/dist/components/ui/mobile-skeleton-loading-demo.js +128 -111
- package/dist/components/ui/navigation/breadcrumb.esm.js +17 -14
- package/dist/components/ui/navigation/breadcrumb.js +17 -14
- package/dist/components/ui/navigation/index.esm.js +23 -1
- package/dist/components/ui/navigation/index.js +23 -1
- package/dist/components/ui/navigation/menu.esm.js +49 -35
- package/dist/components/ui/navigation/menu.js +49 -35
- package/dist/components/ui/navigation/navigation-demo.esm.js +81 -74
- package/dist/components/ui/navigation/navigation-demo.js +81 -74
- package/dist/components/ui/navigation/pagination.esm.js +62 -50
- package/dist/components/ui/navigation/pagination.js +62 -50
- package/dist/components/ui/navigation/sidebar.esm.js +56 -42
- package/dist/components/ui/navigation/sidebar.js +56 -42
- package/dist/components/ui/navigation/stepper.esm.js +34 -23
- package/dist/components/ui/navigation/stepper.js +34 -23
- package/dist/components/ui/navigation/tabs.esm.js +32 -21
- package/dist/components/ui/navigation/tabs.js +32 -21
- package/dist/components/ui/navigation/types.esm.js +196 -195
- package/dist/components/ui/navigation/types.js +196 -195
- package/dist/components/ui/overlay/backdrop.esm.js +17 -16
- package/dist/components/ui/overlay/backdrop.js +17 -16
- package/dist/components/ui/overlay/focus-manager.esm.js +21 -19
- package/dist/components/ui/overlay/focus-manager.js +21 -19
- package/dist/components/ui/overlay/index.esm.js +22 -2
- package/dist/components/ui/overlay/index.js +22 -2
- package/dist/components/ui/overlay/modal.esm.js +38 -34
- package/dist/components/ui/overlay/modal.js +38 -34
- package/dist/components/ui/overlay/overlay-manager.esm.js +25 -20
- package/dist/components/ui/overlay/overlay-manager.js +25 -20
- package/dist/components/ui/overlay/popover.esm.js +74 -58
- package/dist/components/ui/overlay/popover.js +74 -58
- package/dist/components/ui/overlay/portal.esm.js +7 -7
- package/dist/components/ui/overlay/portal.js +7 -7
- package/dist/components/ui/overlay/tooltip.esm.js +54 -39
- package/dist/components/ui/overlay/tooltip.js +54 -39
- package/dist/components/ui/overlay/types.esm.js +132 -131
- package/dist/components/ui/overlay/types.js +132 -131
- package/dist/components/ui/performance-demo.esm.js +135 -88
- package/dist/components/ui/performance-demo.js +135 -88
- package/dist/components/ui/semantic-input-system-demo.esm.js +117 -80
- package/dist/components/ui/semantic-input-system-demo.js +117 -80
- package/dist/components/ui/theme-customizer.esm.js +84 -52
- package/dist/components/ui/theme-customizer.js +84 -52
- package/dist/components/ui/theme-preview.esm.js +95 -43
- package/dist/components/ui/theme-preview.js +95 -43
- package/dist/components/ui/theme-switcher.esm.js +70 -44
- package/dist/components/ui/theme-switcher.js +70 -44
- package/dist/components/ui/theme-toggle.esm.js +3 -3
- package/dist/components/ui/theme-toggle.js +3 -3
- package/dist/components/ui/token-demo.esm.js +33 -21
- package/dist/components/ui/token-demo.js +33 -21
- package/dist/components/ui/touch-demo.esm.js +102 -73
- package/dist/components/ui/touch-demo.js +102 -73
- package/dist/components/ui/touch-friendly-interface-demo.esm.js +102 -64
- package/dist/components/ui/touch-friendly-interface-demo.js +102 -64
- package/dist/components/ui/touch-friendly-interface.esm.js +85 -61
- package/dist/components/ui/touch-friendly-interface.js +85 -61
- package/dist/hooks/use-accessibility-support.esm.js +115 -85
- package/dist/hooks/use-accessibility-support.js +115 -85
- package/dist/hooks/use-adaptive-layout.esm.js +56 -33
- package/dist/hooks/use-adaptive-layout.js +56 -33
- package/dist/hooks/use-advanced-patterns.esm.js +57 -42
- package/dist/hooks/use-advanced-patterns.js +57 -42
- package/dist/hooks/use-advanced-transition-system.esm.js +112 -71
- package/dist/hooks/use-advanced-transition-system.js +112 -71
- package/dist/hooks/use-animation-profile.esm.js +63 -34
- package/dist/hooks/use-animation-profile.js +63 -34
- package/dist/hooks/use-battery-animations.esm.js +80 -55
- package/dist/hooks/use-battery-animations.js +80 -55
- package/dist/hooks/use-battery-conscious-loading.esm.js +166 -123
- package/dist/hooks/use-battery-conscious-loading.js +166 -123
- package/dist/hooks/use-battery-optimization.esm.js +78 -55
- package/dist/hooks/use-battery-optimization.js +78 -55
- package/dist/hooks/use-battery-status.esm.js +73 -51
- package/dist/hooks/use-battery-status.js +73 -51
- package/dist/hooks/use-component-performance.esm.js +62 -47
- package/dist/hooks/use-component-performance.js +62 -47
- package/dist/hooks/use-device-loading-states.esm.js +152 -109
- package/dist/hooks/use-device-loading-states.js +152 -109
- package/dist/hooks/use-device.esm.js +25 -14
- package/dist/hooks/use-device.js +25 -14
- package/dist/hooks/use-enterprise-mobile-experience.esm.js +137 -88
- package/dist/hooks/use-enterprise-mobile-experience.js +137 -88
- package/dist/hooks/use-form-feedback.esm.js +124 -81
- package/dist/hooks/use-form-feedback.js +124 -81
- package/dist/hooks/use-form-performance.esm.js +127 -92
- package/dist/hooks/use-form-performance.js +127 -92
- package/dist/hooks/use-frame-rate.esm.js +56 -37
- package/dist/hooks/use-frame-rate.js +56 -37
- package/dist/hooks/use-gestures.esm.js +96 -72
- package/dist/hooks/use-gestures.js +96 -72
- package/dist/hooks/use-hardware-acceleration.esm.js +65 -37
- package/dist/hooks/use-hardware-acceleration.js +65 -37
- package/dist/hooks/use-input-accessibility.esm.js +157 -119
- package/dist/hooks/use-input-accessibility.js +157 -119
- package/dist/hooks/use-input-performance.esm.js +139 -104
- package/dist/hooks/use-input-performance.js +139 -104
- package/dist/hooks/use-layout-performance.esm.js +50 -29
- package/dist/hooks/use-layout-performance.js +50 -29
- package/dist/hooks/use-loading-accessibility.esm.js +209 -169
- package/dist/hooks/use-loading-accessibility.js +209 -169
- package/dist/hooks/use-loading-performance.esm.js +117 -93
- package/dist/hooks/use-loading-performance.js +117 -93
- package/dist/hooks/use-memory-usage.esm.js +57 -38
- package/dist/hooks/use-memory-usage.js +57 -38
- package/dist/hooks/use-mobile-form-layout.esm.js +111 -74
- package/dist/hooks/use-mobile-form-layout.js +111 -74
- package/dist/hooks/use-mobile-form-validation.esm.js +211 -144
- package/dist/hooks/use-mobile-form-validation.js +211 -144
- package/dist/hooks/use-mobile-keyboard-optimization.esm.js +154 -113
- package/dist/hooks/use-mobile-keyboard-optimization.js +154 -113
- package/dist/hooks/use-mobile-layout.esm.js +73 -51
- package/dist/hooks/use-mobile-layout.js +73 -51
- package/dist/hooks/use-mobile-optimization.esm.js +72 -44
- package/dist/hooks/use-mobile-optimization.js +72 -44
- package/dist/hooks/use-mobile-skeleton.esm.js +97 -64
- package/dist/hooks/use-mobile-skeleton.js +97 -64
- package/dist/hooks/use-mobile-touch.esm.js +128 -93
- package/dist/hooks/use-mobile-touch.js +128 -93
- package/dist/hooks/use-performance-throttling.esm.js +72 -48
- package/dist/hooks/use-performance-throttling.js +72 -48
- package/dist/hooks/use-performance.esm.js +90 -52
- package/dist/hooks/use-performance.js +90 -52
- package/dist/hooks/use-reusable-architecture.esm.js +94 -65
- package/dist/hooks/use-reusable-architecture.js +94 -65
- package/dist/hooks/use-semantic-input-types.esm.js +166 -124
- package/dist/hooks/use-semantic-input-types.js +166 -124
- package/dist/hooks/use-semantic-input.esm.js +178 -126
- package/dist/hooks/use-semantic-input.js +178 -126
- package/dist/hooks/use-tablet-layout.esm.js +67 -38
- package/dist/hooks/use-tablet-layout.js +67 -38
- package/dist/hooks/use-touch-friendly-input.esm.js +193 -149
- package/dist/hooks/use-touch-friendly-input.js +193 -149
- package/dist/hooks/use-touch-friendly-interface.esm.js +99 -67
- package/dist/hooks/use-touch-friendly-interface.js +99 -67
- package/dist/hooks/use-touch-optimization.esm.js +99 -72
- package/dist/hooks/use-touch-optimization.js +99 -72
- package/dist/index.esm.js +289 -280
- package/dist/index.js +289 -280
- package/dist/lib/utils.esm.js +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/plugins/theme-css-generator.esm.js +104 -55
- package/dist/plugins/theme-css-generator.js +104 -55
- package/dist/provider.esm.js +4 -4
- package/dist/provider.js +4 -4
- package/dist/styles.css +1 -1
- package/dist/theme.esm.js +633 -468
- package/dist/theme.js +633 -468
- package/dist/themes/ThemeContext.esm.js +15 -15
- package/dist/themes/ThemeContext.js +15 -15
- package/dist/themes/ThemeProvider.esm.js +25 -22
- package/dist/themes/ThemeProvider.js +25 -22
- package/dist/themes/accessibility.esm.js +147 -108
- package/dist/themes/accessibility.js +147 -108
- package/dist/themes/aria-patterns.esm.js +198 -162
- package/dist/themes/aria-patterns.js +198 -162
- package/dist/themes/base-themes.esm.js +14 -11
- package/dist/themes/base-themes.js +14 -11
- package/dist/themes/colorManager.esm.js +101 -83
- package/dist/themes/colorManager.js +101 -83
- package/dist/themes/examples/dark-theme.esm.js +133 -103
- package/dist/themes/examples/dark-theme.js +133 -103
- package/dist/themes/examples/minimal-theme.esm.js +83 -61
- package/dist/themes/examples/minimal-theme.js +83 -61
- package/dist/themes/focus-management.esm.js +202 -143
- package/dist/themes/focus-management.js +202 -143
- package/dist/themes/fontLoader.esm.js +28 -19
- package/dist/themes/fontLoader.js +28 -19
- package/dist/themes/high-contrast.esm.js +152 -104
- package/dist/themes/high-contrast.js +152 -104
- package/dist/themes/inheritance.esm.js +35 -27
- package/dist/themes/inheritance.js +35 -27
- package/dist/themes/keyboard-navigation.esm.js +152 -123
- package/dist/themes/keyboard-navigation.js +152 -123
- package/dist/themes/motion-reduction.esm.js +193 -133
- package/dist/themes/motion-reduction.js +193 -133
- package/dist/themes/navigation.esm.js +146 -146
- package/dist/themes/navigation.js +146 -146
- package/dist/themes/screen-reader.esm.js +159 -94
- package/dist/themes/screen-reader.js +159 -94
- package/dist/themes/systemThemeDetector.esm.js +42 -34
- package/dist/themes/systemThemeDetector.js +42 -34
- package/dist/themes/themeCSSUpdater.esm.js +21 -9
- package/dist/themes/themeCSSUpdater.js +21 -9
- package/dist/themes/themePersistence.esm.js +68 -47
- package/dist/themes/themePersistence.js +68 -47
- package/dist/themes/themes/stan-design.esm.js +633 -468
- package/dist/themes/themes/stan-design.js +633 -468
- package/dist/themes/types.esm.js +301 -287
- package/dist/themes/types.js +301 -287
- package/dist/themes/useSystemTheme.esm.js +4 -4
- package/dist/themes/useSystemTheme.js +4 -4
- package/dist/themes/useTheme.esm.js +4 -4
- package/dist/themes/useTheme.js +4 -4
- package/dist/themes/validation.esm.js +128 -77
- package/dist/themes/validation.js +128 -77
- package/dist/tokens/index.esm.js +15 -4
- package/dist/tokens/index.js +15 -4
- package/dist/tokens/tokenExporter.esm.js +87 -61
- package/dist/tokens/tokenExporter.js +87 -61
- package/dist/tokens/tokenGenerator.esm.js +86 -77
- package/dist/tokens/tokenGenerator.js +86 -77
- package/dist/tokens/tokenManager.esm.js +64 -51
- package/dist/tokens/tokenManager.js +64 -51
- package/dist/tokens/tokenValidator.esm.js +193 -147
- package/dist/tokens/tokenValidator.js +193 -147
- package/dist/tokens/types.esm.js +49 -35
- package/dist/tokens/types.js +49 -35
- package/dist/utils/bundle-analyzer.esm.js +83 -65
- package/dist/utils/bundle-analyzer.js +83 -65
- package/dist/utils/bundle-splitting.esm.js +142 -117
- package/dist/utils/bundle-splitting.js +142 -117
- package/dist/utils/lazy-loading.esm.js +132 -106
- package/dist/utils/lazy-loading.js +132 -106
- package/dist/utils/performance-monitor.esm.js +170 -129
- package/dist/utils/performance-monitor.js +170 -129
- package/dist/utils/tree-shaking.esm.js +69 -61
- package/dist/utils/tree-shaking.js +69 -61
- package/package.json +1 -1
- package/src/index.ts +146 -146
|
@@ -9,13 +9,13 @@ import { CheckIcon, ExclamationTriangleIcon } from '@heroicons/react/24/outline'
|
|
|
9
9
|
import { StepperProps, StepItem } from './types';
|
|
10
10
|
|
|
11
11
|
// Simple icon components
|
|
12
|
-
const ExclamationCircleIcon}> = ({ className = '' }) => (
|
|
12
|
+
const ExclamationCircleIcon: React.FC<{ className?: string }> = ({ className = '' }) => (
|
|
13
13
|
<svg className={className} fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
14
14
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
15
15
|
</svg>
|
|
16
16
|
);
|
|
17
17
|
|
|
18
|
-
export const Stepper= ({
|
|
18
|
+
export const Stepper: React.FC<StepperProps> = ({
|
|
19
19
|
steps,
|
|
20
20
|
currentStep = 0,
|
|
21
21
|
defaultCurrentStep = 0,
|
|
@@ -29,21 +29,23 @@ export const Stepper= ({
|
|
|
29
29
|
allowStepClick = true,
|
|
30
30
|
allowStepNavigation = true,
|
|
31
31
|
showProgress = true,
|
|
32
|
-
// TODO
|
|
32
|
+
// TODO: Implement step status display in future version
|
|
33
|
+
// showStepStatus = true,
|
|
33
34
|
onStepComplete,
|
|
34
35
|
onStepError,
|
|
35
36
|
onFinish,
|
|
36
37
|
onCancel,
|
|
37
38
|
className = '',
|
|
38
|
-
'data-testid'= 'stepper',
|
|
39
|
+
'data-testid': testId = 'stepper',
|
|
39
40
|
}) => {
|
|
40
41
|
const [internalCurrentStep, setInternalCurrentStep] = useState<number>(
|
|
41
|
-
currentStep !== undefined ? currentStep
|
|
42
|
+
currentStep !== undefined ? currentStep : defaultCurrentStep
|
|
43
|
+
);
|
|
42
44
|
|
|
43
45
|
// Use controlled or uncontrolled current step
|
|
44
|
-
const currentStepIndex = currentStep !== undefined ? currentStep ;
|
|
46
|
+
const currentStepIndex = currentStep !== undefined ? currentStep : internalCurrentStep;
|
|
45
47
|
|
|
46
|
-
const handleStepClick = useCallback((stepIndex) => {
|
|
48
|
+
const handleStepClick = useCallback((stepIndex: number) => {
|
|
47
49
|
if (!allowStepClick || !allowStepNavigation) return;
|
|
48
50
|
|
|
49
51
|
const step = steps[stepIndex];
|
|
@@ -58,7 +60,7 @@ export const Stepper= ({
|
|
|
58
60
|
}
|
|
59
61
|
}, [currentStep, onStepChange, allowStepClick, allowStepNavigation, steps]);
|
|
60
62
|
|
|
61
|
-
const handleStepComplete = useCallback(async (stepIndex) => {
|
|
63
|
+
const handleStepComplete = useCallback(async (stepIndex: number) => {
|
|
62
64
|
const step = steps[stepIndex];
|
|
63
65
|
if (!step.validation) return;
|
|
64
66
|
|
|
@@ -101,18 +103,25 @@ export const Stepper= ({
|
|
|
101
103
|
|
|
102
104
|
const getSizeClasses = () => {
|
|
103
105
|
switch (size) {
|
|
104
|
-
case 'sm'
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
case 'sm':
|
|
107
|
+
return 'stepper--size-sm';
|
|
108
|
+
case 'lg':
|
|
109
|
+
return 'stepper--size-lg';
|
|
110
|
+
default: // md
|
|
111
|
+
return 'stepper--size-md';
|
|
107
112
|
}
|
|
108
113
|
};
|
|
109
114
|
|
|
110
115
|
const getVariantClasses = () => {
|
|
111
116
|
switch (variant) {
|
|
112
|
-
case 'vertical'
|
|
113
|
-
|
|
114
|
-
case '
|
|
115
|
-
|
|
117
|
+
case 'vertical':
|
|
118
|
+
return 'stepper--vertical';
|
|
119
|
+
case 'horizontal':
|
|
120
|
+
return 'stepper--horizontal';
|
|
121
|
+
case 'wizard':
|
|
122
|
+
return 'stepper--wizard';
|
|
123
|
+
default:
|
|
124
|
+
return 'stepper--default';
|
|
116
125
|
}
|
|
117
126
|
};
|
|
118
127
|
|
|
@@ -120,7 +129,7 @@ export const Stepper= ({
|
|
|
120
129
|
return 'stepper stepper--stan-design';
|
|
121
130
|
};
|
|
122
131
|
|
|
123
|
-
const getStepStatusIcon = (step, stepIndex) => {
|
|
132
|
+
const getStepStatusIcon = (step: StepItem, stepIndex: number) => {
|
|
124
133
|
if (!showStepIcons) return null;
|
|
125
134
|
|
|
126
135
|
if (step.status === 'completed') {
|
|
@@ -150,7 +159,7 @@ export const Stepper= ({
|
|
|
150
159
|
return null;
|
|
151
160
|
};
|
|
152
161
|
|
|
153
|
-
const getStepClasses = (step, stepIndex) => {
|
|
162
|
+
const getStepClasses = (step: StepItem, stepIndex: number) => {
|
|
154
163
|
let classes = 'stepper__step';
|
|
155
164
|
|
|
156
165
|
if (step.disabled) {
|
|
@@ -187,7 +196,7 @@ export const Stepper= ({
|
|
|
187
196
|
<div
|
|
188
197
|
className="stepper__progress-bar"
|
|
189
198
|
style={{
|
|
190
|
-
width}%`
|
|
199
|
+
width: `${progressPercentage}%`
|
|
191
200
|
}}
|
|
192
201
|
/>
|
|
193
202
|
</div>
|
|
@@ -199,15 +208,15 @@ export const Stepper= ({
|
|
|
199
208
|
{steps.map((step, stepIndex) => (
|
|
200
209
|
<div
|
|
201
210
|
key={step.id}
|
|
202
|
-
className={`stepper__step-container ${variant === 'vertical' ? 'stepper__step-container--vertical' }`}
|
|
211
|
+
className={`stepper__step-container ${variant === 'vertical' ? 'stepper__step-container--vertical' : ''}`}
|
|
203
212
|
>
|
|
204
213
|
<div
|
|
205
|
-
className={`${getStepClasses(step, stepIndex)} ${variant === 'vertical' ? 'stepper__step--vertical' }`}
|
|
214
|
+
className={`${getStepClasses(step, stepIndex)} ${variant === 'vertical' ? 'stepper__step--vertical' : ''}`}
|
|
206
215
|
onClick={() => handleStepClick(stepIndex)}
|
|
207
216
|
>
|
|
208
217
|
{getStepStatusIcon(step, stepIndex)}
|
|
209
218
|
|
|
210
|
-
<div className={`stepper__step-content ${variant === 'vertical' ? 'stepper__step-content--vertical' }`}>
|
|
219
|
+
<div className={`stepper__step-content ${variant === 'vertical' ? 'stepper__step-content--vertical' : ''}`}>
|
|
211
220
|
{showStepLabels && (
|
|
212
221
|
<div className="stepper__step-label">
|
|
213
222
|
{step.label}
|
|
@@ -240,7 +249,7 @@ export const Stepper= ({
|
|
|
240
249
|
action.variant || 'default'
|
|
241
250
|
}`}
|
|
242
251
|
>
|
|
243
|
-
{action.loading ? 'Loading...' }
|
|
252
|
+
{action.loading ? 'Loading...' : action.label}
|
|
244
253
|
</button>
|
|
245
254
|
))}
|
|
246
255
|
</div>
|
|
@@ -277,7 +286,9 @@ export const Stepper= ({
|
|
|
277
286
|
>
|
|
278
287
|
Next
|
|
279
288
|
</button>
|
|
280
|
-
)
|
|
289
|
+
) : (
|
|
290
|
+
<button
|
|
291
|
+
onClick={handleFinish}
|
|
281
292
|
className="stepper__nav-button stepper__nav-button--finish"
|
|
282
293
|
>
|
|
283
294
|
Finish
|
|
@@ -9,13 +9,13 @@ import { CheckIcon, ExclamationTriangleIcon } from '@heroicons/react/24/outline'
|
|
|
9
9
|
import { StepperProps, StepItem } from './types';
|
|
10
10
|
|
|
11
11
|
// Simple icon components
|
|
12
|
-
const ExclamationCircleIcon}> = ({ className = '' }) => (
|
|
12
|
+
const ExclamationCircleIcon: React.FC<{ className?: string }> = ({ className = '' }) => (
|
|
13
13
|
<svg className={className} fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
14
14
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
15
15
|
</svg>
|
|
16
16
|
);
|
|
17
17
|
|
|
18
|
-
export const Stepper= ({
|
|
18
|
+
export const Stepper: React.FC<StepperProps> = ({
|
|
19
19
|
steps,
|
|
20
20
|
currentStep = 0,
|
|
21
21
|
defaultCurrentStep = 0,
|
|
@@ -29,21 +29,23 @@ export const Stepper= ({
|
|
|
29
29
|
allowStepClick = true,
|
|
30
30
|
allowStepNavigation = true,
|
|
31
31
|
showProgress = true,
|
|
32
|
-
// TODO
|
|
32
|
+
// TODO: Implement step status display in future version
|
|
33
|
+
// showStepStatus = true,
|
|
33
34
|
onStepComplete,
|
|
34
35
|
onStepError,
|
|
35
36
|
onFinish,
|
|
36
37
|
onCancel,
|
|
37
38
|
className = '',
|
|
38
|
-
'data-testid'= 'stepper',
|
|
39
|
+
'data-testid': testId = 'stepper',
|
|
39
40
|
}) => {
|
|
40
41
|
const [internalCurrentStep, setInternalCurrentStep] = useState<number>(
|
|
41
|
-
currentStep !== undefined ? currentStep
|
|
42
|
+
currentStep !== undefined ? currentStep : defaultCurrentStep
|
|
43
|
+
);
|
|
42
44
|
|
|
43
45
|
// Use controlled or uncontrolled current step
|
|
44
|
-
const currentStepIndex = currentStep !== undefined ? currentStep ;
|
|
46
|
+
const currentStepIndex = currentStep !== undefined ? currentStep : internalCurrentStep;
|
|
45
47
|
|
|
46
|
-
const handleStepClick = useCallback((stepIndex) => {
|
|
48
|
+
const handleStepClick = useCallback((stepIndex: number) => {
|
|
47
49
|
if (!allowStepClick || !allowStepNavigation) return;
|
|
48
50
|
|
|
49
51
|
const step = steps[stepIndex];
|
|
@@ -58,7 +60,7 @@ export const Stepper= ({
|
|
|
58
60
|
}
|
|
59
61
|
}, [currentStep, onStepChange, allowStepClick, allowStepNavigation, steps]);
|
|
60
62
|
|
|
61
|
-
const handleStepComplete = useCallback(async (stepIndex) => {
|
|
63
|
+
const handleStepComplete = useCallback(async (stepIndex: number) => {
|
|
62
64
|
const step = steps[stepIndex];
|
|
63
65
|
if (!step.validation) return;
|
|
64
66
|
|
|
@@ -101,18 +103,25 @@ export const Stepper= ({
|
|
|
101
103
|
|
|
102
104
|
const getSizeClasses = () => {
|
|
103
105
|
switch (size) {
|
|
104
|
-
case 'sm'
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
case 'sm':
|
|
107
|
+
return 'stepper--size-sm';
|
|
108
|
+
case 'lg':
|
|
109
|
+
return 'stepper--size-lg';
|
|
110
|
+
default: // md
|
|
111
|
+
return 'stepper--size-md';
|
|
107
112
|
}
|
|
108
113
|
};
|
|
109
114
|
|
|
110
115
|
const getVariantClasses = () => {
|
|
111
116
|
switch (variant) {
|
|
112
|
-
case 'vertical'
|
|
113
|
-
|
|
114
|
-
case '
|
|
115
|
-
|
|
117
|
+
case 'vertical':
|
|
118
|
+
return 'stepper--vertical';
|
|
119
|
+
case 'horizontal':
|
|
120
|
+
return 'stepper--horizontal';
|
|
121
|
+
case 'wizard':
|
|
122
|
+
return 'stepper--wizard';
|
|
123
|
+
default:
|
|
124
|
+
return 'stepper--default';
|
|
116
125
|
}
|
|
117
126
|
};
|
|
118
127
|
|
|
@@ -120,7 +129,7 @@ export const Stepper= ({
|
|
|
120
129
|
return 'stepper stepper--stan-design';
|
|
121
130
|
};
|
|
122
131
|
|
|
123
|
-
const getStepStatusIcon = (step, stepIndex) => {
|
|
132
|
+
const getStepStatusIcon = (step: StepItem, stepIndex: number) => {
|
|
124
133
|
if (!showStepIcons) return null;
|
|
125
134
|
|
|
126
135
|
if (step.status === 'completed') {
|
|
@@ -150,7 +159,7 @@ export const Stepper= ({
|
|
|
150
159
|
return null;
|
|
151
160
|
};
|
|
152
161
|
|
|
153
|
-
const getStepClasses = (step, stepIndex) => {
|
|
162
|
+
const getStepClasses = (step: StepItem, stepIndex: number) => {
|
|
154
163
|
let classes = 'stepper__step';
|
|
155
164
|
|
|
156
165
|
if (step.disabled) {
|
|
@@ -187,7 +196,7 @@ export const Stepper= ({
|
|
|
187
196
|
<div
|
|
188
197
|
className="stepper__progress-bar"
|
|
189
198
|
style={{
|
|
190
|
-
width}%`
|
|
199
|
+
width: `${progressPercentage}%`
|
|
191
200
|
}}
|
|
192
201
|
/>
|
|
193
202
|
</div>
|
|
@@ -199,15 +208,15 @@ export const Stepper= ({
|
|
|
199
208
|
{steps.map((step, stepIndex) => (
|
|
200
209
|
<div
|
|
201
210
|
key={step.id}
|
|
202
|
-
className={`stepper__step-container ${variant === 'vertical' ? 'stepper__step-container--vertical' }`}
|
|
211
|
+
className={`stepper__step-container ${variant === 'vertical' ? 'stepper__step-container--vertical' : ''}`}
|
|
203
212
|
>
|
|
204
213
|
<div
|
|
205
|
-
className={`${getStepClasses(step, stepIndex)} ${variant === 'vertical' ? 'stepper__step--vertical' }`}
|
|
214
|
+
className={`${getStepClasses(step, stepIndex)} ${variant === 'vertical' ? 'stepper__step--vertical' : ''}`}
|
|
206
215
|
onClick={() => handleStepClick(stepIndex)}
|
|
207
216
|
>
|
|
208
217
|
{getStepStatusIcon(step, stepIndex)}
|
|
209
218
|
|
|
210
|
-
<div className={`stepper__step-content ${variant === 'vertical' ? 'stepper__step-content--vertical' }`}>
|
|
219
|
+
<div className={`stepper__step-content ${variant === 'vertical' ? 'stepper__step-content--vertical' : ''}`}>
|
|
211
220
|
{showStepLabels && (
|
|
212
221
|
<div className="stepper__step-label">
|
|
213
222
|
{step.label}
|
|
@@ -240,7 +249,7 @@ export const Stepper= ({
|
|
|
240
249
|
action.variant || 'default'
|
|
241
250
|
}`}
|
|
242
251
|
>
|
|
243
|
-
{action.loading ? 'Loading...' }
|
|
252
|
+
{action.loading ? 'Loading...' : action.label}
|
|
244
253
|
</button>
|
|
245
254
|
))}
|
|
246
255
|
</div>
|
|
@@ -277,7 +286,9 @@ export const Stepper= ({
|
|
|
277
286
|
>
|
|
278
287
|
Next
|
|
279
288
|
</button>
|
|
280
|
-
)
|
|
289
|
+
) : (
|
|
290
|
+
<button
|
|
291
|
+
onClick={handleFinish}
|
|
281
292
|
className="stepper__nav-button stepper__nav-button--finish"
|
|
282
293
|
>
|
|
283
294
|
Finish
|
|
@@ -9,13 +9,13 @@ import { XMarkIcon } from '@heroicons/react/24/outline';
|
|
|
9
9
|
import { TabsProps, TabItem } from './types';
|
|
10
10
|
|
|
11
11
|
// Simple icon components
|
|
12
|
-
const PlusIcon}> = ({ className = '' }) => (
|
|
12
|
+
const PlusIcon: React.FC<{ className?: string }> = ({ className = '' }) => (
|
|
13
13
|
<svg className={className} fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
14
14
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 4v16m8-8H4" />
|
|
15
15
|
</svg>
|
|
16
16
|
);
|
|
17
17
|
|
|
18
|
-
export const Tabs= ({
|
|
18
|
+
export const Tabs: React.FC<TabsProps> = ({
|
|
19
19
|
tabs,
|
|
20
20
|
activeTab,
|
|
21
21
|
defaultActiveTab,
|
|
@@ -31,19 +31,20 @@ export const Tabs= ({
|
|
|
31
31
|
onTabClose,
|
|
32
32
|
addable = false,
|
|
33
33
|
onTabAdd,
|
|
34
|
-
// TODO
|
|
34
|
+
// TODO: Implement draggable functionality in future version
|
|
35
|
+
// draggable = false,
|
|
35
36
|
// onTabsReorder,
|
|
36
37
|
className = '',
|
|
37
|
-
'data-testid'= 'tabs',
|
|
38
|
+
'data-testid': testId = 'tabs',
|
|
38
39
|
}) => {
|
|
39
40
|
const [internalActiveTab, setInternalActiveTab] = useState<string>(
|
|
40
|
-
activeTab || defaultActiveTab || (tabs.length > 0 ? tabs[0].id )
|
|
41
|
+
activeTab || defaultActiveTab || (tabs.length > 0 ? tabs[0].id : '')
|
|
41
42
|
);
|
|
42
43
|
|
|
43
44
|
// Use controlled or uncontrolled active tab
|
|
44
|
-
const currentActiveTab = activeTab !== undefined ? activeTab ;
|
|
45
|
+
const currentActiveTab = activeTab !== undefined ? activeTab : internalActiveTab;
|
|
45
46
|
|
|
46
|
-
const handleTabChange = useCallback((tabId) => {
|
|
47
|
+
const handleTabChange = useCallback((tabId: string) => {
|
|
47
48
|
if (disabled || loading) return;
|
|
48
49
|
|
|
49
50
|
if (activeTab === undefined) {
|
|
@@ -55,7 +56,7 @@ export const Tabs= ({
|
|
|
55
56
|
}
|
|
56
57
|
}, [activeTab, onTabChange, disabled, loading]);
|
|
57
58
|
|
|
58
|
-
const handleTabClose = useCallback((tabId, event) => {
|
|
59
|
+
const handleTabClose = useCallback((tabId: string, event: React.MouseEvent) => {
|
|
59
60
|
event.stopPropagation();
|
|
60
61
|
if (onTabClose) {
|
|
61
62
|
onTabClose(tabId);
|
|
@@ -75,23 +76,31 @@ export const Tabs= ({
|
|
|
75
76
|
|
|
76
77
|
const getSizeClasses = () => {
|
|
77
78
|
switch (size) {
|
|
78
|
-
case 'sm'
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
case 'sm':
|
|
80
|
+
return 'tabs__item--small';
|
|
81
|
+
case 'lg':
|
|
82
|
+
return 'tabs__item--large';
|
|
83
|
+
default: // md
|
|
84
|
+
return 'tabs__item--medium';
|
|
81
85
|
}
|
|
82
86
|
};
|
|
83
87
|
|
|
84
|
-
const getVariantClasses = (isActive, isDisabled) => {
|
|
88
|
+
const getVariantClasses = (isActive: boolean, isDisabled: boolean) => {
|
|
85
89
|
if (isDisabled) {
|
|
86
90
|
return 'tabs__item--disabled';
|
|
87
91
|
}
|
|
88
92
|
|
|
89
93
|
switch (variant) {
|
|
90
|
-
case 'pills'
|
|
91
|
-
|
|
92
|
-
case '
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
case 'pills':
|
|
95
|
+
return isActive ? 'tabs__item--pills tabs__item--active' : 'tabs__item--pills';
|
|
96
|
+
case 'underline':
|
|
97
|
+
return isActive ? 'tabs__item--underline tabs__item--active' : 'tabs__item--underline';
|
|
98
|
+
case 'cards':
|
|
99
|
+
return isActive ? 'tabs__item--cards tabs__item--active' : 'tabs__item--cards';
|
|
100
|
+
case 'minimal':
|
|
101
|
+
return isActive ? 'tabs__item--minimal tabs__item--active' : 'tabs__item--minimal';
|
|
102
|
+
default: // default
|
|
103
|
+
return isActive ? 'tabs__item--default tabs__item--active' : 'tabs__item--default';
|
|
95
104
|
}
|
|
96
105
|
};
|
|
97
106
|
|
|
@@ -113,7 +122,7 @@ export const Tabs= ({
|
|
|
113
122
|
return baseClasses;
|
|
114
123
|
};
|
|
115
124
|
|
|
116
|
-
const getTabClasses = (tab) => {
|
|
125
|
+
const getTabClasses = (tab: TabItem) => {
|
|
117
126
|
const isActive = tab.id === currentActiveTab;
|
|
118
127
|
const isDisabled = tab.disabled || disabled;
|
|
119
128
|
|
|
@@ -135,7 +144,7 @@ export const Tabs= ({
|
|
|
135
144
|
}
|
|
136
145
|
|
|
137
146
|
return (
|
|
138
|
-
<div className={`tabs ${orientation === 'vertical' ? 'tabs--vertical' } ${className}`} data-testid={testId}>
|
|
147
|
+
<div className={`tabs ${orientation === 'vertical' ? 'tabs--vertical' : ''} ${className}`} data-testid={testId}>
|
|
139
148
|
{/* Tab List */}
|
|
140
149
|
<div className={getTabListClasses()}>
|
|
141
150
|
{tabs.map((tab) => (
|
|
@@ -177,7 +186,7 @@ export const Tabs= ({
|
|
|
177
186
|
|
|
178
187
|
{/* Tab Panels */}
|
|
179
188
|
<div
|
|
180
|
-
className={`tabs__content ${orientation === 'vertical' ? 'tabs__content--vertical' }`}
|
|
189
|
+
className={`tabs__content ${orientation === 'vertical' ? 'tabs__content--vertical' : ''}`}
|
|
181
190
|
role="tabpanel"
|
|
182
191
|
aria-labelledby={`tab-${currentActiveTab}`}
|
|
183
192
|
>
|
|
@@ -185,7 +194,9 @@ export const Tabs= ({
|
|
|
185
194
|
<div className="tabs__loading">
|
|
186
195
|
<div className="tabs__loading-spinner"></div>
|
|
187
196
|
</div>
|
|
188
|
-
)
|
|
197
|
+
) : (
|
|
198
|
+
currentTabContent
|
|
199
|
+
)}
|
|
189
200
|
</div>
|
|
190
201
|
</div>
|
|
191
202
|
);
|
|
@@ -9,13 +9,13 @@ import { XMarkIcon } from '@heroicons/react/24/outline';
|
|
|
9
9
|
import { TabsProps, TabItem } from './types';
|
|
10
10
|
|
|
11
11
|
// Simple icon components
|
|
12
|
-
const PlusIcon}> = ({ className = '' }) => (
|
|
12
|
+
const PlusIcon: React.FC<{ className?: string }> = ({ className = '' }) => (
|
|
13
13
|
<svg className={className} fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
14
14
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 4v16m8-8H4" />
|
|
15
15
|
</svg>
|
|
16
16
|
);
|
|
17
17
|
|
|
18
|
-
export const Tabs= ({
|
|
18
|
+
export const Tabs: React.FC<TabsProps> = ({
|
|
19
19
|
tabs,
|
|
20
20
|
activeTab,
|
|
21
21
|
defaultActiveTab,
|
|
@@ -31,19 +31,20 @@ export const Tabs= ({
|
|
|
31
31
|
onTabClose,
|
|
32
32
|
addable = false,
|
|
33
33
|
onTabAdd,
|
|
34
|
-
// TODO
|
|
34
|
+
// TODO: Implement draggable functionality in future version
|
|
35
|
+
// draggable = false,
|
|
35
36
|
// onTabsReorder,
|
|
36
37
|
className = '',
|
|
37
|
-
'data-testid'= 'tabs',
|
|
38
|
+
'data-testid': testId = 'tabs',
|
|
38
39
|
}) => {
|
|
39
40
|
const [internalActiveTab, setInternalActiveTab] = useState<string>(
|
|
40
|
-
activeTab || defaultActiveTab || (tabs.length > 0 ? tabs[0].id )
|
|
41
|
+
activeTab || defaultActiveTab || (tabs.length > 0 ? tabs[0].id : '')
|
|
41
42
|
);
|
|
42
43
|
|
|
43
44
|
// Use controlled or uncontrolled active tab
|
|
44
|
-
const currentActiveTab = activeTab !== undefined ? activeTab ;
|
|
45
|
+
const currentActiveTab = activeTab !== undefined ? activeTab : internalActiveTab;
|
|
45
46
|
|
|
46
|
-
const handleTabChange = useCallback((tabId) => {
|
|
47
|
+
const handleTabChange = useCallback((tabId: string) => {
|
|
47
48
|
if (disabled || loading) return;
|
|
48
49
|
|
|
49
50
|
if (activeTab === undefined) {
|
|
@@ -55,7 +56,7 @@ export const Tabs= ({
|
|
|
55
56
|
}
|
|
56
57
|
}, [activeTab, onTabChange, disabled, loading]);
|
|
57
58
|
|
|
58
|
-
const handleTabClose = useCallback((tabId, event) => {
|
|
59
|
+
const handleTabClose = useCallback((tabId: string, event: React.MouseEvent) => {
|
|
59
60
|
event.stopPropagation();
|
|
60
61
|
if (onTabClose) {
|
|
61
62
|
onTabClose(tabId);
|
|
@@ -75,23 +76,31 @@ export const Tabs= ({
|
|
|
75
76
|
|
|
76
77
|
const getSizeClasses = () => {
|
|
77
78
|
switch (size) {
|
|
78
|
-
case 'sm'
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
case 'sm':
|
|
80
|
+
return 'tabs__item--small';
|
|
81
|
+
case 'lg':
|
|
82
|
+
return 'tabs__item--large';
|
|
83
|
+
default: // md
|
|
84
|
+
return 'tabs__item--medium';
|
|
81
85
|
}
|
|
82
86
|
};
|
|
83
87
|
|
|
84
|
-
const getVariantClasses = (isActive, isDisabled) => {
|
|
88
|
+
const getVariantClasses = (isActive: boolean, isDisabled: boolean) => {
|
|
85
89
|
if (isDisabled) {
|
|
86
90
|
return 'tabs__item--disabled';
|
|
87
91
|
}
|
|
88
92
|
|
|
89
93
|
switch (variant) {
|
|
90
|
-
case 'pills'
|
|
91
|
-
|
|
92
|
-
case '
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
case 'pills':
|
|
95
|
+
return isActive ? 'tabs__item--pills tabs__item--active' : 'tabs__item--pills';
|
|
96
|
+
case 'underline':
|
|
97
|
+
return isActive ? 'tabs__item--underline tabs__item--active' : 'tabs__item--underline';
|
|
98
|
+
case 'cards':
|
|
99
|
+
return isActive ? 'tabs__item--cards tabs__item--active' : 'tabs__item--cards';
|
|
100
|
+
case 'minimal':
|
|
101
|
+
return isActive ? 'tabs__item--minimal tabs__item--active' : 'tabs__item--minimal';
|
|
102
|
+
default: // default
|
|
103
|
+
return isActive ? 'tabs__item--default tabs__item--active' : 'tabs__item--default';
|
|
95
104
|
}
|
|
96
105
|
};
|
|
97
106
|
|
|
@@ -113,7 +122,7 @@ export const Tabs= ({
|
|
|
113
122
|
return baseClasses;
|
|
114
123
|
};
|
|
115
124
|
|
|
116
|
-
const getTabClasses = (tab) => {
|
|
125
|
+
const getTabClasses = (tab: TabItem) => {
|
|
117
126
|
const isActive = tab.id === currentActiveTab;
|
|
118
127
|
const isDisabled = tab.disabled || disabled;
|
|
119
128
|
|
|
@@ -135,7 +144,7 @@ export const Tabs= ({
|
|
|
135
144
|
}
|
|
136
145
|
|
|
137
146
|
return (
|
|
138
|
-
<div className={`tabs ${orientation === 'vertical' ? 'tabs--vertical' } ${className}`} data-testid={testId}>
|
|
147
|
+
<div className={`tabs ${orientation === 'vertical' ? 'tabs--vertical' : ''} ${className}`} data-testid={testId}>
|
|
139
148
|
{/* Tab List */}
|
|
140
149
|
<div className={getTabListClasses()}>
|
|
141
150
|
{tabs.map((tab) => (
|
|
@@ -177,7 +186,7 @@ export const Tabs= ({
|
|
|
177
186
|
|
|
178
187
|
{/* Tab Panels */}
|
|
179
188
|
<div
|
|
180
|
-
className={`tabs__content ${orientation === 'vertical' ? 'tabs__content--vertical' }`}
|
|
189
|
+
className={`tabs__content ${orientation === 'vertical' ? 'tabs__content--vertical' : ''}`}
|
|
181
190
|
role="tabpanel"
|
|
182
191
|
aria-labelledby={`tab-${currentActiveTab}`}
|
|
183
192
|
>
|
|
@@ -185,7 +194,9 @@ export const Tabs= ({
|
|
|
185
194
|
<div className="tabs__loading">
|
|
186
195
|
<div className="tabs__loading-spinner"></div>
|
|
187
196
|
</div>
|
|
188
|
-
)
|
|
197
|
+
) : (
|
|
198
|
+
currentTabContent
|
|
199
|
+
)}
|
|
189
200
|
</div>
|
|
190
201
|
</div>
|
|
191
202
|
);
|