@campxdev/react-blueprint 3.0.0-alpha.7 → 3.0.0-alpha.9
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/cjs/index.js +1 -1
- package/dist/cjs/types/src/components/Assets/Icons/IconComponents/CampxFullLogoIcon.d.ts +3 -1
- package/dist/cjs/types/src/components/Charts/TreeMap/TreeMap.d.ts +1 -2
- package/dist/cjs/types/src/components/DataDisplay/DataTable/components/TableHeaders/TableActionHeader.d.ts +2 -1
- package/dist/cjs/types/src/components/Input/MultiSelect/MultiSelect.d.ts +5 -1
- package/dist/cjs/types/src/components/Input/MultiSelect/components/MultiSelectInput.d.ts +1 -1
- package/dist/cjs/types/src/components/Input/SingleSelect/SingleSelect.d.ts +5 -1
- package/dist/cjs/types/src/components/Input/SingleSelect/components/SingleInput.d.ts +1 -1
- package/dist/cjs/types/src/components/Layout/AppLayout/AppLayout.d.ts +0 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/types/src/components/Assets/Icons/IconComponents/CampxFullLogoIcon.d.ts +3 -1
- package/dist/esm/types/src/components/Charts/TreeMap/TreeMap.d.ts +1 -2
- package/dist/esm/types/src/components/DataDisplay/DataTable/components/TableHeaders/TableActionHeader.d.ts +2 -1
- package/dist/esm/types/src/components/Input/MultiSelect/MultiSelect.d.ts +5 -1
- package/dist/esm/types/src/components/Input/MultiSelect/components/MultiSelectInput.d.ts +1 -1
- package/dist/esm/types/src/components/Input/SingleSelect/SingleSelect.d.ts +5 -1
- package/dist/esm/types/src/components/Input/SingleSelect/components/SingleInput.d.ts +1 -1
- package/dist/esm/types/src/components/Layout/AppLayout/AppLayout.d.ts +0 -1
- package/dist/index.d.ts +63 -4
- package/dist/styles.css +15 -0
- package/package.json +1 -1
- package/src/components/Assets/Icons/IconComponents/CampxFullLogoIcon.tsx +134 -19
- package/src/components/Charts/TreeMap/TreeMap.tsx +1 -3
- package/src/components/DataDisplay/DataTable/DataTable.tsx +1 -0
- package/src/components/DataDisplay/DataTable/components/CardsView.tsx +1 -1
- package/src/components/DataDisplay/DataTable/components/TableHeaders/TableActionHeader.tsx +21 -18
- package/src/components/Input/DatePicker/components/DatePickerInput.tsx +1 -1
- package/src/components/Input/DateTimePicker/components/DateTimePickerInput.tsx +2 -4
- package/src/components/Input/MultiSelect/MultiSelect.tsx +18 -8
- package/src/components/Input/MultiSelect/components/MultiSelectInput.tsx +2 -3
- package/src/components/Input/PasswordField/PasswordField.tsx +4 -1
- package/src/components/Input/SingleSelect/SingleSelect.tsx +23 -12
- package/src/components/Input/SingleSelect/components/SingleInput.tsx +2 -1
- package/src/components/Layout/AppLayout/AppLayout.tsx +0 -4
- package/src/components/Layout/PageContent/PageContent.tsx +1 -1
- package/src/components/Navigation/Dialog/Dialog.tsx +1 -0
- package/src/components/Navigation/DialogButton/DialogButton.tsx +2 -1
- package/src/components/Navigation/Stepper/HorizontalStepper.tsx +94 -51
- package/src/components/Navigation/Stepper/VerticalStepper.tsx +44 -4
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
2
|
import { Typography } from '@/shadcn-components/DataDisplay/Typography/Typography';
|
|
3
|
-
import { Button } from '@/shadcn-components/Input/Button/Button';
|
|
4
3
|
import { Check } from 'lucide-react';
|
|
5
4
|
import React from 'react';
|
|
6
5
|
import { StepperVariantProps } from './Stepper';
|
|
@@ -10,6 +9,48 @@ import {
|
|
|
10
9
|
handleStepClick as handleStepClickUtil,
|
|
11
10
|
} from './utils';
|
|
12
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Native HTML button component for step indicators
|
|
14
|
+
* Uses forwardRef to properly expose DOM node for positioning calculations
|
|
15
|
+
*/
|
|
16
|
+
interface StepIndicatorProps
|
|
17
|
+
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
18
|
+
variant?: 'default' | 'secondary' | 'inactive';
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const StepIndicator = React.forwardRef<HTMLButtonElement, StepIndicatorProps>(
|
|
23
|
+
function StepIndicator(
|
|
24
|
+
{ variant = 'default', className, children, ...props },
|
|
25
|
+
ref,
|
|
26
|
+
) {
|
|
27
|
+
const baseStyles =
|
|
28
|
+
'inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 outline-none focus-visible:ring-2 focus-visible:ring-offset-2 h-8 w-8 rounded-full duration-200';
|
|
29
|
+
|
|
30
|
+
const variantStyles = {
|
|
31
|
+
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
|
|
32
|
+
secondary:
|
|
33
|
+
'bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
34
|
+
inactive: 'bg-muted text-muted-foreground hover:bg-muted/80',
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<button
|
|
39
|
+
ref={ref}
|
|
40
|
+
className={cn(
|
|
41
|
+
baseStyles,
|
|
42
|
+
variantStyles[variant],
|
|
43
|
+
'cursor-pointer',
|
|
44
|
+
className,
|
|
45
|
+
)}
|
|
46
|
+
{...props}
|
|
47
|
+
>
|
|
48
|
+
{children}
|
|
49
|
+
</button>
|
|
50
|
+
);
|
|
51
|
+
},
|
|
52
|
+
);
|
|
53
|
+
|
|
13
54
|
const VerticalStepper: React.FC<StepperVariantProps> = ({
|
|
14
55
|
activeStep,
|
|
15
56
|
steps,
|
|
@@ -34,19 +75,18 @@ const VerticalStepper: React.FC<StepperVariantProps> = ({
|
|
|
34
75
|
{/* Left side: Indicator + Connector */}
|
|
35
76
|
<div className="flex flex-col items-center">
|
|
36
77
|
{/* Step Indicator */}
|
|
37
|
-
<
|
|
78
|
+
<StepIndicator
|
|
38
79
|
onClick={
|
|
39
80
|
isClickable ? () => handleStepClick(index) : () => {}
|
|
40
81
|
}
|
|
41
82
|
variant={state === 'inactive' ? 'secondary' : 'default'}
|
|
42
|
-
className="h-8 w-8 rounded-full duration-200"
|
|
43
83
|
>
|
|
44
84
|
{state === 'completed' ? (
|
|
45
85
|
<Check className="w-4 h-4" />
|
|
46
86
|
) : (
|
|
47
87
|
index + 1
|
|
48
88
|
)}
|
|
49
|
-
</
|
|
89
|
+
</StepIndicator>
|
|
50
90
|
|
|
51
91
|
{/* Vertical Connector */}
|
|
52
92
|
{!isLast && (
|