@fluencypassdevs/cycle 1.6.0 → 1.9.0

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.
Files changed (39) hide show
  1. package/bin/mcp.mjs +150 -0
  2. package/dist/chunk-37C2K2NM.js +101 -0
  3. package/dist/chunk-37C2K2NM.js.map +1 -0
  4. package/dist/chunk-I5A3CME4.js +84 -0
  5. package/dist/chunk-I5A3CME4.js.map +1 -0
  6. package/dist/chunk-JRJBKPXW.js +118 -0
  7. package/dist/chunk-JRJBKPXW.js.map +1 -0
  8. package/dist/{chunk-PCLVQPIG.js → chunk-L2DJS6PG.js} +3 -3
  9. package/dist/{chunk-PCLVQPIG.js.map → chunk-L2DJS6PG.js.map} +1 -1
  10. package/dist/chunk-PW464XEP.js +787 -0
  11. package/dist/chunk-PW464XEP.js.map +1 -0
  12. package/dist/chunk-QANROH2K.js +50 -0
  13. package/dist/chunk-QANROH2K.js.map +1 -0
  14. package/dist/chunk-YMWRR7ET.js +503 -0
  15. package/dist/chunk-YMWRR7ET.js.map +1 -0
  16. package/dist/index.d.ts +8 -1
  17. package/dist/index.js +18 -12
  18. package/dist/layout/container.d.ts +24 -0
  19. package/dist/layout/container.js +5 -0
  20. package/dist/layout/container.js.map +1 -0
  21. package/dist/layout/grid.d.ts +26 -0
  22. package/dist/layout/grid.js +5 -0
  23. package/dist/layout/grid.js.map +1 -0
  24. package/dist/layout/stack.d.ts +47 -0
  25. package/dist/layout/stack.js +5 -0
  26. package/dist/layout/stack.js.map +1 -0
  27. package/dist/types-CVdl5nka.d.ts +9 -0
  28. package/dist/ui/chat-message.d.ts +57 -0
  29. package/dist/ui/chat-message.js +11 -0
  30. package/dist/ui/chat-message.js.map +1 -0
  31. package/dist/ui/chat-panel.js +1 -1
  32. package/dist/ui/live-waiting.js +2 -2
  33. package/dist/ui/message-bar.d.ts +69 -0
  34. package/dist/ui/message-bar.js +5 -0
  35. package/dist/ui/message-bar.js.map +1 -0
  36. package/dist/ui/message-rating.d.ts +29 -0
  37. package/dist/ui/message-rating.js +5 -0
  38. package/dist/ui/message-rating.js.map +1 -0
  39. package/package.json +1 -1
