analytica-frontend-lib 1.0.45 → 1.0.46

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.
@@ -0,0 +1,354 @@
1
+ // src/components/Text/Text.tsx
2
+ import { jsx } from "react/jsx-runtime";
3
+ var Text = ({
4
+ children,
5
+ size = "md",
6
+ weight = "normal",
7
+ color = "text-text-950",
8
+ as,
9
+ className = "",
10
+ ...props
11
+ }) => {
12
+ let sizeClasses = "";
13
+ let weightClasses = "";
14
+ const sizeClassMap = {
15
+ "2xs": "text-2xs",
16
+ xs: "text-xs",
17
+ sm: "text-sm",
18
+ md: "text-md",
19
+ lg: "text-lg",
20
+ xl: "text-xl",
21
+ "2xl": "text-2xl",
22
+ "3xl": "text-3xl",
23
+ "4xl": "text-4xl",
24
+ "5xl": "text-5xl",
25
+ "6xl": "text-6xl"
26
+ };
27
+ sizeClasses = sizeClassMap[size] ?? sizeClassMap.md;
28
+ const weightClassMap = {
29
+ hairline: "font-hairline",
30
+ light: "font-light",
31
+ normal: "font-normal",
32
+ medium: "font-medium",
33
+ semibold: "font-semibold",
34
+ bold: "font-bold",
35
+ extrabold: "font-extrabold",
36
+ black: "font-black"
37
+ };
38
+ weightClasses = weightClassMap[weight] ?? weightClassMap.normal;
39
+ const baseClasses = "font-primary";
40
+ const Component = as ?? "p";
41
+ return /* @__PURE__ */ jsx(
42
+ Component,
43
+ {
44
+ className: `${baseClasses} ${sizeClasses} ${weightClasses} ${color} ${className}`,
45
+ ...props,
46
+ children
47
+ }
48
+ );
49
+ };
50
+ var Text_default = Text;
51
+
52
+ // src/components/Stepper/Stepper.tsx
53
+ import { Check } from "phosphor-react";
54
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
55
+ var SIZE_CLASSES = {
56
+ small: {
57
+ container: "gap-2",
58
+ // 8px gap as specified in CSS
59
+ stepWidth: "w-[58px]",
60
+ // exact 58px from CSS
61
+ stepHeight: "h-[38px]",
62
+ // exact 38px from CSS
63
+ indicator: "w-5 h-5",
64
+ // 20px as specified
65
+ progressBar: "h-0.5",
66
+ // 2px as specified
67
+ indicatorTextSize: "2xs",
68
+ // 10px as specified
69
+ labelTextSize: "xs",
70
+ // 12px as specified
71
+ iconSize: "w-3 h-3"
72
+ // 12px
73
+ },
74
+ medium: {
75
+ container: "gap-3",
76
+ // 12px (8px + 4px progression)
77
+ stepWidth: "w-[110px]",
78
+ // 110px (increased from 90px to fit "Endereço Residencial")
79
+ stepHeight: "h-[48px]",
80
+ // 48px (increased from 46px for better proportion)
81
+ indicator: "w-6 h-6",
82
+ // 24px (20px + 4px progression)
83
+ progressBar: "h-0.5",
84
+ // 2px maintained for consistency
85
+ indicatorTextSize: "2xs",
86
+ // 10px maintained for readability
87
+ labelTextSize: "xs",
88
+ // 12px maintained
89
+ iconSize: "w-3.5 h-3.5"
90
+ // 14px
91
+ },
92
+ large: {
93
+ container: "gap-4",
94
+ // 16px (12px + 4px progression)
95
+ stepWidth: "w-[160px]",
96
+ // 160px (increased from 140px to fit "Endereço Residencial")
97
+ stepHeight: "h-[58px]",
98
+ // 58px (increased from 54px for better proportion)
99
+ indicator: "w-7 h-7",
100
+ // 28px (24px + 4px progression)
101
+ progressBar: "h-1",
102
+ // 4px (increased for better visibility)
103
+ indicatorTextSize: "xs",
104
+ // 12px (increased for larger size)
105
+ labelTextSize: "sm",
106
+ // 14px (increased for larger size)
107
+ iconSize: "w-4 h-4"
108
+ // 16px
109
+ },
110
+ extraLarge: {
111
+ container: "gap-5",
112
+ // 20px (16px + 4px progression)
113
+ stepWidth: "w-[200px]",
114
+ // 200px (increased from 180px to ensure "Endereço Residencial" fits)
115
+ stepHeight: "h-[68px]",
116
+ // 68px (increased from 62px for better proportion)
117
+ indicator: "w-8 h-8",
118
+ // 32px (28px + 4px progression)
119
+ progressBar: "h-1",
120
+ // 4px maintained
121
+ indicatorTextSize: "xs",
122
+ // 12px maintained for readability
123
+ labelTextSize: "sm",
124
+ // 14px maintained
125
+ iconSize: "w-[18px] h-[18px]"
126
+ // 18px
127
+ }
128
+ };
129
+ var STATE_CLASSES = {
130
+ pending: {
131
+ progressBar: "bg-text-400",
132
+ // #A3A3A3
133
+ indicator: "bg-text-400",
134
+ // #A3A3A3
135
+ indicatorText: "text-white",
136
+ // Branco para contraste com background cinza
137
+ label: "text-text-400"
138
+ // #A3A3A3
139
+ },
140
+ current: {
141
+ progressBar: "bg-primary-800",
142
+ // #1C61B2 usando classe Tailwind padrão
143
+ indicator: "bg-primary-800",
144
+ // #1C61B2 usando classe Tailwind padrão
145
+ indicatorText: "text-white",
146
+ // Branco usando classe Tailwind padrão
147
+ label: "text-primary-800"
148
+ // #1C61B2 usando classe Tailwind padrão
149
+ },
150
+ completed: {
151
+ progressBar: "bg-primary-400",
152
+ // #48A0E8 para barra quando checked (completed)
153
+ indicator: "bg-primary-400",
154
+ // #48A0E8 para corresponder à barra de progresso
155
+ indicatorText: "text-white",
156
+ // Branco usando classe Tailwind padrão
157
+ label: "text-primary-400"
158
+ // #48A0E8 para corresponder à barra de progresso
159
+ }
160
+ };
161
+ var Step = ({
162
+ step,
163
+ index,
164
+ size: _size,
165
+ sizeClasses,
166
+ stateClasses,
167
+ isLast: _isLast,
168
+ className = ""
169
+ }) => {
170
+ const stepNumber = index + 1;
171
+ const isCompleted = step.state === "completed";
172
+ const getAriaLabel = () => {
173
+ let suffix = "";
174
+ if (step.state === "completed") {
175
+ suffix = " (conclu\xEDdo)";
176
+ } else if (step.state === "current") {
177
+ suffix = " (atual)";
178
+ }
179
+ return `${step.label}${suffix}`;
180
+ };
181
+ return /* @__PURE__ */ jsxs(
182
+ "div",
183
+ {
184
+ className: `
185
+ flex flex-col justify-center items-center pb-2 gap-2
186
+ ${sizeClasses.stepWidth} ${sizeClasses.stepHeight}
187
+ flex-none flex-grow
188
+ ${className}
189
+ sm:max-w-[100px] md:max-w-[120px] lg:max-w-none xl:max-w-none
190
+ sm:min-h-[40px] md:min-h-[45px] lg:min-h-none
191
+ overflow-visible
192
+ `,
193
+ children: [
194
+ /* @__PURE__ */ jsx2(
195
+ "div",
196
+ {
197
+ className: `
198
+ w-full ${sizeClasses.progressBar} ${stateClasses.progressBar}
199
+ rounded-sm flex-none
200
+ `
201
+ }
202
+ ),
203
+ /* @__PURE__ */ jsxs(
204
+ "div",
205
+ {
206
+ className: `
207
+ flex flex-col sm:flex-row items-center
208
+ gap-1 sm:gap-2 w-full sm:w-auto
209
+ h-auto sm:h-5 flex-none
210
+ overflow-visible
211
+ `,
212
+ children: [
213
+ /* @__PURE__ */ jsx2(
214
+ "div",
215
+ {
216
+ className: `
217
+ ${sizeClasses.indicator} ${stateClasses.indicator}
218
+ rounded-full flex items-center justify-center relative
219
+ flex-none transition-all duration-300 ease-out
220
+ w-4 h-4 sm:w-5 sm:h-5 md:w-5 md:h-5 lg:w-6 lg:h-6
221
+ `,
222
+ "aria-label": getAriaLabel(),
223
+ children: isCompleted ? /* @__PURE__ */ jsx2(
224
+ Check,
225
+ {
226
+ weight: "bold",
227
+ className: `
228
+ ${stateClasses.indicatorText}
229
+ w-2.5 h-2.5 sm:w-3 sm:h-3 md:w-3 md:h-3 lg:w-3.5 lg:h-3.5
230
+ `
231
+ }
232
+ ) : /* @__PURE__ */ jsx2(
233
+ Text_default,
234
+ {
235
+ size: sizeClasses.indicatorTextSize,
236
+ weight: "medium",
237
+ color: "",
238
+ className: `${stateClasses.indicatorText} leading-none text-2xs sm:text-xs`,
239
+ children: stepNumber
240
+ }
241
+ )
242
+ }
243
+ ),
244
+ /* @__PURE__ */ jsx2(
245
+ Text_default,
246
+ {
247
+ size: sizeClasses.labelTextSize,
248
+ weight: "medium",
249
+ color: "",
250
+ className: `
251
+ ${stateClasses.label} leading-tight flex-none
252
+ text-center sm:text-left break-words
253
+ px-1 sm:px-0 max-w-full
254
+ text-2xs sm:text-xs md:text-xs lg:text-sm
255
+ whitespace-normal
256
+ `,
257
+ children: step.label
258
+ }
259
+ )
260
+ ]
261
+ }
262
+ )
263
+ ]
264
+ }
265
+ );
266
+ };
267
+ var calculateStepStates = (steps, currentStep) => {
268
+ return steps.map((step, index) => {
269
+ let stepState;
270
+ if (index < currentStep) {
271
+ stepState = "completed";
272
+ } else if (index === currentStep) {
273
+ stepState = "current";
274
+ } else {
275
+ stepState = "pending";
276
+ }
277
+ return {
278
+ ...step,
279
+ state: stepState
280
+ };
281
+ });
282
+ };
283
+ var getProgressText = (currentStep, totalSteps, customText) => {
284
+ if (customText) return customText;
285
+ return `Etapa ${currentStep + 1} de ${totalSteps}`;
286
+ };
287
+ var Stepper = ({
288
+ steps: initialSteps,
289
+ size = "medium",
290
+ currentStep,
291
+ className = "",
292
+ stepClassName = "",
293
+ showProgress = false,
294
+ progressText,
295
+ responsive = true
296
+ }) => {
297
+ const sizeClasses = SIZE_CLASSES[size];
298
+ const steps = currentStep !== void 0 ? calculateStepStates(initialSteps, currentStep) : initialSteps;
299
+ return /* @__PURE__ */ jsxs(
300
+ "fieldset",
301
+ {
302
+ className: `flex flex-col gap-4 sm:gap-5 md:gap-6 ${className} border-0 p-0 m-0`,
303
+ children: [
304
+ /* @__PURE__ */ jsx2("legend", { className: "absolute w-px h-px p-0 -m-px overflow-hidden whitespace-nowrap border-0", children: "Stepper de formul\xE1rio" }),
305
+ showProgress && currentStep !== void 0 && /* @__PURE__ */ jsx2(
306
+ Text_default,
307
+ {
308
+ size: "sm",
309
+ weight: "medium",
310
+ className: "text-text-600 text-center sm:text-left text-xs sm:text-sm",
311
+ children: getProgressText(currentStep, steps.length, progressText)
312
+ }
313
+ ),
314
+ /* @__PURE__ */ jsx2(
315
+ "div",
316
+ {
317
+ className: `
318
+ flex items-center
319
+ ${sizeClasses.container}
320
+ ${responsive ? "flex-row overflow-x-auto overflow-y-hidden scrollbar-hide justify-start sm:justify-center md:justify-center lg:justify-center" : "flex-row justify-center"}
321
+ px-2 sm:px-4 md:px-6 lg:px-0
322
+ max-w-full min-w-0
323
+ gap-2 sm:gap-3 md:gap-4 lg:gap-4
324
+ `,
325
+ role: "tablist",
326
+ "aria-label": "Progress steps",
327
+ children: steps.map((step, index) => {
328
+ const stateClasses = STATE_CLASSES[step.state];
329
+ return /* @__PURE__ */ jsx2(
330
+ Step,
331
+ {
332
+ step,
333
+ index,
334
+ size,
335
+ sizeClasses,
336
+ stateClasses,
337
+ isLast: index === steps.length - 1,
338
+ className: stepClassName
339
+ },
340
+ step.id
341
+ );
342
+ })
343
+ }
344
+ )
345
+ ]
346
+ }
347
+ );
348
+ };
349
+ var Stepper_default = Stepper;
350
+ export {
351
+ Step,
352
+ Stepper_default as default
353
+ };
354
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/Text/Text.tsx","../../src/components/Stepper/Stepper.tsx"],"sourcesContent":["import { ComponentPropsWithoutRef, ElementType, ReactNode } from 'react';\n\n/**\n * Base text component props\n */\ntype BaseTextProps = {\n /** Content to be displayed */\n children?: ReactNode;\n /** Text size variant */\n size?:\n | '2xs'\n | 'xs'\n | 'sm'\n | 'md'\n | 'lg'\n | 'xl'\n | '2xl'\n | '3xl'\n | '4xl'\n | '5xl'\n | '6xl';\n /** Font weight variant */\n weight?:\n | 'hairline'\n | 'light'\n | 'normal'\n | 'medium'\n | 'semibold'\n | 'bold'\n | 'extrabold'\n | 'black';\n /** Color variant - white for light backgrounds, black for dark backgrounds */\n color?: string;\n /** Additional CSS classes to apply */\n className?: string;\n};\n\n/**\n * Polymorphic text component props that ensures type safety based on the 'as' prop\n */\ntype TextProps<T extends ElementType = 'p'> = BaseTextProps & {\n /** HTML tag to render */\n as?: T;\n} & Omit<ComponentPropsWithoutRef<T>, keyof BaseTextProps>;\n\n/**\n * Text component for Analytica Ensino platforms\n *\n * A flexible polymorphic text component with multiple sizes, weights, and colors.\n * Automatically adapts to dark and light themes with full type safety.\n *\n * @param children - The content to display\n * @param size - The text size variant (2xs, xs, sm, md, lg, xl, 2xl, 3xl, 4xl, 5xl, 6xl)\n * @param weight - The font weight variant (hairline, light, normal, medium, semibold, bold, extrabold, black)\n * @param color - The color variant - adapts to theme\n * @param as - The HTML tag to render - determines allowed attributes via TypeScript\n * @param className - Additional CSS classes\n * @param props - HTML attributes valid for the chosen tag only\n * @returns A styled text element with type-safe attributes\n *\n * @example\n * ```tsx\n * <Text size=\"lg\" weight=\"bold\" color=\"text-info-800\">\n * This is a large, bold text\n * </Text>\n *\n * <Text as=\"a\" href=\"/link\" target=\"_blank\">\n * Link with type-safe anchor attributes\n * </Text>\n *\n * <Text as=\"button\" onClick={handleClick} disabled>\n * Button with type-safe button attributes\n * </Text>\n * ```\n */\nconst Text = <T extends ElementType = 'p'>({\n children,\n size = 'md',\n weight = 'normal',\n color = 'text-text-950',\n as,\n className = '',\n ...props\n}: TextProps<T>) => {\n let sizeClasses = '';\n let weightClasses = '';\n\n // Text size classes mapping\n const sizeClassMap = {\n '2xs': 'text-2xs',\n xs: 'text-xs',\n sm: 'text-sm',\n md: 'text-md',\n lg: 'text-lg',\n xl: 'text-xl',\n '2xl': 'text-2xl',\n '3xl': 'text-3xl',\n '4xl': 'text-4xl',\n '5xl': 'text-5xl',\n '6xl': 'text-6xl',\n } as const;\n\n sizeClasses = sizeClassMap[size] ?? sizeClassMap.md;\n\n // Font weight classes mapping\n const weightClassMap = {\n hairline: 'font-hairline',\n light: 'font-light',\n normal: 'font-normal',\n medium: 'font-medium',\n semibold: 'font-semibold',\n bold: 'font-bold',\n extrabold: 'font-extrabold',\n black: 'font-black',\n } as const;\n\n weightClasses = weightClassMap[weight] ?? weightClassMap.normal;\n\n const baseClasses = 'font-primary';\n const Component = as ?? ('p' as ElementType);\n\n return (\n <Component\n className={`${baseClasses} ${sizeClasses} ${weightClasses} ${color} ${className}`}\n {...props}\n >\n {children}\n </Component>\n );\n};\n\nexport default Text;\n","// ReactNode removed as it's not used in this component\nimport Text from '../Text/Text';\nimport { Check } from 'phosphor-react';\n\n/**\n * Stepper size variants\n */\ntype StepperSize = 'small' | 'medium' | 'large' | 'extraLarge';\n\n/**\n * Step state variants\n */\ntype StepState = 'pending' | 'current' | 'completed';\n\n/**\n * Individual step data interface\n */\nexport interface StepData {\n /** Unique identifier for the step */\n id: string;\n /** Label text for the step */\n label: string;\n /** Current state of the step */\n state: StepState;\n}\n\n/**\n * Size configurations - Following design system pattern from CSS specifications\n * Small size based on exact CSS: width 58px, height 38px, gap 8px\n */\nconst SIZE_CLASSES = {\n small: {\n container: 'gap-2', // 8px gap as specified in CSS\n stepWidth: 'w-[58px]', // exact 58px from CSS\n stepHeight: 'h-[38px]', // exact 38px from CSS\n indicator: 'w-5 h-5', // 20px as specified\n progressBar: 'h-0.5', // 2px as specified\n indicatorTextSize: '2xs', // 10px as specified\n labelTextSize: 'xs', // 12px as specified\n iconSize: 'w-3 h-3', // 12px\n },\n medium: {\n container: 'gap-3', // 12px (8px + 4px progression)\n stepWidth: 'w-[110px]', // 110px (increased from 90px to fit \"Endereço Residencial\")\n stepHeight: 'h-[48px]', // 48px (increased from 46px for better proportion)\n indicator: 'w-6 h-6', // 24px (20px + 4px progression)\n progressBar: 'h-0.5', // 2px maintained for consistency\n indicatorTextSize: '2xs', // 10px maintained for readability\n labelTextSize: 'xs', // 12px maintained\n iconSize: 'w-3.5 h-3.5', // 14px\n },\n large: {\n container: 'gap-4', // 16px (12px + 4px progression)\n stepWidth: 'w-[160px]', // 160px (increased from 140px to fit \"Endereço Residencial\")\n stepHeight: 'h-[58px]', // 58px (increased from 54px for better proportion)\n indicator: 'w-7 h-7', // 28px (24px + 4px progression)\n progressBar: 'h-1', // 4px (increased for better visibility)\n indicatorTextSize: 'xs', // 12px (increased for larger size)\n labelTextSize: 'sm', // 14px (increased for larger size)\n iconSize: 'w-4 h-4', // 16px\n },\n extraLarge: {\n container: 'gap-5', // 20px (16px + 4px progression)\n stepWidth: 'w-[200px]', // 200px (increased from 180px to ensure \"Endereço Residencial\" fits)\n stepHeight: 'h-[68px]', // 68px (increased from 62px for better proportion)\n indicator: 'w-8 h-8', // 32px (28px + 4px progression)\n progressBar: 'h-1', // 4px maintained\n indicatorTextSize: 'xs', // 12px maintained for readability\n labelTextSize: 'sm', // 14px maintained\n iconSize: 'w-[18px] h-[18px]', // 18px\n },\n} as const;\n\n/**\n * State configurations using exact colors from CSS specs\n * pending: #A3A3A3 = text-400 (etapa ainda não iniciada)\n * current: #1C61B2 = primary-800 (etapa atual sendo preenchida) - baseado no CSS fornecido\n * completed: #1C61B2 = primary-800 (etapa concluída)\n * text color: #FEFEFF = text\n */\nconst STATE_CLASSES = {\n pending: {\n progressBar: 'bg-text-400', // #A3A3A3\n indicator: 'bg-text-400', // #A3A3A3\n indicatorText: 'text-white', // Branco para contraste com background cinza\n label: 'text-text-400', // #A3A3A3\n },\n current: {\n progressBar: 'bg-primary-800', // #1C61B2 usando classe Tailwind padrão\n indicator: 'bg-primary-800', // #1C61B2 usando classe Tailwind padrão\n indicatorText: 'text-white', // Branco usando classe Tailwind padrão\n label: 'text-primary-800', // #1C61B2 usando classe Tailwind padrão\n },\n completed: {\n progressBar: 'bg-primary-400', // #48A0E8 para barra quando checked (completed)\n indicator: 'bg-primary-400', // #48A0E8 para corresponder à barra de progresso\n indicatorText: 'text-white', // Branco usando classe Tailwind padrão\n label: 'text-primary-400', // #48A0E8 para corresponder à barra de progresso\n },\n} as const;\n\n/**\n * Type for size classes\n */\ntype SizeClassType = (typeof SIZE_CLASSES)[keyof typeof SIZE_CLASSES];\n\n/**\n * Type for state classes\n */\ntype StateClassType = (typeof STATE_CLASSES)[keyof typeof STATE_CLASSES];\n\n/**\n * Props for individual step component\n */\ninterface StepProps {\n step: StepData;\n index: number;\n size: StepperSize;\n sizeClasses: SizeClassType;\n stateClasses: StateClassType;\n isLast: boolean;\n className?: string;\n}\n\n/**\n * Individual Step component - Based on exact design specifications\n * Layout: flex-column with progress bar at top, then icon+label row\n * Fully responsive for mobile, tablets, and laptops\n */\nexport const Step = ({\n step,\n index,\n size: _size,\n sizeClasses,\n stateClasses,\n isLast: _isLast,\n className = '',\n}: StepProps) => {\n const stepNumber = index + 1;\n const isCompleted = step.state === 'completed';\n\n // Generate accessible aria-label based on step state\n const getAriaLabel = () => {\n let suffix = '';\n if (step.state === 'completed') {\n suffix = ' (concluído)';\n } else if (step.state === 'current') {\n suffix = ' (atual)';\n }\n return `${step.label}${suffix}`;\n };\n\n return (\n <div\n className={`\n flex flex-col justify-center items-center pb-2 gap-2\n ${sizeClasses.stepWidth} ${sizeClasses.stepHeight}\n flex-none flex-grow\n ${className}\n sm:max-w-[100px] md:max-w-[120px] lg:max-w-none xl:max-w-none\n sm:min-h-[40px] md:min-h-[45px] lg:min-h-none\n overflow-visible\n `}\n >\n {/* Progress Bar - Full width at top with responsive scaling */}\n <div\n className={`\n w-full ${sizeClasses.progressBar} ${stateClasses.progressBar}\n rounded-sm flex-none\n `}\n />\n\n {/* Step Content Container - Responsive layout for all devices, no vertical scroll */}\n <div\n className={`\n flex flex-col sm:flex-row items-center\n gap-1 sm:gap-2 w-full sm:w-auto\n h-auto sm:h-5 flex-none\n overflow-visible\n `}\n >\n {/* Step Indicator Circle with responsive sizing */}\n <div\n className={`\n ${sizeClasses.indicator} ${stateClasses.indicator}\n rounded-full flex items-center justify-center relative\n flex-none transition-all duration-300 ease-out\n w-4 h-4 sm:w-5 sm:h-5 md:w-5 md:h-5 lg:w-6 lg:h-6\n `}\n aria-label={getAriaLabel()}\n >\n {isCompleted ? (\n <Check\n weight=\"bold\"\n className={`\n ${stateClasses.indicatorText}\n w-2.5 h-2.5 sm:w-3 sm:h-3 md:w-3 md:h-3 lg:w-3.5 lg:h-3.5\n `}\n />\n ) : (\n <Text\n size={sizeClasses.indicatorTextSize as '2xs' | 'xs' | 'sm'}\n weight=\"medium\"\n color=\"\"\n className={`${stateClasses.indicatorText} leading-none text-2xs sm:text-xs`}\n >\n {stepNumber}\n </Text>\n )}\n </div>\n\n {/* Step Label with full responsive text sizing, no vertical overflow */}\n <Text\n size={sizeClasses.labelTextSize as '2xs' | 'xs' | 'sm' | 'md'}\n weight=\"medium\"\n color=\"\"\n className={`\n ${stateClasses.label} leading-tight flex-none\n text-center sm:text-left break-words\n px-1 sm:px-0 max-w-full\n text-2xs sm:text-xs md:text-xs lg:text-sm\n whitespace-normal\n `}\n >\n {step.label}\n </Text>\n </div>\n </div>\n );\n};\n\n/**\n * Stepper component props interface\n */\nexport type StepperProps = {\n /** Array of step data */\n steps: StepData[];\n /** Size variant of the stepper */\n size?: StepperSize;\n /** Current active step index */\n currentStep?: number;\n /** Additional CSS classes */\n className?: string;\n /** Step container CSS classes */\n stepClassName?: string;\n /** Progress indicator (e.g., \"Etapa 2 de 4\") */\n showProgress?: boolean;\n /** Custom progress text */\n progressText?: string;\n /** Make stepper responsive (vertical on mobile) */\n responsive?: boolean;\n};\n\n/**\n * Helper function to calculate step states based on current step\n */\nconst calculateStepStates = (\n steps: StepData[],\n currentStep: number\n): StepData[] => {\n return steps.map((step, index) => {\n let stepState: StepState;\n\n if (index < currentStep) {\n stepState = 'completed';\n } else if (index === currentStep) {\n stepState = 'current';\n } else {\n stepState = 'pending';\n }\n\n return {\n ...step,\n state: stepState,\n };\n });\n};\n\n/**\n * Helper function to get progress text\n */\nconst getProgressText = (\n currentStep: number,\n totalSteps: number,\n customText?: string\n): string => {\n if (customText) return customText;\n return `Etapa ${currentStep + 1} de ${totalSteps}`;\n};\n\n/**\n * Stepper component for Analytica Ensino platforms\n *\n * A progress stepper component that displays a sequence of steps with different states.\n * Follows the exact design specifications with proper spacing, colors, and layout.\n * Fully responsive for mobile, tablets, and laptops.\n *\n * Design specifications:\n * - Based on exact CSS specifications from Figma design\n * - Fully responsive: mobile (320px+) -> tablets (640px+) -> laptops (1024px+)\n * - Progressive sizing with responsive breakpoints that adapt to device type\n * - Consistent gaps that scale with screen size and device capabilities\n * - Consistent color scheme: pending (gray), current (dark blue), completed (light blue)\n * - Responsive design with overflow scroll on smaller devices\n * - Optimized text sizing and layout for each device category\n *\n * @example\n * ```tsx\n * // Basic stepper - automatically responsive for all devices\n * <Stepper steps={steps} currentStep={1} />\n *\n * // Custom styling with full responsive behavior\n * <Stepper steps={steps} size=\"medium\" showProgress responsive />\n * ```\n */\nconst Stepper = ({\n steps: initialSteps,\n size = 'medium',\n currentStep,\n className = '',\n stepClassName = '',\n showProgress = false,\n progressText,\n responsive = true,\n}: StepperProps) => {\n const sizeClasses = SIZE_CLASSES[size];\n\n // Calculate steps with states if currentStep is provided\n const steps =\n currentStep !== undefined\n ? calculateStepStates(initialSteps, currentStep)\n : initialSteps;\n\n return (\n <fieldset\n className={`flex flex-col gap-4 sm:gap-5 md:gap-6 ${className} border-0 p-0 m-0`}\n >\n <legend className=\"absolute w-px h-px p-0 -m-px overflow-hidden whitespace-nowrap border-0\">\n Stepper de formulário\n </legend>\n {/* Progress indicator with responsive text */}\n {showProgress && currentStep !== undefined && (\n <Text\n size=\"sm\"\n weight=\"medium\"\n className=\"text-text-600 text-center sm:text-left text-xs sm:text-sm\"\n >\n {getProgressText(currentStep, steps.length, progressText)}\n </Text>\n )}\n\n {/* Stepper container - Fully responsive for all devices with horizontal scroll only */}\n <div\n className={`\n flex items-center\n ${sizeClasses.container}\n ${\n responsive\n ? 'flex-row overflow-x-auto overflow-y-hidden scrollbar-hide justify-start sm:justify-center md:justify-center lg:justify-center'\n : 'flex-row justify-center'\n }\n px-2 sm:px-4 md:px-6 lg:px-0\n max-w-full min-w-0\n gap-2 sm:gap-3 md:gap-4 lg:gap-4\n `}\n role=\"tablist\"\n aria-label=\"Progress steps\"\n >\n {steps.map((step, index) => {\n const stateClasses = STATE_CLASSES[step.state];\n\n return (\n <Step\n key={step.id}\n step={step}\n index={index}\n size={size}\n sizeClasses={sizeClasses}\n stateClasses={stateClasses}\n isLast={index === steps.length - 1}\n className={stepClassName}\n />\n );\n })}\n </div>\n </fieldset>\n );\n};\n\nexport default Stepper;\n"],"mappings":";AA0HI;AA/CJ,IAAM,OAAO,CAA8B;AAAA,EACzC;AAAA,EACA,OAAO;AAAA,EACP,SAAS;AAAA,EACT,Q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