@campxdev/react-blueprint 2.2.9 → 2.3.1
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/Navigation/Stepper/Stepper.d.ts +37 -1
- package/dist/cjs/types/src/components/Navigation/Stepper/StepperComponents.d.ts +3 -1
- package/dist/cjs/types/src/stories/Navigation/Stepper.stories.d.ts +3 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/types/src/components/Navigation/Stepper/Stepper.d.ts +37 -1
- package/dist/esm/types/src/components/Navigation/Stepper/StepperComponents.d.ts +3 -1
- package/dist/esm/types/src/stories/Navigation/Stepper.stories.d.ts +3 -0
- package/dist/index.d.ts +37 -1
- package/package.json +1 -1
- package/src/components/Layout/PageContent/PageContent.tsx +1 -0
- package/src/components/Navigation/Stepper/Stepper.tsx +60 -1
- package/src/components/Navigation/Stepper/StepperComponents.tsx +21 -8
- package/src/stories/Navigation/Stepper.stories.tsx +68 -1
|
@@ -1,13 +1,49 @@
|
|
|
1
1
|
import { SxProps } from '@mui/material';
|
|
2
2
|
interface StepperProps {
|
|
3
|
+
/** Orientation of the stepper */
|
|
3
4
|
orientation: 'vertical' | 'horizontal';
|
|
5
|
+
/** Current active step index (0-based) */
|
|
4
6
|
activeStep: number;
|
|
7
|
+
/** Array of step items with labels and optional descriptions */
|
|
5
8
|
steps: StepItem[];
|
|
9
|
+
/** Additional styles for the container */
|
|
6
10
|
containerSx: SxProps;
|
|
11
|
+
/** Callback function called when a step is clicked. Receives the step index as parameter */
|
|
12
|
+
onStepClick?: (stepIndex: number) => void;
|
|
13
|
+
/** Whether to allow navigation by clicking on steps. Defaults to true */
|
|
14
|
+
allowNavigation?: boolean;
|
|
7
15
|
}
|
|
8
16
|
interface StepItem {
|
|
17
|
+
/** The label text for the step */
|
|
9
18
|
label: string;
|
|
19
|
+
/** Optional description text shown below the label */
|
|
10
20
|
description?: string;
|
|
11
21
|
}
|
|
12
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Enhanced Stepper component with navigation capabilities
|
|
24
|
+
*
|
|
25
|
+
* Features:
|
|
26
|
+
* - Click on any step to navigate to it (when allowNavigation is true)
|
|
27
|
+
* - Supports both vertical and horizontal orientations
|
|
28
|
+
* - Customizable styling through containerSx prop
|
|
29
|
+
* - Optional step descriptions
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* const [activeStep, setActiveStep] = useState(0);
|
|
34
|
+
*
|
|
35
|
+
* <Stepper
|
|
36
|
+
* orientation="vertical"
|
|
37
|
+
* activeStep={activeStep}
|
|
38
|
+
* steps={[
|
|
39
|
+
* { label: "Step 1", description: "First step" },
|
|
40
|
+
* { label: "Step 2", description: "Second step" }
|
|
41
|
+
* ]}
|
|
42
|
+
* onStepClick={(stepIndex) => setActiveStep(stepIndex)}
|
|
43
|
+
* allowNavigation={true}
|
|
44
|
+
* containerSx={{}}
|
|
45
|
+
* />
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare const Stepper: ({ orientation, steps, activeStep, containerSx, onStepClick, allowNavigation, }: StepperProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
49
|
export {};
|
|
@@ -9,5 +9,7 @@ interface ConnectorProps {
|
|
|
9
9
|
isVertical: boolean;
|
|
10
10
|
}
|
|
11
11
|
export declare const Connector: import("@mui/styled-engine").StyledComponent<import("@mui/material").StepConnectorProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & ConnectorProps, {}, {}>;
|
|
12
|
-
export declare function StepIcon(props: StepIconProps
|
|
12
|
+
export declare function StepIcon(props: StepIconProps & {
|
|
13
|
+
onClick?: () => void;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
export {};
|
|
@@ -4,6 +4,9 @@ declare const meta: Meta<typeof Stepper>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof Stepper>;
|
|
6
6
|
export declare const VerticalStepper: Story;
|
|
7
|
+
export declare const InteractiveVerticalStepper: Story;
|
|
7
8
|
export declare const VerticalStepperWithNoDescription: Story;
|
|
8
9
|
export declare const HorizontalStepper: Story;
|
|
10
|
+
export declare const InteractiveHorizontalStepper: Story;
|
|
11
|
+
export declare const NonNavigableStepper: Story;
|
|
9
12
|
export declare const HorizontalStepperWithNoDescription: Story;
|