@@ -0,0 +1,24 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+ import * as React from 'react';
4
+ import { VariantProps } from 'class-variance-authority';
5
+
6
+ /**
7
+ * Container — wrapper centralizado com max-width e margin lateral.
8
+ *
9
+ * Margin (locked system value): 16px mobile / 24px desktop. Para casos especiais
10
+ * que pedem mais respiro (ex: conteudo luxuoso), use override via className: `sm:px-10`.
11
+ *
12
+ * O Container nao define gutter ou colunas — isso e responsabilidade do Grid interno.
13
+ */
14
+ declare const containerVariants: (props?: ({
15
+ size?: "default" | "prose" | "wide" | "full" | null | undefined;
16
+ padding?: "none" | "default" | null | undefined;
17
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
18
+ interface ContainerProps extends React.ComponentProps<"div">, VariantProps<typeof containerVariants> {
19
+ /** HTML element to render (default: div) */
20
+ as?: "div" | "section" | "main" | "article";
21
+ }
22
+ declare function Container({ size, padding, as, className, ...props }: ContainerProps): react_jsx_runtime.JSX.Element;
23
+
24
+ export { Container, type ContainerProps, containerVariants };
@@ -0,0 +1,5 @@
1
+ export { Container, containerVariants } from '../chunk-QANROH2K.js';
2
+ import '../chunk-TYCPXAXF.js';
3
+ import '../chunk-YINJ5YZ5.js';
4
+ //# sourceMappingURL=container.js.map
5
+ //# sourceMappingURL=container.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"container.js"}
@@ -0,0 +1,26 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { C as ColCount } from '../types-CVdl5nka.js';
4
+
5
+ interface GridProps extends React.ComponentProps<"div"> {
6
+ /**
7
+ * Auto-fit gallery: largura minima por item. Quando setado, sobrescreve
8
+ * o sistema 12-col padrao com `repeat(auto-fit, minmax(X, 1fr))`.
9
+ * Use para galerias uniformes onde nao se controla o numero de items por linha.
10
+ */
11
+ minItemWidth?: string;
12
+ }
13
+ declare function Grid({ minItemWidth, className, style, ...props }: GridProps): react_jsx_runtime.JSX.Element;
14
+ interface GridItemProps extends React.ComponentProps<"div"> {
15
+ /** Quantas colunas (de 12) o item ocupa no mobile. Sem size, ocupa 1 col. */
16
+ size?: ColCount;
17
+ /** Cols em sm (>= 640px) */
18
+ sizeSm?: ColCount;
19
+ /** Cols em md (>= 768px) */
20
+ sizeMd?: ColCount;
21
+ /** Cols em lg (>= 1024px) */
22
+ sizeLg?: ColCount;
23
+ }
24
+ declare function GridItem({ size, sizeSm, sizeMd, sizeLg, className, ...props }: GridItemProps): react_jsx_runtime.JSX.Element;
25
+
26
+ export { Grid, GridItem, type GridItemProps, type GridProps };
@@ -0,0 +1,5 @@
1
+ export { Grid, GridItem } from '../chunk-JRJBKPXW.js';
2
+ import '../chunk-TYCPXAXF.js';
3
+ import '../chunk-YINJ5YZ5.js';
4
+ //# sourceMappingURL=grid.js.map
5
+ //# sourceMappingURL=grid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"grid.js"}
@@ -0,0 +1,47 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { G as GapToken } from '../types-CVdl5nka.js';
4
+
5
+ declare const DIRECTION: {
6
+ readonly col: "flex-col";
7
+ readonly row: "flex-row";
8
+ };
9
+ declare const DIRECTION_SM: {
10
+ readonly col: "sm:flex-col";
11
+ readonly row: "sm:flex-row";
12
+ };
13
+ declare const DIRECTION_LG: {
14
+ readonly col: "lg:flex-col";
15
+ readonly row: "lg:flex-row";
16
+ };
17
+ declare const ALIGN: {
18
+ readonly start: "items-start";
19
+ readonly center: "items-center";
20
+ readonly end: "items-end";
21
+ readonly stretch: "items-stretch";
22
+ };
23
+ declare const JUSTIFY: {
24
+ readonly start: "justify-start";
25
+ readonly center: "justify-center";
26
+ readonly end: "justify-end";
27
+ readonly between: "justify-between";
28
+ };
29
+ interface StackProps extends React.ComponentProps<"div"> {
30
+ /** Flex direction (default: col) */
31
+ direction?: keyof typeof DIRECTION;
32
+ /** Direction at sm breakpoint (>= 640px) */
33
+ directionSm?: keyof typeof DIRECTION_SM;
34
+ /** Direction at lg breakpoint (>= 1024px) */
35
+ directionLg?: keyof typeof DIRECTION_LG;
36
+ /** Gap between items (default: lg = 16px) */
37
+ gap?: GapToken;
38
+ /** Gap at sm breakpoint */
39
+ gapSm?: GapToken;
40
+ /** Cross-axis alignment */
41
+ align?: keyof typeof ALIGN;
42
+ /** Main-axis alignment */
43
+ justify?: keyof typeof JUSTIFY;
44
+ }
45
+ declare function Stack({ direction, directionSm, directionLg, gap, gapSm, align, justify, className, ...props }: StackProps): react_jsx_runtime.JSX.Element;
46
+
47
+ export { Stack, type StackProps };
@@ -0,0 +1,5 @@
1
+ export { Stack } from '../chunk-I5A3CME4.js';
2
+ import '../chunk-TYCPXAXF.js';
3
+ import '../chunk-YINJ5YZ5.js';
4
+ //# sourceMappingURL=stack.js.map
5
+ //# sourceMappingURL=stack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"stack.js"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Shared types for layout primitives (Container, Stack, Grid, GridItem).
3
+ */
4
+ /** Semantic gap tokens — used by Stack only (Grid has locked gutter). Maps to Tailwind gap-1/2/3/4/6 (4/8/12/16/24 px) */
5
+ type GapToken = "xs" | "sm" | "md" | "lg" | "xl";
6
+ /** Allowed column count for GridItem `size` (1–12) — based on the locked 12-col grid */
7
+ type ColCount = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
8
+
9
+ export type { ColCount as C, GapToken as G };
@@ -0,0 +1,57 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+ import * as React from 'react';
4
+ import { VariantProps } from 'class-variance-authority';
5
+ import { LikeDislikeValue } from './like-dislike.js';
6
+
7
+ declare const chatMessageVariants: (props?: ({
8
+ persona?: "user" | "system" | "ai" | null | undefined;
9
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
10
+ interface ChatMessageProps extends Omit<React.ComponentProps<"div">, "content">, VariantProps<typeof chatMessageVariants> {
11
+ /** Quem enviou: AI (assistente), user (aluno), system (mensagem do sistema) */
12
+ persona: "ai" | "user" | "system";
13
+ /** Texto da mensagem (opcional se houver apenas audio) */
14
+ text?: string;
15
+ /** URL do audio — renderiza AudioPlayer dentro do bubble */
16
+ audioSrc?: string;
17
+ /** Avatar do user (so usado em persona="user") */
18
+ avatar?: string;
19
+ /** Nome do user para fallback do avatar */
20
+ author?: string;
21
+ /** Mostrar like/dislike inline (so faz sentido em persona="ai") */
22
+ showFeedback?: boolean;
23
+ /** Valor controlado do feedback */
24
+ feedbackValue?: LikeDislikeValue;
25
+ /** Callback quando feedback muda */
26
+ onFeedbackChange?: (value: LikeDislikeValue) => void;
27
+ /** Estado de loading: mostra typing indicator ("...") */
28
+ loading?: boolean;
29
+ }
30
+ interface ChatAudioProps extends React.ComponentProps<"div"> {
31
+ /** URL do audio */
32
+ src: string;
33
+ /**
34
+ * Variante visual:
35
+ * - `neutral`: container `bg-muted` (cinza claro) — usado em AI messages
36
+ * - `brand`: container `bg-accent` (rosa pastel) — usado em User messages
37
+ * (requer wrapper `.theme-brand` no componente pai)
38
+ */
39
+ variant?: "neutral" | "brand";
40
+ /**
41
+ * Array de picos pre-calculados (valores 0-1). Quando fornecido, o componente
42
+ * usa direto sem analisar o audio. Util para SSR, performance ou audios sem CORS.
43
+ * Se nao fornecido, o componente analisa o audio automaticamente via Web Audio API.
44
+ */
45
+ peaks?: number[];
46
+ /**
47
+ * Numero de barras no waveform (default: 60).
48
+ * Ignorado se `peaks` for fornecido (usa o length do array).
49
+ * Reduzido de 100 → 60 para barras nao ficarem finas demais em containers menores.
50
+ */
51
+ barCount?: number;
52
+ }
53
+ declare function ChatAudio({ src, variant, peaks: providedPeaks, barCount, className, ...props }: ChatAudioProps): react_jsx_runtime.JSX.Element;
54
+
55
+ declare function ChatMessage({ persona, text, audioSrc, avatar, author, showFeedback, feedbackValue, onFeedbackChange, loading, className, ...props }: ChatMessageProps): react_jsx_runtime.JSX.Element;
56
+
57
+ export { ChatAudio, type ChatAudioProps, ChatMessage, type ChatMessageProps, chatMessageVariants };
@@ -0,0 +1,11 @@
1
+ export { ChatAudio, ChatMessage, chatMessageVariants } from '../chunk-YMWRR7ET.js';
2
+ import '../chunk-F2XA2Z75.js';
3
+ import '../chunk-JPEDYOV7.js';
4
+ import '../chunk-V7M2NHUO.js';
5
+ import '../chunk-MSLQRGSP.js';
6
+ import '../chunk-5I4PGGLN.js';
7
+ import '../chunk-JJETOZMI.js';
8
+ import '../chunk-TYCPXAXF.js';
9
+ import '../chunk-YINJ5YZ5.js';
10
+ //# sourceMappingURL=chat-message.js.map
11
+ //# sourceMappingURL=chat-message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"chat-message.js"}
@@ -1,7 +1,7 @@
1
1
  export { ChatPanel } from '../chunk-L32AMI4K.js';
2
2
  import '../chunk-HZJRM5EK.js';
3
- import '../chunk-MSLQRGSP.js';
4
3
  import '../chunk-V7M2NHUO.js';
4
+ import '../chunk-MSLQRGSP.js';
5
5
  import '../chunk-3LXU5C35.js';
6
6
  import '../chunk-5I4PGGLN.js';
7
7
  import '../chunk-TYCPXAXF.js';
@@ -1,6 +1,6 @@
1
- export { LiveWaiting } from '../chunk-PCLVQPIG.js';
2
- import '../chunk-MSLQRGSP.js';
1
+ export { LiveWaiting } from '../chunk-L2DJS6PG.js';
3
2
  import '../chunk-V7M2NHUO.js';
3
+ import '../chunk-MSLQRGSP.js';
4
4
  import '../chunk-W4GSXVJ2.js';
5
5
  import '../chunk-TYCPXAXF.js';
6
6
  import '../chunk-YINJ5YZ5.js';
@@ -0,0 +1,69 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+
4
+ /**
5
+ * Estados visuais do MessageBar:
6
+ * - `default`: input texto + botao mic (estado inicial, sem texto digitado)
7
+ * - `audio-only`: apenas botao mic centralizado (modo so audio)
8
+ * - `active`: input texto com conteudo digitado + botao send
9
+ * - `disabled`: input desabilitado
10
+ * - `recording`: barra de gravacao (timer + waveform live + delete/pause/send)
11
+ * - `paused`: gravacao pausada (timer + waveform + play/delete/mic/send)
12
+ */
13
+ type MessageBarState = "default" | "audio-only" | "active" | "disabled" | "recording" | "paused";
14
+ interface MessageBarProps extends Omit<React.ComponentProps<"div">, "onChange"> {
15
+ /** Estado visual do componente (controlado pelo consumer) */
16
+ state?: MessageBarState;
17
+ /** Valor do input de texto */
18
+ value?: string;
19
+ /** Callback ao digitar */
20
+ onChange?: (value: string) => void;
21
+ /** Callback ao enviar texto (Enter ou clique no botao send) */
22
+ onSendText?: (text: string) => void;
23
+ /** Inicia gravacao (consumer chama MediaRecorder.start) */
24
+ onStartRecording?: () => void;
25
+ /** Pausa gravacao */
26
+ onPauseRecording?: () => void;
27
+ /** Retoma gravacao */
28
+ onResumeRecording?: () => void;
29
+ /** Cancela/deleta gravacao */
30
+ onCancelRecording?: () => void;
31
+ /** Envia o audio gravado */
32
+ onSendAudio?: () => void;
33
+ /** Toggle play/pause do audio gravado durante o estado `paused` */
34
+ onTogglePlay?: () => void;
35
+ /** Duracao da gravacao em segundos (controlado pelo consumer) */
36
+ recordingDuration?: number;
37
+ /** Indica se esta tocando o audio (durante state=paused) */
38
+ isPlaying?: boolean;
39
+ /**
40
+ * MediaStream do microfone (durante state=recording). Quando fornecido,
41
+ * o componente analisa em tempo real e renderiza as barras conforme a voz.
42
+ * Sem stream → fallback para waveform decorativo.
43
+ *
44
+ * Como usar:
45
+ * ```ts
46
+ * const stream = await navigator.mediaDevices.getUserMedia({ audio: true })
47
+ * const recorder = new MediaRecorder(stream)
48
+ * // Passa o MESMO stream pro MessageBar:
49
+ * <MessageBar state="recording" recordingStream={stream} ... />
50
+ * ```
51
+ */
52
+ recordingStream?: MediaStream | null;
53
+ /**
54
+ * Progresso do playback do audio gravado (0-1), usado durante state=paused.
55
+ * Quando fornecido, o waveform mostra barras tocadas/nao tocadas + dot verde
56
+ * sincronizado. Sem isso, o waveform mostra todas as barras como nao tocadas.
57
+ */
58
+ playbackProgress?: number;
59
+ /**
60
+ * Callback ao clicar/arrastar no waveform durante state=paused.
61
+ * Recebe o novo progresso (0-1); o consumer deve setar currentTime do audio.
62
+ */
63
+ onSeekPlayback?: (progress: number) => void;
64
+ /** Placeholder do input */
65
+ placeholder?: string;
66
+ }
67
+ declare function MessageBar({ state, value, onChange, onSendText, onStartRecording, onPauseRecording, onResumeRecording, onCancelRecording, onSendAudio, onTogglePlay, recordingDuration, isPlaying, recordingStream, playbackProgress, onSeekPlayback, placeholder, className, ...props }: MessageBarProps): react_jsx_runtime.JSX.Element;
68
+
69
+ export { MessageBar, type MessageBarProps, type MessageBarState };
@@ -0,0 +1,5 @@
1
+ export { MessageBar } from '../chunk-PW464XEP.js';
2
+ import '../chunk-TYCPXAXF.js';
3
+ import '../chunk-YINJ5YZ5.js';
4
+ //# sourceMappingURL=message-bar.js.map
5
+ //# sourceMappingURL=message-bar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"message-bar.js"}
@@ -0,0 +1,29 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+
4
+ type MessageRatingValue = 1 | 2 | 3 | 4 | 5;
5
+ interface RatingLabel {
6
+ emoji: string;
7
+ title: string;
8
+ subtitle: string;
9
+ }
10
+ type MessageRatingLabels = Record<MessageRatingValue, RatingLabel>;
11
+ interface MessageRatingProps extends Omit<React.ComponentProps<"div">, "onChange" | "defaultValue"> {
12
+ /** Valor selecionado (controlado) */
13
+ value?: MessageRatingValue | null;
14
+ /** Valor inicial (nao controlado) */
15
+ defaultValue?: MessageRatingValue | null;
16
+ /** Callback ao escolher uma opcao */
17
+ onChange?: (value: MessageRatingValue) => void;
18
+ /** Layout. "auto" usa vertical (column) abaixo de sm e horizontal acima */
19
+ layout?: "horizontal" | "vertical" | "auto";
20
+ /** Labels customizadas (default: PT-BR) */
21
+ labels?: Partial<MessageRatingLabels>;
22
+ /** Desabilita a interacao */
23
+ disabled?: boolean;
24
+ /** Titulo opcional acima das opcoes */
25
+ title?: string;
26
+ }
27
+ declare function MessageRating({ value: controlledValue, defaultValue, onChange, layout, labels: labelOverrides, disabled, title, className, ...props }: MessageRatingProps): react_jsx_runtime.JSX.Element;
28
+
29
+ export { MessageRating, type MessageRatingLabels, type MessageRatingProps, type MessageRatingValue, type RatingLabel };
@@ -0,0 +1,5 @@
1
+ export { MessageRating } from '../chunk-37C2K2NM.js';
2
+ import '../chunk-TYCPXAXF.js';
3
+ import '../chunk-YINJ5YZ5.js';
4
+ //# sourceMappingURL=message-rating.js.map
5
+ //# sourceMappingURL=message-rating.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"message-rating.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluencypassdevs/cycle",
3
- "version": "1.6.0",
3
+ "version": "1.9.0",
4
4
  "description": "Cycle Design System — UI component library by Fluencypass",
5
5
  "license": "MIT",
6
6
  "repository": {