@dynamic-mockups/design-system 0.2.10 → 0.2.12

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.
@@ -1,16 +1,100 @@
1
1
  /**
2
2
  * FlagBadMockups Organism
3
- * A multi-step modal flow for flagging bad mockups
4
- * Flow: Flag Modal → Form Modal (if "Something else") → Info Modal
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";
@@ -24,8 +24,8 @@ import type { OnboardingFlowConfig } from "./OnboardingFlow.types";
24
24
  *
25
25
  * BUILDING PRODUCT/WORKFLOW PATH (building-product):
26
26
  * 1. Journey stage → 2. Business type → Branch:
27
- * - If "Startup": 3. Role & Team size (combined) → 4. Startup Builder result (4 steps)
28
- * - If "Established Company": 3. Role & Team size (combined) → 4. Enterprise Partner result (4 steps)
27
+ * - If "Startup": 3. Role & Team size (combined) → 4. Website → 5. Startup Builder result (5 steps)
28
+ * - If "Established Company": 3. Role & Team size (combined) → 4. Website → 5. Enterprise Partner result (5 steps)
29
29
  * - If "Agency/Automation/Solopreneur": 3. Integration type → Branch:
30
30
  * * "Simple": Embed Builder result (4 steps)
31
31
  * * "Automations": Workflow Automator result (4 steps)
@@ -8,7 +8,7 @@ import type { OnboardingInfoItem } from "../../organisms/OnboardingInfoBox/Onboa
8
8
  /**
9
9
  * Type of onboarding step variation
10
10
  */
11
- export type OnboardingStepType = "radio" | "checkbox-no-icon" | "checkbox-with-icon" | "buttons-plus-radio" | "know-your-customer" | "double-radio" | "launcher" | "artwork" | "split-screen";
11
+ export type OnboardingStepType = "radio" | "checkbox-no-icon" | "checkbox-with-icon" | "buttons-plus-radio" | "know-your-customer" | "double-radio" | "text-input" | "launcher" | "artwork" | "split-screen";
12
12
  /**
13
13
  * Base step configuration shared across all step types
14
14
  */
@@ -117,6 +117,20 @@ export interface OnboardingDoubleRadioStep extends OnboardingStepBase {
117
117
  */
118
118
  secondDataKey: string;
119
119
  }
120
+ /**
121
+ * Text input step configuration
122
+ */
123
+ export interface OnboardingTextInputStep extends OnboardingStepBase {
124
+ type: "text-input";
125
+ /**
126
+ * Placeholder text for the input field
127
+ */
128
+ placeholder?: string;
129
+ /**
130
+ * Key in the data object where the text value is stored
131
+ */
132
+ dataKey: string;
133
+ }
120
134
  /**
121
135
  * Launcher step configuration (informational with CTA)
122
136
  */
@@ -152,7 +166,7 @@ export interface OnboardingArtworkStep extends OnboardingStepBase {
152
166
  /**
153
167
  * Union type of all possible step configurations
154
168
  */
155
- export type OnboardingStep = OnboardingRadioStep | OnboardingCheckboxStep | OnboardingButtonsPlusRadioStep | OnboardingKnowYourCustomerStep | OnboardingDoubleRadioStep | OnboardingLauncherStep | OnboardingArtworkStep;
169
+ export type OnboardingStep = OnboardingRadioStep | OnboardingCheckboxStep | OnboardingButtonsPlusRadioStep | OnboardingKnowYourCustomerStep | OnboardingDoubleRadioStep | OnboardingTextInputStep | OnboardingLauncherStep | OnboardingArtworkStep;
156
170
  /**
157
171
  * Complete onboarding flow configuration
158
172
  */
@@ -16,7 +16,7 @@ export interface OnboardingTemplateProps {
16
16
  /**
17
17
  * Template variation type
18
18
  */
19
- variation: "radio" | "checkbox-no-icon" | "checkbox-with-icon" | "buttons-plus-radio" | "know-your-customer" | "double-radio" | "launcher" | "artwork" | "split-screen";
19
+ variation: "radio" | "checkbox-no-icon" | "checkbox-with-icon" | "buttons-plus-radio" | "know-your-customer" | "double-radio" | "text-input" | "launcher" | "artwork" | "split-screen";
20
20
  /**
21
21
  * Current step (1-based)
22
22
  */
@@ -129,6 +129,18 @@ export interface OnboardingTemplateProps {
129
129
  * Second radio option change handler
130
130
  */
131
131
  onSecondRadioChange?: (value: string) => void;
132
+ /**
133
+ * Text input value
134
+ */
135
+ textInputValue?: string;
136
+ /**
137
+ * Text input change handler
138
+ */
139
+ onTextInputChange?: (value: string) => void;
140
+ /**
141
+ * Text input placeholder
142
+ */
143
+ textInputPlaceholder?: string;
132
144
  /**
133
145
  * Icon name for launcher variation (Solar icon)
134
146
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-mockups/design-system",
3
- "version": "0.2.10",
3
+ "version": "0.2.12",
4
4
  "description": "A professional, scalable design system built with React 18, TypeScript, Radix UI, and Storybook",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",