@fluencypassdevs/cycle 1.5.0 → 1.6.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.
package/bin/mcp.mjs CHANGED
@@ -248,6 +248,24 @@ const COMPONENTS = [
248
248
  <ProgressDot current={1} total={3} size="lg" theme="brand" />`,
249
249
  keywords: ["progress", "dot", "ponto", "indicador", "carousel", "slide", "paginacao"],
250
250
  },
251
+ {
252
+ name: "CircularProgress",
253
+ import: `import { CircularProgress } from "@fluencypassdevs/cycle"`,
254
+ description: "Indicador de progresso circular com porcentagem 0-100 no centro. 4 sizes (xs=48px, sm=64px, default=80px, lg=120px). Prop autoTheme escolhe cor baseada no value (0-33 critical, 34-66 warning, 67-100 positive). Prop theme aceita qualquer dos 8 temas Cycle.",
255
+ props: [
256
+ { name: "value", type: "number (0-100)", default: "-" },
257
+ { name: "size", type: '"xs" | "sm" | "default" | "lg"', default: '"default"' },
258
+ { name: "theme", type: "string", default: "-" },
259
+ { name: "autoTheme", type: "boolean", default: "false" },
260
+ { name: "showLabel", type: "boolean", default: "true" },
261
+ { name: "label", type: "string", default: "-" },
262
+ ],
263
+ example: `<CircularProgress value={70} />
264
+ <CircularProgress value={25} autoTheme />
265
+ <CircularProgress value={80} theme="theme-class" size="lg" />
266
+ <CircularProgress value={50} showLabel={false} />`,
267
+ keywords: ["progress", "circular", "circle", "anel", "ring", "porcentagem", "percentage", "score", "nota", "aproveitamento"],
268
+ },
251
269
  {
252
270
  name: "FileCard",
253
271
  import: `import { FileCard } from "@fluencypassdevs/cycle"`,
@@ -0,0 +1,130 @@
1
+ import { cn } from './chunk-TYCPXAXF.js';
2
+ import { __objRest, __spreadProps, __spreadValues } from './chunk-YINJ5YZ5.js';
3
+ import { cva } from 'class-variance-authority';
4
+ import { jsxs, jsx } from 'react/jsx-runtime';
5
+
6
+ var SIZE_CONFIG = {
7
+ xs: { px: 48, stroke: 4, fontClass: "text-sm font-semibold" },
8
+ sm: { px: 64, stroke: 5, fontClass: "text-base font-semibold" },
9
+ default: { px: 80, stroke: 6, fontClass: "text-2xl font-semibold" },
10
+ lg: { px: 120, stroke: 8, fontClass: "text-3xl font-semibold" }
11
+ };
12
+ var circularProgressVariants = cva("relative inline-flex shrink-0", {
13
+ variants: {
14
+ size: {
15
+ xs: "size-12",
16
+ sm: "size-16",
17
+ default: "size-20",
18
+ lg: "size-30"
19
+ }
20
+ },
21
+ defaultVariants: {
22
+ size: "default"
23
+ }
24
+ });
25
+ function getAutoTheme(value) {
26
+ if (value < 34) return "theme-critical";
27
+ if (value < 67) return "theme-warning";
28
+ return "theme-positive";
29
+ }
30
+ function CircularProgress(_a) {
31
+ var _b = _a, {
32
+ value,
33
+ size = "default",
34
+ theme,
35
+ autoTheme = false,
36
+ showLabel = true,
37
+ label,
38
+ className
39
+ } = _b, props = __objRest(_b, [
40
+ "value",
41
+ "size",
42
+ "theme",
43
+ "autoTheme",
44
+ "showLabel",
45
+ "label",
46
+ "className"
47
+ ]);
48
+ const clamped = Math.min(100, Math.max(0, value));
49
+ const config = SIZE_CONFIG[size != null ? size : "default"];
50
+ const { px, stroke, fontClass } = config;
51
+ const radius = (px - stroke) / 2;
52
+ const circumference = 2 * Math.PI * radius;
53
+ const dash = clamped / 100 * circumference;
54
+ const resolvedTheme = theme != null ? theme : autoTheme ? getAutoTheme(clamped) : void 0;
55
+ const displayLabel = label != null ? label : `${Math.round(clamped)}%`;
56
+ return /* @__PURE__ */ jsxs(
57
+ "div",
58
+ __spreadProps(__spreadValues({
59
+ "data-slot": "circular-progress",
60
+ role: "progressbar",
61
+ "aria-valuenow": clamped,
62
+ "aria-valuemin": 0,
63
+ "aria-valuemax": 100,
64
+ "aria-label": !showLabel && !label ? `Progress: ${Math.round(clamped)}%` : void 0,
65
+ className: cn(circularProgressVariants({ size }), resolvedTheme, className),
66
+ style: { width: px, height: px }
67
+ }, props), {
68
+ children: [
69
+ /* @__PURE__ */ jsx(
70
+ "div",
71
+ {
72
+ className: cn(
73
+ "absolute rounded-full",
74
+ resolvedTheme ? "bg-accent" : "bg-neutral-input/40"
75
+ ),
76
+ style: { inset: stroke }
77
+ }
78
+ ),
79
+ /* @__PURE__ */ jsxs(
80
+ "svg",
81
+ {
82
+ className: "absolute inset-0 size-full -rotate-90",
83
+ viewBox: `0 0 ${px} ${px}`,
84
+ "aria-hidden": "true",
85
+ children: [
86
+ /* @__PURE__ */ jsx(
87
+ "circle",
88
+ {
89
+ cx: px / 2,
90
+ cy: px / 2,
91
+ r: radius,
92
+ fill: "none",
93
+ strokeWidth: stroke,
94
+ className: cn(resolvedTheme ? "stroke-muted" : "stroke-neutral-input")
95
+ }
96
+ ),
97
+ /* @__PURE__ */ jsx(
98
+ "circle",
99
+ {
100
+ cx: px / 2,
101
+ cy: px / 2,
102
+ r: radius,
103
+ fill: "none",
104
+ strokeWidth: stroke,
105
+ strokeLinecap: "round",
106
+ strokeDasharray: `${dash} ${circumference}`,
107
+ className: cn("transition-[stroke-dasharray] duration-500", resolvedTheme ? "stroke-primary" : "stroke-neutral-foreground")
108
+ }
109
+ )
110
+ ]
111
+ }
112
+ ),
113
+ showLabel && /* @__PURE__ */ jsx(
114
+ "span",
115
+ {
116
+ className: cn(
117
+ "relative z-10 flex size-full items-center justify-center text-neutral-foreground",
118
+ fontClass
119
+ ),
120
+ children: displayLabel
121
+ }
122
+ )
123
+ ]
124
+ })
125
+ );
126
+ }
127
+
128
+ export { CircularProgress, circularProgressVariants };
129
+ //# sourceMappingURL=chunk-A3Z5GGAI.js.map
130
+ //# sourceMappingURL=chunk-A3Z5GGAI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ui/circular-progress.tsx"],"names":[],"mappings":";;;;;AAOA,IAAM,WAAA,GAAc;AAAA,EAClB,IAAI,EAAE,EAAA,EAAI,IAAI,MAAA,EAAQ,CAAA,EAAG,WAAW,uBAAA,EAAwB;AAAA,EAC5D,IAAI,EAAE,EAAA,EAAI,IAAI,MAAA,EAAQ,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AAAA;AACH;AAAA,KAAA;AAAA,GAEJ;AAEJ","file":"chunk-A3Z5GGAI.js","sourcesContent":["import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\n/* ─── Size config ─── */\n\nconst SIZE_CONFIG = {\n xs: { px: 48, stroke: 4, fontClass: \"text-sm font-semibold\" },\n sm: { px: 64, stroke: 5, fontClass: \"text-base font-semibold\" },\n default: { px: 80, stroke: 6, fontClass: \"text-2xl font-semibold\" },\n lg: { px: 120, stroke: 8, fontClass: \"text-3xl font-semibold\" },\n} as const\n\nconst circularProgressVariants = cva(\"relative inline-flex shrink-0\", {\n variants: {\n size: {\n xs: \"size-12\",\n sm: \"size-16\",\n default: \"size-20\",\n lg: \"size-30\",\n },\n },\n defaultVariants: {\n size: \"default\",\n },\n})\n\n/* ─── Auto-theme thresholds ─── */\n\nfunction getAutoTheme(value: number): string {\n if (value < 34) return \"theme-critical\"\n if (value < 67) return \"theme-warning\"\n return \"theme-positive\"\n}\n\nexport interface CircularProgressProps\n extends Omit<React.ComponentProps<\"div\">, \"children\">,\n VariantProps<typeof circularProgressVariants> {\n /** Valor de 0 a 100 (clamped) */\n value: number\n /** Classe de tema fixa (ex: \"theme-brand\", \"theme-class\"). Tem precedencia sobre autoTheme. */\n theme?: string\n /** Se true, escolhe o tema automaticamente: 0–33 critical, 34–66 warning, 67–100 positive. */\n autoTheme?: boolean\n /** Mostrar label central com a porcentagem (default true) */\n showLabel?: boolean\n /** Label customizado — sobrescreve `${value}%` */\n label?: string\n}\n\nfunction CircularProgress({\n value,\n size = \"default\",\n theme,\n autoTheme = false,\n showLabel = true,\n label,\n className,\n ...props\n}: CircularProgressProps) {\n const clamped = Math.min(100, Math.max(0, value))\n const config = SIZE_CONFIG[size ?? \"default\"]\n const { px, stroke, fontClass } = config\n\n const radius = (px - stroke) / 2\n const circumference = 2 * Math.PI * radius\n const dash = (clamped / 100) * circumference\n\n const resolvedTheme = theme ?? (autoTheme ? getAutoTheme(clamped) : undefined)\n const displayLabel = label ?? `${Math.round(clamped)}%`\n\n return (\n <div\n data-slot=\"circular-progress\"\n role=\"progressbar\"\n aria-valuenow={clamped}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-label={!showLabel && !label ? `Progress: ${Math.round(clamped)}%` : undefined}\n className={cn(circularProgressVariants({ size }), resolvedTheme, className)}\n style={{ width: px, height: px }}\n {...props}\n >\n {/* Inner pastel fill */}\n <div\n className={cn(\n \"absolute rounded-full\",\n resolvedTheme ? \"bg-accent\" : \"bg-neutral-input/40\"\n )}\n style={{ inset: stroke }}\n />\n\n {/* Progress arcs */}\n <svg\n className=\"absolute inset-0 size-full -rotate-90\"\n viewBox={`0 0 ${px} ${px}`}\n aria-hidden=\"true\"\n >\n <circle\n cx={px / 2}\n cy={px / 2}\n r={radius}\n fill=\"none\"\n strokeWidth={stroke}\n className={cn(resolvedTheme ? \"stroke-muted\" : \"stroke-neutral-input\")}\n />\n <circle\n cx={px / 2}\n cy={px / 2}\n r={radius}\n fill=\"none\"\n strokeWidth={stroke}\n strokeLinecap=\"round\"\n strokeDasharray={`${dash} ${circumference}`}\n className={cn(\"transition-[stroke-dasharray] duration-500\", resolvedTheme ? \"stroke-primary\" : \"stroke-neutral-foreground\")}\n />\n </svg>\n\n {/* Center label */}\n {showLabel && (\n <span\n className={cn(\n \"relative z-10 flex size-full items-center justify-center text-neutral-foreground\",\n fontClass\n )}\n >\n {displayLabel}\n </span>\n )}\n </div>\n )\n}\n\nexport { CircularProgress, circularProgressVariants }\n"]}
@@ -0,0 +1,303 @@
1
+ import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from './chunk-IGMII4BK.js';
2
+ import { CycleIcon } from './chunk-V7M2NHUO.js';
3
+ import { toggleVariants } from './chunk-CIM6KJH5.js';
4
+ import { cn } from './chunk-TYCPXAXF.js';
5
+ import { __spreadValues } from './chunk-YINJ5YZ5.js';
6
+ import * as React from 'react';
7
+ import { useEditor, EditorContent } from '@tiptap/react';
8
+ import StarterKit from '@tiptap/starter-kit';
9
+ import Underline from '@tiptap/extension-underline';
10
+ import Placeholder from '@tiptap/extension-placeholder';
11
+ import { Undo2, Redo2, Bold, Italic, Underline as Underline$1, Strikethrough, Heading2, List, ListOrdered } from 'lucide-react';
12
+ import { jsxs, jsx } from 'react/jsx-runtime';
13
+
14
+ function ToolbarDivider() {
15
+ return /* @__PURE__ */ jsx("div", { className: "mx-1 h-5 w-px bg-neutral-border", "aria-hidden": "true" });
16
+ }
17
+ function ToolbarToggle({ pressed, onToggle, icon, label, disabled }) {
18
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [
19
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
20
+ "button",
21
+ {
22
+ type: "button",
23
+ className: cn(
24
+ toggleVariants({ variant: "default", size: "icon-sm" }),
25
+ pressed && "bg-accent text-accent-foreground"
26
+ ),
27
+ onClick: onToggle,
28
+ "aria-pressed": pressed,
29
+ "aria-label": label,
30
+ disabled,
31
+ "data-state": pressed ? "on" : "off",
32
+ children: /* @__PURE__ */ jsx(CycleIcon, { icon, size: "xs", decorative: true })
33
+ }
34
+ ) }),
35
+ /* @__PURE__ */ jsx(TooltipContent, { children: label })
36
+ ] });
37
+ }
38
+ function getToolbarState(editor) {
39
+ return {
40
+ isBold: editor.isActive("bold"),
41
+ isItalic: editor.isActive("italic"),
42
+ isUnderline: editor.isActive("underline"),
43
+ isStrike: editor.isActive("strike"),
44
+ isH2: editor.isActive("heading", { level: 2 }),
45
+ isBulletList: editor.isActive("bulletList"),
46
+ isOrderedList: editor.isActive("orderedList"),
47
+ canUndo: editor.can().undo(),
48
+ canRedo: editor.can().redo()
49
+ };
50
+ }
51
+ function EditorToolbar({ editor, state, theme }) {
52
+ const {
53
+ isBold,
54
+ isItalic,
55
+ isUnderline,
56
+ isStrike,
57
+ isH2,
58
+ isBulletList,
59
+ isOrderedList,
60
+ canUndo,
61
+ canRedo
62
+ } = state;
63
+ return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(
64
+ "div",
65
+ {
66
+ className: cn(
67
+ "flex items-center gap-0.5 overflow-x-auto border-b border-neutral-border px-2 py-1.5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
68
+ theme
69
+ ),
70
+ role: "toolbar",
71
+ "aria-label": "Formatting options",
72
+ children: [
73
+ /* @__PURE__ */ jsx(
74
+ ToolbarToggle,
75
+ {
76
+ pressed: false,
77
+ onToggle: () => editor.chain().focus().undo().run(),
78
+ icon: Undo2,
79
+ label: "Undo",
80
+ disabled: !canUndo
81
+ }
82
+ ),
83
+ /* @__PURE__ */ jsx(
84
+ ToolbarToggle,
85
+ {
86
+ pressed: false,
87
+ onToggle: () => editor.chain().focus().redo().run(),
88
+ icon: Redo2,
89
+ label: "Redo",
90
+ disabled: !canRedo
91
+ }
92
+ ),
93
+ /* @__PURE__ */ jsx(ToolbarDivider, {}),
94
+ /* @__PURE__ */ jsx(
95
+ ToolbarToggle,
96
+ {
97
+ pressed: isBold,
98
+ onToggle: () => editor.chain().focus().toggleBold().run(),
99
+ icon: Bold,
100
+ label: "Bold"
101
+ }
102
+ ),
103
+ /* @__PURE__ */ jsx(
104
+ ToolbarToggle,
105
+ {
106
+ pressed: isItalic,
107
+ onToggle: () => editor.chain().focus().toggleItalic().run(),
108
+ icon: Italic,
109
+ label: "Italic"
110
+ }
111
+ ),
112
+ /* @__PURE__ */ jsx(
113
+ ToolbarToggle,
114
+ {
115
+ pressed: isUnderline,
116
+ onToggle: () => editor.chain().focus().toggleUnderline().run(),
117
+ icon: Underline$1,
118
+ label: "Underline"
119
+ }
120
+ ),
121
+ /* @__PURE__ */ jsx(
122
+ ToolbarToggle,
123
+ {
124
+ pressed: isStrike,
125
+ onToggle: () => editor.chain().focus().toggleStrike().run(),
126
+ icon: Strikethrough,
127
+ label: "Strikethrough"
128
+ }
129
+ ),
130
+ /* @__PURE__ */ jsx(ToolbarDivider, {}),
131
+ /* @__PURE__ */ jsx(
132
+ ToolbarToggle,
133
+ {
134
+ pressed: isH2,
135
+ onToggle: () => editor.chain().focus().toggleHeading({ level: 2 }).run(),
136
+ icon: Heading2,
137
+ label: "Heading 2"
138
+ }
139
+ ),
140
+ /* @__PURE__ */ jsx(ToolbarDivider, {}),
141
+ /* @__PURE__ */ jsx(
142
+ ToolbarToggle,
143
+ {
144
+ pressed: isBulletList,
145
+ onToggle: () => editor.chain().focus().toggleBulletList().run(),
146
+ icon: List,
147
+ label: "Bullet list"
148
+ }
149
+ ),
150
+ /* @__PURE__ */ jsx(
151
+ ToolbarToggle,
152
+ {
153
+ pressed: isOrderedList,
154
+ onToggle: () => editor.chain().focus().toggleOrderedList().run(),
155
+ icon: ListOrdered,
156
+ label: "Ordered list"
157
+ }
158
+ )
159
+ ]
160
+ }
161
+ ) });
162
+ }
163
+ var Editor = React.forwardRef(
164
+ function Editor2({
165
+ content,
166
+ defaultContent,
167
+ onChange,
168
+ placeholder = "Type something...",
169
+ editable = true,
170
+ className,
171
+ autoFocus = false,
172
+ maxHeight,
173
+ minHeight = "120px",
174
+ resizable = false,
175
+ toolbarTheme
176
+ }, ref) {
177
+ var _a;
178
+ const [toolbarState, setToolbarState] = React.useState({
179
+ isBold: false,
180
+ isItalic: false,
181
+ isUnderline: false,
182
+ isStrike: false,
183
+ isH2: false,
184
+ isBulletList: false,
185
+ isOrderedList: false,
186
+ canUndo: false,
187
+ canRedo: false
188
+ });
189
+ const onChangeRef = React.useRef(onChange);
190
+ onChangeRef.current = onChange;
191
+ const editor = useEditor({
192
+ immediatelyRender: false,
193
+ extensions: [
194
+ StarterKit.configure({
195
+ heading: { levels: [2] }
196
+ }),
197
+ Underline,
198
+ Placeholder.configure({ placeholder })
199
+ ],
200
+ content: (_a = defaultContent != null ? defaultContent : content) != null ? _a : "",
201
+ editable,
202
+ autofocus: autoFocus,
203
+ onUpdate: ({ editor: e }) => {
204
+ var _a2;
205
+ (_a2 = onChangeRef.current) == null ? void 0 : _a2.call(onChangeRef, e.getHTML());
206
+ }
207
+ });
208
+ React.useEffect(() => {
209
+ if (!editor) return;
210
+ const sync = () => setToolbarState(getToolbarState(editor));
211
+ sync();
212
+ editor.on("transaction", sync);
213
+ return () => {
214
+ editor.off("transaction", sync);
215
+ };
216
+ }, [editor]);
217
+ React.useEffect(() => {
218
+ if (content !== void 0 && editor && editor.getHTML() !== content) {
219
+ editor.commands.setContent(content, { emitUpdate: false });
220
+ }
221
+ }, [content, editor]);
222
+ React.useEffect(() => {
223
+ editor == null ? void 0 : editor.setEditable(editable);
224
+ }, [editable, editor]);
225
+ React.useImperativeHandle(ref, () => ({
226
+ editor,
227
+ getHTML: () => {
228
+ var _a2;
229
+ return (_a2 = editor == null ? void 0 : editor.getHTML()) != null ? _a2 : "";
230
+ },
231
+ getText: () => {
232
+ var _a2;
233
+ return (_a2 = editor == null ? void 0 : editor.getText()) != null ? _a2 : "";
234
+ },
235
+ clear: () => {
236
+ editor == null ? void 0 : editor.commands.clearContent();
237
+ },
238
+ focus: () => {
239
+ editor == null ? void 0 : editor.commands.focus();
240
+ }
241
+ }), [editor]);
242
+ if (!editor) return null;
243
+ return /* @__PURE__ */ jsxs(
244
+ "div",
245
+ {
246
+ "data-editor-wrapper": true,
247
+ className: cn(
248
+ // Base — same tokens as Textarea (outline variant)
249
+ "w-full rounded-lg border border-neutral-border bg-transparent text-neutral-foreground shadow-xs dark:shadow-none",
250
+ "transition-[color,border-color,box-shadow,background-color] outline-none",
251
+ // Hover
252
+ "hover:border-ring hover:bg-ring/5",
253
+ // Focus-within (focus is on nested contenteditable, not the wrapper)
254
+ "focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50 focus-within:bg-ring/5",
255
+ // Error
256
+ "aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:hover:border-destructive dark:aria-invalid:border-destructive dark:aria-invalid:ring-destructive/40",
257
+ // Disabled
258
+ !editable && "opacity-50 cursor-not-allowed pointer-events-none",
259
+ className
260
+ ),
261
+ children: [
262
+ /* @__PURE__ */ jsx("style", { children: `
263
+ [data-editor-wrapper] .tiptap {
264
+ min-height: var(--editor-min-h, 120px);
265
+ max-height: var(--editor-max-h, none);
266
+ }
267
+ [data-editor-wrapper] .tiptap p.is-editor-empty:first-child::before {
268
+ color: var(--color-neutral-muted-foreground);
269
+ content: attr(data-placeholder);
270
+ float: left;
271
+ height: 0;
272
+ pointer-events: none;
273
+ }
274
+ ` }),
275
+ /* @__PURE__ */ jsx(EditorToolbar, { editor, state: toolbarState, theme: toolbarTheme }),
276
+ /* @__PURE__ */ jsx(
277
+ EditorContent,
278
+ {
279
+ editor,
280
+ className: cn(
281
+ "text-sm text-foreground",
282
+ "selection:bg-primary selection:text-primary-foreground",
283
+ resizable && "resize-y",
284
+ // Scroll on .tiptap directly — Tiptap auto-scrolls to keep cursor in view
285
+ "[&_.tiptap]:outline-none [&_.tiptap]:overflow-y-auto [&_.tiptap]:px-4 [&_.tiptap]:py-2",
286
+ "[&_.tiptap_p]:my-1.5 [&_.tiptap_p]:leading-relaxed",
287
+ "[&_.tiptap_h2]:my-2 [&_.tiptap_h2]:text-lg [&_.tiptap_h2]:font-semibold",
288
+ "[&_.tiptap_ul]:my-1.5 [&_.tiptap_ul]:list-disc [&_.tiptap_ul]:pl-6",
289
+ "[&_.tiptap_ol]:my-1.5 [&_.tiptap_ol]:list-decimal [&_.tiptap_ol]:pl-6",
290
+ "[&_.tiptap_li]:my-0.5"
291
+ ),
292
+ style: __spreadValues(__spreadValues({}, minHeight && { ["--editor-min-h"]: minHeight }), maxHeight && { ["--editor-max-h"]: maxHeight })
293
+ }
294
+ )
295
+ ]
296
+ }
297
+ );
298
+ }
299
+ );
300
+
301
+ export { Editor };
302
+ //# sourceMappingURL=chunk-D4UH2HJQ.js.map
303
+ //# sourceMappingURL=chunk-D4UH2HJQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ui/editor.tsx"],"names":["UnderlineIcon","Editor","_a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CAAA,cAAA,CAAA,EAAA,EACD,SAAA,IAAa,EAAE,CAAC,gBAA0B,GAAG,SAAA,EAAU,CAAA,EACvD,SAAA,IAAa,EAAE,CAAC,gBAA0B,GAAG,SAAA,EAAU;AAAA;AAAA;AAE/D;AAAA;AAAA,KACF;AAAA,EAEJ;AACF","file":"chunk-D4UH2HJQ.js","sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { useEditor, EditorContent, type Editor as TiptapEditor } from \"@tiptap/react\"\nimport StarterKit from \"@tiptap/starter-kit\"\nimport Underline from \"@tiptap/extension-underline\"\nimport Placeholder from \"@tiptap/extension-placeholder\"\nimport {\n Bold,\n Italic,\n Underline as UnderlineIcon,\n Strikethrough,\n Heading2,\n List,\n ListOrdered,\n Undo2,\n Redo2,\n type LucideIcon,\n} from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { toggleVariants } from \"@/components/ui/toggle\"\nimport {\n Tooltip,\n TooltipTrigger,\n TooltipContent,\n TooltipProvider,\n} from \"@/components/ui/tooltip\"\nimport { CycleIcon } from \"@/components/icons\"\n\n// ── Types ────────────────────────────────────────────────────────────\n\nexport interface EditorRef {\n /** The Tiptap editor instance */\n editor: TiptapEditor | null\n /** Get current HTML content */\n getHTML: () => string\n /** Get current plain-text content */\n getText: () => string\n /** Clear the editor */\n clear: () => void\n /** Focus the editor */\n focus: () => void\n}\n\nexport interface EditorProps {\n /** HTML content (controlled) */\n content?: string\n /** Default HTML content (uncontrolled) */\n defaultContent?: string\n /** Called when content changes with the HTML string */\n onChange?: (html: string) => void\n /** Placeholder text shown when the editor is empty */\n placeholder?: string\n /** Whether the editor is editable */\n editable?: boolean\n /** Additional class for the outer wrapper */\n className?: string\n /** Auto-focus the editor on mount */\n autoFocus?: boolean\n /** Max height of the content area — scrolls when exceeded (e.g. \"300px\", \"50vh\") */\n maxHeight?: string\n /** Min height of the content area (default: \"120px\") */\n minHeight?: string\n /** Allow the user to resize the editor vertically */\n resizable?: boolean\n /** Theme class for the toolbar pressed state (e.g. \"theme-class\", \"theme-brand\") */\n toolbarTheme?: string\n}\n\n// ── Toolbar internals ────────────────────────────────────────────────\n\nfunction ToolbarDivider() {\n return <div className=\"mx-1 h-5 w-px bg-neutral-border\" aria-hidden=\"true\" />\n}\n\ninterface ToolbarToggleProps {\n pressed: boolean\n onToggle: () => void\n icon: LucideIcon\n label: string\n disabled?: boolean\n}\n\nfunction ToolbarToggle({ pressed, onToggle, icon, label, disabled }: ToolbarToggleProps) {\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n className={cn(\n toggleVariants({ variant: \"default\", size: \"icon-sm\" }),\n pressed && \"bg-accent text-accent-foreground\"\n )}\n onClick={onToggle}\n aria-pressed={pressed}\n aria-label={label}\n disabled={disabled}\n data-state={pressed ? \"on\" : \"off\"}\n >\n <CycleIcon icon={icon} size=\"xs\" decorative />\n </button>\n </TooltipTrigger>\n <TooltipContent>{label}</TooltipContent>\n </Tooltip>\n )\n}\n\ninterface ToolbarState {\n isBold: boolean\n isItalic: boolean\n isUnderline: boolean\n isStrike: boolean\n isH2: boolean\n isBulletList: boolean\n isOrderedList: boolean\n canUndo: boolean\n canRedo: boolean\n}\n\nfunction getToolbarState(editor: TiptapEditor): ToolbarState {\n return {\n isBold: editor.isActive(\"bold\"),\n isItalic: editor.isActive(\"italic\"),\n isUnderline: editor.isActive(\"underline\"),\n isStrike: editor.isActive(\"strike\"),\n isH2: editor.isActive(\"heading\", { level: 2 }),\n isBulletList: editor.isActive(\"bulletList\"),\n isOrderedList: editor.isActive(\"orderedList\"),\n canUndo: editor.can().undo(),\n canRedo: editor.can().redo(),\n }\n}\n\nfunction EditorToolbar({ editor, state, theme }: { editor: TiptapEditor; state: ToolbarState; theme?: string }) {\n const {\n isBold, isItalic, isUnderline, isStrike, isH2,\n isBulletList, isOrderedList, canUndo, canRedo,\n } = state\n\n return (\n <TooltipProvider>\n <div\n className={cn(\n \"flex items-center gap-0.5 overflow-x-auto border-b border-neutral-border px-2 py-1.5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\",\n theme\n )}\n role=\"toolbar\"\n aria-label=\"Formatting options\"\n >\n {/* History */}\n <ToolbarToggle\n pressed={false}\n onToggle={() => editor.chain().focus().undo().run()}\n icon={Undo2}\n label=\"Undo\"\n disabled={!canUndo}\n />\n <ToolbarToggle\n pressed={false}\n onToggle={() => editor.chain().focus().redo().run()}\n icon={Redo2}\n label=\"Redo\"\n disabled={!canRedo}\n />\n\n <ToolbarDivider />\n\n {/* Text formatting */}\n <ToolbarToggle\n pressed={isBold}\n onToggle={() => editor.chain().focus().toggleBold().run()}\n icon={Bold}\n label=\"Bold\"\n />\n <ToolbarToggle\n pressed={isItalic}\n onToggle={() => editor.chain().focus().toggleItalic().run()}\n icon={Italic}\n label=\"Italic\"\n />\n <ToolbarToggle\n pressed={isUnderline}\n onToggle={() => editor.chain().focus().toggleUnderline().run()}\n icon={UnderlineIcon}\n label=\"Underline\"\n />\n <ToolbarToggle\n pressed={isStrike}\n onToggle={() => editor.chain().focus().toggleStrike().run()}\n icon={Strikethrough}\n label=\"Strikethrough\"\n />\n\n <ToolbarDivider />\n\n {/* Heading */}\n <ToolbarToggle\n pressed={isH2}\n onToggle={() => editor.chain().focus().toggleHeading({ level: 2 }).run()}\n icon={Heading2}\n label=\"Heading 2\"\n />\n\n <ToolbarDivider />\n\n {/* Lists */}\n <ToolbarToggle\n pressed={isBulletList}\n onToggle={() => editor.chain().focus().toggleBulletList().run()}\n icon={List}\n label=\"Bullet list\"\n />\n <ToolbarToggle\n pressed={isOrderedList}\n onToggle={() => editor.chain().focus().toggleOrderedList().run()}\n icon={ListOrdered}\n label=\"Ordered list\"\n />\n </div>\n </TooltipProvider>\n )\n}\n\n// ── Editor ───────────────────────────────────────────────────────────\n\nconst Editor = React.forwardRef<EditorRef, EditorProps>(\n function Editor(\n {\n content,\n defaultContent,\n onChange,\n placeholder = \"Type something...\",\n editable = true,\n className,\n autoFocus = false,\n maxHeight,\n minHeight = \"120px\",\n resizable = false,\n toolbarTheme,\n },\n ref\n ) {\n const [toolbarState, setToolbarState] = React.useState<ToolbarState>({\n isBold: false, isItalic: false, isUnderline: false, isStrike: false,\n isH2: false, isBulletList: false, isOrderedList: false,\n canUndo: false, canRedo: false,\n })\n\n const onChangeRef = React.useRef(onChange)\n onChangeRef.current = onChange\n\n const editor = useEditor({\n immediatelyRender: false,\n extensions: [\n StarterKit.configure({\n heading: { levels: [2] },\n }),\n Underline,\n Placeholder.configure({ placeholder }),\n ],\n content: defaultContent ?? content ?? \"\",\n editable,\n autofocus: autoFocus,\n onUpdate: ({ editor: e }) => {\n onChangeRef.current?.(e.getHTML())\n },\n })\n\n // Subscribe to editor events directly — avoids stale closure issues\n // with useEditor callbacks on React 19\n React.useEffect(() => {\n if (!editor) return\n const sync = () => setToolbarState(getToolbarState(editor))\n sync()\n editor.on(\"transaction\", sync)\n return () => { editor.off(\"transaction\", sync) }\n }, [editor])\n\n // Sync controlled content\n React.useEffect(() => {\n if (content !== undefined && editor && editor.getHTML() !== content) {\n editor.commands.setContent(content, { emitUpdate: false })\n }\n }, [content, editor])\n\n // Sync editable\n React.useEffect(() => {\n editor?.setEditable(editable)\n }, [editable, editor])\n\n // Expose ref\n React.useImperativeHandle(ref, () => ({\n editor,\n getHTML: () => editor?.getHTML() ?? \"\",\n getText: () => editor?.getText() ?? \"\",\n clear: () => { editor?.commands.clearContent() },\n focus: () => { editor?.commands.focus() },\n }), [editor])\n\n if (!editor) return null\n\n return (\n <div\n data-editor-wrapper\n className={cn(\n // Base — same tokens as Textarea (outline variant)\n \"w-full rounded-lg border border-neutral-border bg-transparent text-neutral-foreground shadow-xs dark:shadow-none\",\n \"transition-[color,border-color,box-shadow,background-color] outline-none\",\n // Hover\n \"hover:border-ring hover:bg-ring/5\",\n // Focus-within (focus is on nested contenteditable, not the wrapper)\n \"focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50 focus-within:bg-ring/5\",\n // Error\n \"aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:hover:border-destructive dark:aria-invalid:border-destructive dark:aria-invalid:ring-destructive/40\",\n // Disabled\n !editable && \"opacity-50 cursor-not-allowed pointer-events-none\",\n className\n )}\n >\n {/* Scoped styles: placeholder + Tiptap scroll/sizing */}\n <style>{`\n [data-editor-wrapper] .tiptap {\n min-height: var(--editor-min-h, 120px);\n max-height: var(--editor-max-h, none);\n }\n [data-editor-wrapper] .tiptap p.is-editor-empty:first-child::before {\n color: var(--color-neutral-muted-foreground);\n content: attr(data-placeholder);\n float: left;\n height: 0;\n pointer-events: none;\n }\n `}</style>\n\n <EditorToolbar editor={editor} state={toolbarState} theme={toolbarTheme} />\n\n <EditorContent\n editor={editor}\n className={cn(\n \"text-sm text-foreground\",\n \"selection:bg-primary selection:text-primary-foreground\",\n resizable && \"resize-y\",\n // Scroll on .tiptap directly — Tiptap auto-scrolls to keep cursor in view\n \"[&_.tiptap]:outline-none [&_.tiptap]:overflow-y-auto [&_.tiptap]:px-4 [&_.tiptap]:py-2\",\n \"[&_.tiptap_p]:my-1.5 [&_.tiptap_p]:leading-relaxed\",\n \"[&_.tiptap_h2]:my-2 [&_.tiptap_h2]:text-lg [&_.tiptap_h2]:font-semibold\",\n \"[&_.tiptap_ul]:my-1.5 [&_.tiptap_ul]:list-disc [&_.tiptap_ul]:pl-6\",\n \"[&_.tiptap_ol]:my-1.5 [&_.tiptap_ol]:list-decimal [&_.tiptap_ol]:pl-6\",\n \"[&_.tiptap_li]:my-0.5\",\n )}\n style={{\n ...(minHeight && { [\"--editor-min-h\" as string]: minHeight }),\n ...(maxHeight && { [\"--editor-max-h\" as string]: maxHeight }),\n }}\n />\n </div>\n )\n }\n)\n\nexport { Editor }\n"]}
package/dist/index.d.ts CHANGED
@@ -20,6 +20,7 @@ export { Toggle, ToggleProps, toggleVariants } from './ui/toggle.js';
20
20
  export { Progress, ProgressProps, indicatorVariants, progressVariants } from './ui/progress.js';
21
21
  export { ProgressStage, ProgressStageProps } from './ui/progress-stage.js';
22
22
  export { ProgressDot, ProgressDotProps, dotVariants, progressDotVariants } from './ui/progress-dot.js';
23
+ export { CircularProgress, CircularProgressProps, circularProgressVariants } from './ui/circular-progress.js';
23
24
  export { FileCard, FileCardProps, fileCardVariants } from './ui/file-card.js';
24
25
  export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage } from './ui/avatar.js';
25
26
  export { ChatBubble, ChatBubbleProps, chatBubbleVariants } from './ui/chat-bubble.js';
@@ -43,6 +44,7 @@ export { Fab, FabProps, fabVariants } from './ui/fab.js';
43
44
  export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger } from './ui/drawer.js';
44
45
  export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from './ui/dialog.js';
45
46
  export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from './ui/dropdown-menu.js';
47
+ export { Editor, EditorProps, EditorRef } from './ui/editor.js';
46
48
  import 'clsx';
47
49
  import 'react';
48
50
  import 'lucide-react';
@@ -54,3 +56,4 @@ import '@vidstack/react/player/layouts/default';
54
56
  import 'sonner';
55
57
  import 'react-resizable-panels';
56
58
  import 'vaul';
59
+ import '@tiptap/react';
package/dist/index.js CHANGED
@@ -1,6 +1,9 @@
1
+ export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger } from './chunk-YJ4U7ISM.js';
1
2
  export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from './chunk-NOMLQHZS.js';
3
+ export { Editor } from './chunk-D4UH2HJQ.js';
2
4
  export { ClassLogo, GroupTalkLogo, PrivateTalkLogo, ProductLogo } from './chunk-66CU7J2I.js';
3
5
  export { FluencypassIcon, FluencypassLogo } from './chunk-5LZHXNBV.js';
6
+ export { Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger } from './chunk-EF6FQT4Y.js';
4
7
  export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './chunk-IGMII4BK.js';
5
8
  export { ResizableHandle, ResizablePanel, ResizablePanelGroup } from './chunk-PY2BIZNB.js';
6
9
  export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from './chunk-F2Q3E2ZM.js';
@@ -8,7 +11,7 @@ export { Skeleton } from './chunk-2EKU7RP4.js';
8
11
  export { Spinner } from './chunk-5XNYJECW.js';
9
12
  export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from './chunk-5NKTYXWQ.js';
10
13
  export { Fab, fabVariants } from './chunk-7NFHHOAE.js';
11
- export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger } from './chunk-YJ4U7ISM.js';
14
+ export { LiveWaiting } from './chunk-PCLVQPIG.js';
12
15
  export { AudioPlayer } from './chunk-DCNZ2DRR.js';
13
16
  export { VideoPlayer } from './chunk-V3CBOIGK.js';
14
17
  export { playerLocales } from './chunk-C6BQAAHX.js';
@@ -16,16 +19,15 @@ export { Toaster, cycleToast } from './chunk-ELZCZ6ZH.js';
16
19
  export { Alert, AlertAction, AlertClose, AlertDescription, AlertTitle, alertVariants } from './chunk-7ZXAU2CD.js';
17
20
  export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger } from './chunk-3EFI7PYC.js';
18
21
  export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue } from './chunk-SZUWVHP4.js';
19
- export { Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger } from './chunk-EF6FQT4Y.js';
20
22
  export { ProgressStage } from './chunk-NYJMA2T7.js';
21
23
  export { ProgressDot, dotVariants, progressDotVariants } from './chunk-ZTANTDKS.js';
24
+ export { CircularProgress, circularProgressVariants } from './chunk-A3Z5GGAI.js';
22
25
  export { FileCard, fileCardVariants } from './chunk-JMNMW54C.js';
23
26
  export { ChatPanel } from './chunk-L32AMI4K.js';
24
27
  export { ChatBubble, chatBubbleVariants } from './chunk-HZJRM5EK.js';
28
+ export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage } from './chunk-MSLQRGSP.js';
25
29
  export { LikeDislike, likeDislikeVariants } from './chunk-F2XA2Z75.js';
26
30
  export { Achievement, Ai, Answer, Badge as BadgeIcon, Certificate, Chat as ChatIcon, Checkpoint, Completion, Conversation, Course, Deadline, Dialogue, Dictionary, Diploma, DotLive, Exercise, Feedback, Flashcard, Fluency, Goal, Grammar, GroupClass, Highlight, Language, Lesson, Listening, Live, MemoryCard, Milestone, Module, Presentation, PrivateClass, Progress as ProgressIcon, Question, Quiz, Ray, Reading, Recap, RecordedClass, Recurring, Repetition, Required, Schedule, Sentence, Streak, Task, Translate, Unit, Vocabulary, Whiteboard } from './chunk-JPEDYOV7.js';
27
- export { LiveWaiting } from './chunk-PCLVQPIG.js';
28
- export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage } from './chunk-MSLQRGSP.js';
29
31
  export { CycleIcon, ICON_SIZES } from './chunk-V7M2NHUO.js';
30
32
  export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from './chunk-QZVQPUVT.js';
31
33
  export { ScrollArea, ScrollBar } from './chunk-3LXU5C35.js';
@@ -4,8 +4,8 @@ import * as React from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const badgeVariants: (props?: ({
7
- variant?: "link" | "progress" | "default" | "outline" | "destructive" | "secondary" | "ghost" | "muted" | "success" | "progress-completed" | null | undefined;
8
- size?: "sm" | "default" | "lg" | null | undefined;
7
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "progress" | "muted" | "success" | "progress-completed" | null | undefined;
8
+ size?: "sm" | "lg" | "default" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  interface BadgeProps extends React.ComponentProps<"span">, VariantProps<typeof badgeVariants> {
11
11
  asChild?: boolean;
@@ -4,8 +4,8 @@ import * as React from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const buttonVariants: (props?: ({
7
- variant?: "link" | "default" | "outline" | "destructive" | "secondary" | "ghost" | null | undefined;
8
- size?: "sm" | "default" | "lg" | "xs" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
7
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
8
+ size?: "xs" | "sm" | "lg" | "icon" | "default" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  interface ButtonProps extends React.ComponentProps<"button">, VariantProps<typeof buttonVariants> {
11
11
  asChild?: boolean;
@@ -5,7 +5,7 @@ import { Checkbox as Checkbox$1 } from 'radix-ui';
5
5
  import { VariantProps } from 'class-variance-authority';
6
6
 
7
7
  declare const checkboxVariants: (props?: ({
8
- size?: "sm" | "default" | "lg" | null | undefined;
8
+ size?: "sm" | "lg" | "default" | null | undefined;
9
9
  variant?: "default" | "circular" | null | undefined;
10
10
  } & class_variance_authority_types.ClassProp) | undefined) => string;
11
11
  interface CheckboxProps extends React.ComponentProps<typeof Checkbox$1.Root>, VariantProps<typeof checkboxVariants> {
@@ -0,0 +1,23 @@
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
+ declare const circularProgressVariants: (props?: ({
7
+ size?: "xs" | "sm" | "lg" | "default" | null | undefined;
8
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
9
+ interface CircularProgressProps extends Omit<React.ComponentProps<"div">, "children">, VariantProps<typeof circularProgressVariants> {
10
+ /** Valor de 0 a 100 (clamped) */
11
+ value: number;
12
+ /** Classe de tema fixa (ex: "theme-brand", "theme-class"). Tem precedencia sobre autoTheme. */
13
+ theme?: string;
14
+ /** Se true, escolhe o tema automaticamente: 0–33 critical, 34–66 warning, 67–100 positive. */
15
+ autoTheme?: boolean;
16
+ /** Mostrar label central com a porcentagem (default true) */
17
+ showLabel?: boolean;
18
+ /** Label customizado — sobrescreve `${value}%` */
19
+ label?: string;
20
+ }
21
+ declare function CircularProgress({ value, size, theme, autoTheme, showLabel, label, className, ...props }: CircularProgressProps): react_jsx_runtime.JSX.Element;
22
+
23
+ export { CircularProgress, type CircularProgressProps, circularProgressVariants };
@@ -0,0 +1,5 @@
1
+ export { CircularProgress, circularProgressVariants } from '../chunk-A3Z5GGAI.js';
2
+ import '../chunk-TYCPXAXF.js';
3
+ import '../chunk-YINJ5YZ5.js';
4
+ //# sourceMappingURL=circular-progress.js.map
5
+ //# sourceMappingURL=circular-progress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"circular-progress.js"}
@@ -0,0 +1,42 @@
1
+ import * as React from 'react';
2
+ import { Editor as Editor$1 } from '@tiptap/react';
3
+
4
+ interface EditorRef {
5
+ /** The Tiptap editor instance */
6
+ editor: Editor$1 | null;
7
+ /** Get current HTML content */
8
+ getHTML: () => string;
9
+ /** Get current plain-text content */
10
+ getText: () => string;
11
+ /** Clear the editor */
12
+ clear: () => void;
13
+ /** Focus the editor */
14
+ focus: () => void;
15
+ }
16
+ interface EditorProps {
17
+ /** HTML content (controlled) */
18
+ content?: string;
19
+ /** Default HTML content (uncontrolled) */
20
+ defaultContent?: string;
21
+ /** Called when content changes with the HTML string */
22
+ onChange?: (html: string) => void;
23
+ /** Placeholder text shown when the editor is empty */
24
+ placeholder?: string;
25
+ /** Whether the editor is editable */
26
+ editable?: boolean;
27
+ /** Additional class for the outer wrapper */
28
+ className?: string;
29
+ /** Auto-focus the editor on mount */
30
+ autoFocus?: boolean;
31
+ /** Max height of the content area — scrolls when exceeded (e.g. "300px", "50vh") */
32
+ maxHeight?: string;
33
+ /** Min height of the content area (default: "120px") */
34
+ minHeight?: string;
35
+ /** Allow the user to resize the editor vertically */
36
+ resizable?: boolean;
37
+ /** Theme class for the toolbar pressed state (e.g. "theme-class", "theme-brand") */
38
+ toolbarTheme?: string;
39
+ }
40
+ declare const Editor: React.ForwardRefExoticComponent<EditorProps & React.RefAttributes<EditorRef>>;
41
+
42
+ export { Editor, type EditorProps, type EditorRef };
@@ -0,0 +1,9 @@
1
+ export { Editor } from '../chunk-D4UH2HJQ.js';
2
+ import '../chunk-IGMII4BK.js';
3
+ import '../chunk-JPEDYOV7.js';
4
+ import '../chunk-V7M2NHUO.js';
5
+ import '../chunk-CIM6KJH5.js';
6
+ import '../chunk-TYCPXAXF.js';
7
+ import '../chunk-YINJ5YZ5.js';
8
+ //# sourceMappingURL=editor.js.map
9
+ //# sourceMappingURL=editor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"editor.js"}
@@ -5,7 +5,7 @@ import { VariantProps } from 'class-variance-authority';
5
5
  declare function Empty({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
6
6
  declare function EmptyHeader({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
7
7
  declare const emptyMediaVariants: (props?: ({
8
- variant?: "default" | "icon" | null | undefined;
8
+ variant?: "icon" | "default" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  declare function EmptyMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>): react_jsx_runtime.JSX.Element;
11
11
  declare function EmptyTitle({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
package/dist/ui/fab.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const fabVariants: (props?: ({
7
- size?: "sm" | "default" | "lg" | null | undefined;
7
+ size?: "sm" | "lg" | "default" | null | undefined;
8
8
  variant?: "default" | "outline" | "secondary" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  interface FabProps extends React.ComponentProps<"button">, VariantProps<typeof fabVariants> {
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const fileCardVariants: (props?: ({
7
- size?: "sm" | "lg" | "md" | null | undefined;
7
+ size?: "sm" | "md" | "lg" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface FileCardProps extends Omit<React.ComponentProps<"button">, "children" | "size">, VariantProps<typeof fileCardVariants> {
10
10
  /** Nome do arquivo exibido como titulo */
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const likeDislikeVariants: (props?: ({
7
- size?: "sm" | "default" | "lg" | "xs" | null | undefined;
7
+ size?: "xs" | "sm" | "lg" | "default" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  type LikeDislikeValue = "like" | "dislike" | null;
10
10
  interface LikeDislikeProps extends Omit<React.ComponentProps<"div">, "onChange" | "defaultValue">, VariantProps<typeof likeDislikeVariants> {
@@ -4,10 +4,10 @@ import * as React from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const progressDotVariants: (props?: ({
7
- size?: "sm" | "default" | "lg" | "xs" | null | undefined;
7
+ size?: "xs" | "sm" | "lg" | "default" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  declare const dotVariants: (props?: ({
10
- size?: "sm" | "default" | "lg" | "xs" | null | undefined;
10
+ size?: "xs" | "sm" | "lg" | "default" | null | undefined;
11
11
  } & class_variance_authority_types.ClassProp) | undefined) => string;
12
12
  interface ProgressDotProps extends React.ComponentProps<"div">, VariantProps<typeof dotVariants> {
13
13
  /** Numero total de stages (2–10) */
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const progressStagePillVariants: (props?: ({
7
- size?: "sm" | "default" | "lg" | "xs" | null | undefined;
7
+ size?: "xs" | "sm" | "lg" | "default" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  interface ProgressStageProps extends React.ComponentProps<"div">, VariantProps<typeof progressStagePillVariants> {
10
10
  /** Numero total de stages (2–10) */
@@ -5,7 +5,7 @@ import { Progress as Progress$1 } from 'radix-ui';
5
5
  import { VariantProps } from 'class-variance-authority';
6
6
 
7
7
  declare const progressVariants: (props?: ({
8
- size?: "sm" | "default" | "lg" | "xs" | null | undefined;
8
+ size?: "xs" | "sm" | "lg" | "default" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  declare const indicatorVariants: (props?: ({
11
11
  variant?: "default" | "destructive" | "secondary" | "muted" | null | undefined;
@@ -5,7 +5,7 @@ import { RadioGroup as RadioGroup$1 } from 'radix-ui';
5
5
  import { VariantProps } from 'class-variance-authority';
6
6
 
7
7
  declare const radioVariants: (props?: ({
8
- size?: "sm" | "default" | "lg" | null | undefined;
8
+ size?: "sm" | "lg" | "default" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  interface RadioGroupProps extends React.ComponentProps<typeof RadioGroup$1.Root> {
11
11
  }
@@ -5,7 +5,7 @@ import { Slider as Slider$1 } from 'radix-ui';
5
5
  import { VariantProps } from 'class-variance-authority';
6
6
 
7
7
  declare const sliderVariants: (props?: ({
8
- size?: "sm" | "default" | "lg" | null | undefined;
8
+ size?: "sm" | "lg" | "default" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  interface SliderProps extends React.ComponentProps<typeof Slider$1.Root>, VariantProps<typeof sliderVariants> {
11
11
  /** Classe de tema aplicada (ex: "theme-brand") */
@@ -5,7 +5,7 @@ import { Switch as Switch$1 } from 'radix-ui';
5
5
  import { VariantProps } from 'class-variance-authority';
6
6
 
7
7
  declare const switchVariants: (props?: ({
8
- size?: "sm" | "default" | "lg" | null | undefined;
8
+ size?: "sm" | "lg" | "default" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  interface SwitchProps extends React.ComponentProps<typeof Switch$1.Root>, VariantProps<typeof switchVariants> {
11
11
  /** Classe de tema aplicada no estado checked (ex: "theme-brand") */
package/dist/ui/tabs.d.ts CHANGED
@@ -6,7 +6,7 @@ import { Tabs as Tabs$1 } from 'radix-ui';
6
6
 
7
7
  declare function Tabs({ className, orientation, ...props }: React.ComponentProps<typeof Tabs$1.Root>): react_jsx_runtime.JSX.Element;
8
8
  declare const tabsListVariants: (props?: ({
9
- variant?: "line" | "default" | null | undefined;
9
+ variant?: "default" | "line" | null | undefined;
10
10
  } & class_variance_authority_types.ClassProp) | undefined) => string;
11
11
  declare function TabsList({ className, variant, ...props }: React.ComponentProps<typeof Tabs$1.List> & VariantProps<typeof tabsListVariants>): react_jsx_runtime.JSX.Element;
12
12
  declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof Tabs$1.Trigger>): react_jsx_runtime.JSX.Element;
@@ -6,7 +6,7 @@ import { Toggle as Toggle$1 } from 'radix-ui';
6
6
 
7
7
  declare const toggleVariants: (props?: ({
8
8
  variant?: "default" | "outline" | null | undefined;
9
- size?: "sm" | "default" | "lg" | "xs" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
9
+ size?: "xs" | "sm" | "lg" | "icon" | "default" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
10
10
  } & class_variance_authority_types.ClassProp) | undefined) => string;
11
11
  interface ToggleProps extends React.ComponentProps<typeof Toggle$1.Root>, VariantProps<typeof toggleVariants> {
12
12
  /** Preenche icones SVG quando o toggle esta ativo (on). Ideal para icones como Heart, Star, Bookmark. */
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@fluencypassdevs/cycle",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Cycle Design System — UI component library by Fluencypass",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "https://github.com/Fluencypass/Cycle.git"
8
+ "url": "git+https://github.com/Fluencypass/Cycle.git"
9
9
  },
10
10
  "type": "module",
11
11
  "sideEffects": [
@@ -51,7 +51,7 @@
51
51
  "./tailwind-theme.css": "./dist/styles/tokens.css"
52
52
  },
53
53
  "bin": {
54
- "cycle": "./bin/cli.mjs"
54
+ "cycle": "bin/cli.mjs"
55
55
  },
56
56
  "files": [
57
57
  "dist",
@@ -80,6 +80,10 @@
80
80
  }
81
81
  },
82
82
  "dependencies": {
83
+ "@tiptap/extension-placeholder": "^3.22.3",
84
+ "@tiptap/extension-underline": "^3.22.3",
85
+ "@tiptap/react": "^3.22.3",
86
+ "@tiptap/starter-kit": "^3.22.3",
83
87
  "class-variance-authority": "^0.7.1",
84
88
  "clsx": "^2.1.1",
85
89
  "lucide-react": "^0.577.0",