@dynamic-mockups/design-system 0.2.11 → 0.2.13
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/design-system.css +1 -1
- package/dist/index.js +18 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2668 -2627
- package/dist/index.mjs.map +1 -1
- package/dist/src/components/organisms/FlagBadMockups/FlagBadMockups.d.ts +93 -2
- package/dist/src/components/organisms/FlagBadMockups/FlagBadMockups.stories.d.ts +32 -0
- package/dist/src/components/organisms/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,16 +1,100 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* FlagBadMockups Organism
|
|
3
|
-
* A multi-step modal flow for
|
|
4
|
-
* Flow:
|
|
3
|
+
* A configurable multi-step modal flow for collecting user feedback
|
|
4
|
+
* Flow: Selection Modal → Form Modal (conditional) → Confirmation Modal
|
|
5
5
|
*/
|
|
6
6
|
import React from "react";
|
|
7
7
|
import "./FlagBadMockups.scss";
|
|
8
8
|
export type { ColorToken } from "../../../tokens";
|
|
9
|
+
type ModalStep = "selection" | "form" | "confirmation";
|
|
10
|
+
/**
|
|
11
|
+
* Radio option configuration
|
|
12
|
+
*/
|
|
13
|
+
export interface FlagOption {
|
|
14
|
+
/** Unique value identifier */
|
|
15
|
+
value: string;
|
|
16
|
+
/** Display label for the option */
|
|
17
|
+
label: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Selection step configuration (Step 1)
|
|
21
|
+
*/
|
|
22
|
+
export interface SelectionStepConfig {
|
|
23
|
+
/** Modal title */
|
|
24
|
+
title: string;
|
|
25
|
+
/** Modal description */
|
|
26
|
+
description: string;
|
|
27
|
+
/** Radio options to display */
|
|
28
|
+
options: FlagOption[];
|
|
29
|
+
/** Continue button text */
|
|
30
|
+
continueButtonText?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Form step configuration (Step 2 - conditional)
|
|
34
|
+
*/
|
|
35
|
+
export interface FormStepConfig {
|
|
36
|
+
/** Modal title */
|
|
37
|
+
title: string;
|
|
38
|
+
/** Modal description */
|
|
39
|
+
description: string;
|
|
40
|
+
/** Textarea placeholder text */
|
|
41
|
+
placeholder?: string;
|
|
42
|
+
/** Back button text */
|
|
43
|
+
backButtonText?: string;
|
|
44
|
+
/** Submit button text */
|
|
45
|
+
submitButtonText?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Confirmation step configuration (Step 3)
|
|
49
|
+
*/
|
|
50
|
+
export interface ConfirmationStepConfig {
|
|
51
|
+
/** Modal title */
|
|
52
|
+
title: string;
|
|
53
|
+
/** Modal description */
|
|
54
|
+
description: string;
|
|
55
|
+
/** Optional link text */
|
|
56
|
+
linkText?: string;
|
|
57
|
+
/** Optional link URL */
|
|
58
|
+
linkUrl?: string;
|
|
59
|
+
/** Optional link click handler (if no URL provided) */
|
|
60
|
+
onLinkClick?: () => void;
|
|
61
|
+
/** Close button text */
|
|
62
|
+
closeButtonText?: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Complete flow configuration
|
|
66
|
+
*/
|
|
67
|
+
export interface FlagBadMockupsConfig {
|
|
68
|
+
/** Configuration for the selection step */
|
|
69
|
+
selectionStep: SelectionStepConfig;
|
|
70
|
+
/** Configuration for the form step */
|
|
71
|
+
formStep: FormStepConfig;
|
|
72
|
+
/** Configuration for the confirmation step */
|
|
73
|
+
confirmationStep: ConfirmationStepConfig;
|
|
74
|
+
/**
|
|
75
|
+
* Value(s) that trigger the form step when selected
|
|
76
|
+
* Can be a single value or array of values
|
|
77
|
+
*/
|
|
78
|
+
formTriggerValues: string | string[];
|
|
79
|
+
}
|
|
9
80
|
export interface FlagBadMockupsProps {
|
|
81
|
+
/**
|
|
82
|
+
* Flow configuration object
|
|
83
|
+
* If not provided, uses default flag mockup configuration
|
|
84
|
+
*/
|
|
85
|
+
config?: FlagBadMockupsConfig;
|
|
10
86
|
/**
|
|
11
87
|
* Trigger button element (optional, defaults to "Flag this mockup" button)
|
|
12
88
|
*/
|
|
13
89
|
trigger?: React.ReactNode;
|
|
90
|
+
/**
|
|
91
|
+
* Controlled open state
|
|
92
|
+
*/
|
|
93
|
+
open?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Callback when open state changes
|
|
96
|
+
*/
|
|
97
|
+
onOpenChange?: (open: boolean) => void;
|
|
14
98
|
/**
|
|
15
99
|
* Callback when the flow is closed
|
|
16
100
|
*/
|
|
@@ -19,6 +103,13 @@ export interface FlagBadMockupsProps {
|
|
|
19
103
|
* Callback when feedback is submitted with selected reason and optional feedback text
|
|
20
104
|
*/
|
|
21
105
|
onSubmit?: (reason: string, feedback?: string) => void;
|
|
106
|
+
/**
|
|
107
|
+
* Callback when step changes
|
|
108
|
+
*/
|
|
109
|
+
onStepChange?: (step: ModalStep, data: {
|
|
110
|
+
reason: string;
|
|
111
|
+
feedback?: string;
|
|
112
|
+
}) => void;
|
|
22
113
|
/**
|
|
23
114
|
* Custom className
|
|
24
115
|
*/
|
|
@@ -8,6 +8,13 @@ declare const meta: {
|
|
|
8
8
|
};
|
|
9
9
|
tags: string[];
|
|
10
10
|
argTypes: {
|
|
11
|
+
config: {
|
|
12
|
+
control: "object";
|
|
13
|
+
description: string;
|
|
14
|
+
table: {
|
|
15
|
+
category: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
11
18
|
trigger: {
|
|
12
19
|
control: false;
|
|
13
20
|
description: string;
|
|
@@ -15,6 +22,20 @@ declare const meta: {
|
|
|
15
22
|
category: string;
|
|
16
23
|
};
|
|
17
24
|
};
|
|
25
|
+
open: {
|
|
26
|
+
control: "boolean";
|
|
27
|
+
description: string;
|
|
28
|
+
table: {
|
|
29
|
+
category: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
onOpenChange: {
|
|
33
|
+
control: false;
|
|
34
|
+
description: string;
|
|
35
|
+
table: {
|
|
36
|
+
category: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
18
39
|
onClose: {
|
|
19
40
|
control: false;
|
|
20
41
|
description: string;
|
|
@@ -29,6 +50,13 @@ declare const meta: {
|
|
|
29
50
|
category: string;
|
|
30
51
|
};
|
|
31
52
|
};
|
|
53
|
+
onStepChange: {
|
|
54
|
+
control: false;
|
|
55
|
+
description: string;
|
|
56
|
+
table: {
|
|
57
|
+
category: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
32
60
|
className: {
|
|
33
61
|
control: "text";
|
|
34
62
|
description: string;
|
|
@@ -41,6 +69,10 @@ declare const meta: {
|
|
|
41
69
|
export default meta;
|
|
42
70
|
type Story = StoryObj<typeof meta>;
|
|
43
71
|
export declare const Default: Story;
|
|
72
|
+
export declare const CustomConfig: Story;
|
|
73
|
+
export declare const ProductFeedback: Story;
|
|
44
74
|
export declare const CustomTrigger: Story;
|
|
45
75
|
export declare const InteractiveDemo: Story;
|
|
76
|
+
export declare const ControlledState: Story;
|
|
46
77
|
export declare const FlowExample: Story;
|
|
78
|
+
export declare const MinimalOverride: Story;
|
|
@@ -7,4 +7,4 @@ export type { OnboardingInfoBoxProps, OnboardingInfoItem, } from "./OnboardingIn
|
|
|
7
7
|
export { CTABox } from "./CTABox/CTABox";
|
|
8
8
|
export type { CTABoxProps } from "./CTABox/CTABox";
|
|
9
9
|
export { FlagBadMockups } from "./FlagBadMockups/FlagBadMockups";
|
|
10
|
-
export type { FlagBadMockupsProps } from "./FlagBadMockups/FlagBadMockups";
|
|
10
|
+
export type { FlagBadMockupsProps, FlagBadMockupsConfig, FlagOption, SelectionStepConfig, FormStepConfig, ConfirmationStepConfig, } from "./FlagBadMockups/FlagBadMockups";
|
package/package.json
CHANGED