@fluencypassdevs/pulse 0.5.0 → 0.6.1
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 +18 -3
- package/dist/buttons/link-brand.d.ts +1 -1
- package/dist/index.d.ts +64 -8
- package/dist/index.js +270 -2
- package/dist/index.js.map +1 -1
- package/dist/styles/foundation.css +26 -9
- package/dist/styles/styles.css +361 -65
- package/package.json +1 -1
package/bin/mcp.mjs
CHANGED
|
@@ -375,7 +375,11 @@ const TOKENS = {
|
|
|
375
375
|
brand: ["bg-brand", "text-brand", "text-on-brand", "bg-brand-soft"],
|
|
376
376
|
product: ["bg-product", "text-on-product", "bg-product-soft (dentro de .theme-*)"],
|
|
377
377
|
highlight: ["bg-highlight-positive", "bg-highlight-warning", "bg-highlight-critical", "bg-highlight-info"],
|
|
378
|
-
expressive: [
|
|
378
|
+
expressive: [
|
|
379
|
+
"--gradient-brand-primary", "--gradient-brand-angled", "--glow-brand-circle", ".light-surface",
|
|
380
|
+
"Degrades do tema ativo (use com um .theme-* no elemento ou ancestral): .gradient-linear-{b,t,r,l,br,tr,bl,tl}, .gradient-glow-{tr,br,tl,bl,c}, .gradient-spotlight, .gradient-mesh, .gradient-band",
|
|
381
|
+
"Pontes de familia: .gradient-practice (Group Talk → Private Talk), .gradient-learning (Impulse → Class)",
|
|
382
|
+
],
|
|
379
383
|
},
|
|
380
384
|
radius: ["rounded-sm", "rounded-md", "rounded-lg", "rounded-xl"],
|
|
381
385
|
typography: {
|
|
@@ -383,7 +387,17 @@ const TOKENS = {
|
|
|
383
387
|
heading: ["heading-lg (20px)", "heading-2xl (32px)", "heading-4xl (48px)"],
|
|
384
388
|
display: ["display-md (64px/700)", "display-lg (72px/700)", "display-lg-light (72px/300)"],
|
|
385
389
|
},
|
|
386
|
-
themes: [
|
|
390
|
+
themes: [
|
|
391
|
+
".theme-brand — coral da marca Fluencypass",
|
|
392
|
+
".theme-class — azul (Class / aulas)",
|
|
393
|
+
".theme-group — AMARELO Sol do PRODUTO Group Talk (texto escuro no preenchimento)",
|
|
394
|
+
".theme-private — AMARELO Limao do PRODUTO Private Talk (texto escuro no preenchimento)",
|
|
395
|
+
".theme-impulse — roxo (Impulse)",
|
|
396
|
+
".theme-progress — verde de avanco/acerto (antes era o theme-group)",
|
|
397
|
+
".theme-streak — laranja da sequencia/streak (antes era o theme-private)",
|
|
398
|
+
".theme-positive / .theme-warning / .theme-critical — status",
|
|
399
|
+
".dark — modo escuro",
|
|
400
|
+
],
|
|
387
401
|
}
|
|
388
402
|
|
|
389
403
|
// ─── Tool Definitions ──────────────────────────────────────────────────────────
|
|
@@ -514,7 +528,7 @@ Escolha por pagina/secao via prop \`tone\` do Section (light e dark de 1a classe
|
|
|
514
528
|
case "pulse_get_tokens": {
|
|
515
529
|
const cat = args.category || "all"
|
|
516
530
|
if (cat === "all") {
|
|
517
|
-
return `# Tokens do Pulse (vocabulario de marketing)\n\n## Cores base\n${TOKENS.colors.base.join(", ")}\n\n## Marca\n${TOKENS.colors.brand.join(", ")}\n\n## Produto (no tema ativo)\n${TOKENS.colors.product.join(", ")}\n\n## Destaques\n${TOKENS.colors.highlight.join(", ")}\n\n## Expressivos\n${TOKENS.colors.expressive.join(", ")}\n\n## Tipografia\nBody: ${TOKENS.typography.body.join(", ")}\nHeading: ${TOKENS.typography.heading.join(", ")}\nDisplay: ${TOKENS.typography.display.join(", ")}\n\n## Radius\n${TOKENS.radius.join(", ")}\n\n## Temas\n${TOKENS.themes.join("
|
|
531
|
+
return `# Tokens do Pulse (vocabulario de marketing)\n\n## Cores base\n${TOKENS.colors.base.join(", ")}\n\n## Marca\n${TOKENS.colors.brand.join(", ")}\n\n## Produto (no tema ativo)\n${TOKENS.colors.product.join(", ")}\n\n## Destaques\n${TOKENS.colors.highlight.join(", ")}\n\n## Expressivos\n${TOKENS.colors.expressive.join(", ")}\n\n## Tipografia\nBody: ${TOKENS.typography.body.join(", ")}\nHeading: ${TOKENS.typography.heading.join(", ")}\nDisplay: ${TOKENS.typography.display.join(", ")}\n\n## Radius\n${TOKENS.radius.join(", ")}\n\n## Temas\n- ${TOKENS.themes.join("\n- ")}\n\n**NUNCA cor hardcoded nem primitivo (ex.: color-brand-400, #hex). Sempre o token semantico.** Degrades: so os presets .gradient-* (nunca linear-gradient com cores proprias), exceto os expressivos de marca acima.`
|
|
518
532
|
}
|
|
519
533
|
const data = TOKENS[cat]
|
|
520
534
|
if (!data) return `Unknown category "${cat}". Available: colors, typography, radius, themes, all.`
|
|
@@ -556,6 +570,7 @@ Uma superficie usa UM DS: marketing=Pulse, produto=Cycle. Nunca misture no mesmo
|
|
|
556
570
|
## Estilo & tema
|
|
557
571
|
4. Só token semantico do Pulse (bg-page, text-body, bg-brand, bg-product, bg-highlight-*) — nunca hex/primitivo.
|
|
558
572
|
5. Tema por pagina/secao (prop tone do Section); light e dark de 1a classe.
|
|
573
|
+
5b. Tema de cor pelo SENTIDO, nao pela cor: produto Group Talk → \`theme-group\` (amarelo), Private Talk → \`theme-private\` (amarelo); verde de progresso → \`theme-progress\`; laranja de sequencia → \`theme-streak\`. Nunca \`theme-group\`/\`theme-private\` para querer verde/laranja.
|
|
559
574
|
6. Tipografia via classes do sistema (heading-*, display-*) — sem valores arbitrarios.
|
|
560
575
|
|
|
561
576
|
## Performance & a11y & SEO
|
|
@@ -34,6 +34,6 @@ type LinkBrandProps = LinkBrandAnchorProps | LinkBrandButtonProps;
|
|
|
34
34
|
* Abrir filtros
|
|
35
35
|
* </LinkBrand>
|
|
36
36
|
*/
|
|
37
|
-
declare const LinkBrand: React.ForwardRefExoticComponent<LinkBrandProps & React.RefAttributes<
|
|
37
|
+
declare const LinkBrand: React.ForwardRefExoticComponent<LinkBrandProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
38
38
|
|
|
39
39
|
export { LinkBrand, type LinkBrandProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import * as React$1 from 'react';
|
|
|
6
6
|
import { Accordion as Accordion$1, Avatar as Avatar$1, Checkbox as Checkbox$1, Collapsible as Collapsible$1, Label as Label$1, RadioGroup as RadioGroup$1, ScrollArea as ScrollArea$1, Select as Select$1, Separator as Separator$1, Dialog, Switch as Switch$1, Tabs as Tabs$1, Tooltip as Tooltip$1 } from 'radix-ui';
|
|
7
7
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
8
8
|
import { VariantProps } from 'class-variance-authority';
|
|
9
|
+
import { LucideIcon } from 'lucide-react';
|
|
9
10
|
export { RevealOnScroll, RevealOnScrollProps } from './motion/reveal-on-scroll.js';
|
|
10
11
|
export { StaggerReveal, StaggerRevealProps } from './motion/stagger-reveal.js';
|
|
11
12
|
export { AnimatedNumber, AnimatedNumberProps } from './motion/animated-number.js';
|
|
@@ -29,7 +30,6 @@ export { LogoCloud, LogoCloudProps } from './sections/logo-cloud.js';
|
|
|
29
30
|
export { FaqItem, FaqSection, FaqSectionProps } from './sections/faq-section.js';
|
|
30
31
|
export { useReducedMotion } from './hooks/use-reduced-motion.js';
|
|
31
32
|
export { UseIntersectionOptions, useIntersection } from './hooks/use-intersection.js';
|
|
32
|
-
import 'lucide-react';
|
|
33
33
|
|
|
34
34
|
declare function cn(...inputs: ClassValue[]): string;
|
|
35
35
|
|
|
@@ -116,7 +116,7 @@ declare function AvatarGroupCount({ className, ...props }: React$1.ComponentProp
|
|
|
116
116
|
|
|
117
117
|
declare const badgeVariants: (props?: ({
|
|
118
118
|
variant?: "link" | "progress" | "default" | "secondary" | "destructive" | "outline" | "ghost" | "muted" | "success" | "progress-completed" | null | undefined;
|
|
119
|
-
size?: "
|
|
119
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
120
120
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
121
121
|
interface BadgeProps extends React$1.ComponentProps<"span">, VariantProps<typeof badgeVariants> {
|
|
122
122
|
asChild?: boolean;
|
|
@@ -125,7 +125,7 @@ declare function Badge({ className, variant, size, asChild, ...props }: BadgePro
|
|
|
125
125
|
|
|
126
126
|
declare const buttonVariants: (props?: ({
|
|
127
127
|
variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
|
|
128
|
-
size?: "
|
|
128
|
+
size?: "default" | "icon" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
129
129
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
130
130
|
interface ButtonProps extends React$1.ComponentProps<"button">, VariantProps<typeof buttonVariants> {
|
|
131
131
|
asChild?: boolean;
|
|
@@ -141,7 +141,7 @@ declare function CardContent({ className, ...props }: React$1.ComponentProps<"di
|
|
|
141
141
|
declare function CardFooter({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
142
142
|
|
|
143
143
|
declare const checkboxVariants: (props?: ({
|
|
144
|
-
size?: "
|
|
144
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
145
145
|
variant?: "default" | "circular" | null | undefined;
|
|
146
146
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
147
147
|
interface CheckboxProps extends React$1.ComponentProps<typeof Checkbox$1.Root>, VariantProps<typeof checkboxVariants> {
|
|
@@ -157,13 +157,69 @@ declare function CollapsibleContent({ ...props }: React$1.ComponentProps<typeof
|
|
|
157
157
|
declare function Empty({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
158
158
|
declare function EmptyHeader({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
159
159
|
declare const emptyMediaVariants: (props?: ({
|
|
160
|
-
variant?: "
|
|
160
|
+
variant?: "default" | "icon" | null | undefined;
|
|
161
161
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
162
162
|
declare function EmptyMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>): react_jsx_runtime.JSX.Element;
|
|
163
163
|
declare function EmptyTitle({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
164
164
|
declare function EmptyDescription({ className, ...props }: React.ComponentProps<"p">): react_jsx_runtime.JSX.Element;
|
|
165
165
|
declare function EmptyContent({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
166
166
|
|
|
167
|
+
type ErrorStateKind = "not-found" | "forbidden" | "unauthorized" | "server" | "offline" | "unsupported" | "generic";
|
|
168
|
+
type ErrorStateSize = "page" | "section";
|
|
169
|
+
type ErrorStateSeverity = "neutral" | "warning" | "critical";
|
|
170
|
+
interface ErrorStatePreset {
|
|
171
|
+
icon: LucideIcon;
|
|
172
|
+
severity: ErrorStateSeverity;
|
|
173
|
+
title: string;
|
|
174
|
+
description: string;
|
|
175
|
+
/** Título alternativo quando size="page" (só o generic usa). */
|
|
176
|
+
pageTitle?: string;
|
|
177
|
+
/** Descrição alternativa quando size="page" (só o generic usa). */
|
|
178
|
+
pageDescription?: string;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Presets por cenário. Copy em português correto — texto que o aluno lê.
|
|
182
|
+
* Regra: o default só afirma o que o componente garante sozinho. Reportar, reconectar,
|
|
183
|
+
* salvar dados são do app — quem faz isso sobrescreve title/description.
|
|
184
|
+
* Severidade: vermelho só em falha real do sistema.
|
|
185
|
+
*/
|
|
186
|
+
declare const ERROR_STATE_PRESETS: Record<ErrorStateKind, ErrorStatePreset>;
|
|
187
|
+
declare function ErrorStateMedia({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
188
|
+
interface ErrorStateTitleProps extends React$1.ComponentProps<"h2"> {
|
|
189
|
+
/** Nível do heading. Default: 1 em page, 2 em section. */
|
|
190
|
+
level?: 1 | 2 | 3 | 4;
|
|
191
|
+
}
|
|
192
|
+
declare const ErrorStateTitle: React$1.ForwardRefExoticComponent<Omit<ErrorStateTitleProps, "ref"> & React$1.RefAttributes<HTMLHeadingElement>>;
|
|
193
|
+
declare function ErrorStateDescription({ className, ...props }: React$1.ComponentProps<"p">): react_jsx_runtime.JSX.Element;
|
|
194
|
+
declare function ErrorStateActions({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
195
|
+
declare function ErrorStateMeta({ className, ...props }: React$1.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
196
|
+
interface ErrorStateProps extends Omit<React$1.ComponentProps<"div">, "title" | "role" | "aria-live"> {
|
|
197
|
+
kind?: ErrorStateKind;
|
|
198
|
+
size?: ErrorStateSize;
|
|
199
|
+
severity?: ErrorStateSeverity;
|
|
200
|
+
title?: React$1.ReactNode;
|
|
201
|
+
description?: React$1.ReactNode;
|
|
202
|
+
/** Substitui o ícone default (ex.: ilustração). */
|
|
203
|
+
media?: React$1.ReactNode;
|
|
204
|
+
/** Badge mono opcional ("404", "500"). */
|
|
205
|
+
code?: string | number;
|
|
206
|
+
/** "Referência xxxx" com botão copiar, opcional. */
|
|
207
|
+
referenceId?: string;
|
|
208
|
+
onRetry?: () => void;
|
|
209
|
+
retryLabel?: string;
|
|
210
|
+
onReport?: () => void;
|
|
211
|
+
reportLabel?: string;
|
|
212
|
+
/** Botões do consumidor. Renderizados antes do retry. */
|
|
213
|
+
actions?: React$1.ReactNode;
|
|
214
|
+
/** section: borda tracejada como o Empty. */
|
|
215
|
+
bordered?: boolean;
|
|
216
|
+
/** page: foca o título ao montar. Default true. */
|
|
217
|
+
autoFocus?: boolean;
|
|
218
|
+
/** Tag do título. Default 1 em page, 2 em section. */
|
|
219
|
+
headingLevel?: 1 | 2 | 3 | 4;
|
|
220
|
+
}
|
|
221
|
+
declare function ErrorState({ kind, size, severity: severityProp, title, description, media, code, referenceId, onRetry, retryLabel, onReport, reportLabel, actions, bordered, autoFocus, headingLevel, className, ...props }: ErrorStateProps): react_jsx_runtime.JSX.Element;
|
|
222
|
+
|
|
167
223
|
interface InputProps extends React$1.ComponentProps<"input"> {
|
|
168
224
|
inputSize?: "sm" | "default" | "lg";
|
|
169
225
|
/** Variante visual: outline (borda) ou filled (fundo preenchido) */
|
|
@@ -176,7 +232,7 @@ interface LabelProps extends React$1.ComponentProps<typeof Label$1.Root> {
|
|
|
176
232
|
declare function Label({ className, ...props }: LabelProps): react_jsx_runtime.JSX.Element;
|
|
177
233
|
|
|
178
234
|
declare const radioVariants: (props?: ({
|
|
179
|
-
size?: "
|
|
235
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
180
236
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
181
237
|
interface RadioGroupProps extends React$1.ComponentProps<typeof RadioGroup$1.Root> {
|
|
182
238
|
}
|
|
@@ -242,7 +298,7 @@ interface SpinnerProps extends React$1.ComponentProps<"span"> {
|
|
|
242
298
|
declare function Spinner({ size, label, className, ...props }: SpinnerProps): react_jsx_runtime.JSX.Element;
|
|
243
299
|
|
|
244
300
|
declare const switchVariants: (props?: ({
|
|
245
|
-
size?: "
|
|
301
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
246
302
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
247
303
|
interface SwitchProps extends React$1.ComponentProps<typeof Switch$1.Root>, VariantProps<typeof switchVariants> {
|
|
248
304
|
/** Classe de tema aplicada no estado checked (ex: "theme-brand") */
|
|
@@ -281,4 +337,4 @@ interface PulseLogoProps {
|
|
|
281
337
|
*/
|
|
282
338
|
declare function PulseLogo({ className }: PulseLogoProps): react_jsx_runtime.JSX.Element;
|
|
283
339
|
|
|
284
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, type BadgeProps, Button, type ButtonProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, type CheckboxProps, ClassLogo, Collapsible, CollapsibleContent, CollapsibleTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, FluencypassIcon, FluencypassLogo, type FluencypassLogoProps, GroupTalkLogo, IconSize, Input, type InputProps, Label, type LabelProps, PrivateTalkLogo, ProductLogo, PulseLogo, RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Skeleton, Spinner, type SpinnerProps, Switch, type SwitchProps, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, checkboxVariants, cn, radioVariants, switchVariants, tabsListVariants };
|
|
340
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, type BadgeProps, Button, type ButtonProps, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, type CheckboxProps, ClassLogo, Collapsible, CollapsibleContent, CollapsibleTrigger, ERROR_STATE_PRESETS, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, ErrorState, ErrorStateActions, ErrorStateDescription, type ErrorStateKind, ErrorStateMedia, ErrorStateMeta, type ErrorStatePreset, type ErrorStateProps, type ErrorStateSeverity, type ErrorStateSize, ErrorStateTitle, FluencypassIcon, FluencypassLogo, type FluencypassLogoProps, GroupTalkLogo, IconSize, Input, type InputProps, Label, type LabelProps, PrivateTalkLogo, ProductLogo, PulseLogo, RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Skeleton, Spinner, type SpinnerProps, Switch, type SwitchProps, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, type TextareaProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, checkboxVariants, cn, radioVariants, switchVariants, tabsListVariants };
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ import { __objRest, __spreadValues, __spreadProps } from './chunk-RMVMLLA7.js';
|
|
|
36
36
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
37
37
|
import { Avatar as Avatar$1, Slot, Checkbox as Checkbox$1, Collapsible as Collapsible$1, Label as Label$1, RadioGroup as RadioGroup$1, ScrollArea as ScrollArea$1, Select as Select$1, Separator as Separator$1, Dialog, Switch as Switch$1, Tabs as Tabs$1, Tooltip as Tooltip$1 } from 'radix-ui';
|
|
38
38
|
import { cva } from 'class-variance-authority';
|
|
39
|
-
import { CheckIcon, CircleIcon, ChevronDownIcon, ChevronUpIcon, XIcon, Loader2 } from 'lucide-react';
|
|
39
|
+
import { TriangleAlert, FileQuestion, WifiOff, ServerCrash, LogIn, Lock, SearchX, CheckIcon, RefreshCw, CircleIcon, ChevronDownIcon, ChevronUpIcon, XIcon, Loader2, Check, Copy } from 'lucide-react';
|
|
40
40
|
import * as React from 'react';
|
|
41
41
|
|
|
42
42
|
var sizeMap = {
|
|
@@ -543,6 +543,274 @@ function EmptyContent(_a) {
|
|
|
543
543
|
}, props)
|
|
544
544
|
);
|
|
545
545
|
}
|
|
546
|
+
var ERROR_STATE_PRESETS = {
|
|
547
|
+
"not-found": {
|
|
548
|
+
icon: SearchX,
|
|
549
|
+
severity: "neutral",
|
|
550
|
+
title: "P\xE1gina n\xE3o encontrada",
|
|
551
|
+
description: "O link pode estar quebrado ou a p\xE1gina pode ter sido movida. Confira o endere\xE7o ou v\xE1 para o in\xEDcio."
|
|
552
|
+
},
|
|
553
|
+
forbidden: {
|
|
554
|
+
icon: Lock,
|
|
555
|
+
severity: "neutral",
|
|
556
|
+
title: "Voc\xEA n\xE3o tem acesso a esta p\xE1gina",
|
|
557
|
+
description: "Esta \xE1rea \xE9 restrita. Se voc\xEA precisa dela, pe\xE7a acesso a quem administra sua conta."
|
|
558
|
+
},
|
|
559
|
+
unauthorized: {
|
|
560
|
+
icon: LogIn,
|
|
561
|
+
severity: "neutral",
|
|
562
|
+
title: "Sua sess\xE3o expirou",
|
|
563
|
+
description: "Entre novamente para continuar de onde parou."
|
|
564
|
+
},
|
|
565
|
+
server: {
|
|
566
|
+
icon: ServerCrash,
|
|
567
|
+
severity: "critical",
|
|
568
|
+
title: "Algo deu errado do nosso lado",
|
|
569
|
+
description: "Tente novamente em alguns instantes. Se continuar, fale com o suporte."
|
|
570
|
+
},
|
|
571
|
+
offline: {
|
|
572
|
+
icon: WifiOff,
|
|
573
|
+
severity: "warning",
|
|
574
|
+
title: "Voc\xEA est\xE1 sem conex\xE3o",
|
|
575
|
+
description: "Confira o Wi-Fi ou os dados m\xF3veis e tente novamente quando a conex\xE3o voltar."
|
|
576
|
+
},
|
|
577
|
+
// Conteúdo íntegro que esta versão do app ainda não sabe abrir (ex.: tipo de atividade
|
|
578
|
+
// publicado antes do deploy do cliente). Nada falhou — por isso neutro, nunca alerta.
|
|
579
|
+
unsupported: {
|
|
580
|
+
icon: FileQuestion,
|
|
581
|
+
severity: "neutral",
|
|
582
|
+
title: "Este conte\xFAdo ainda n\xE3o abre nesta vers\xE3o",
|
|
583
|
+
description: "Ele precisa de uma vers\xE3o mais nova do app. Atualize quando ela estiver dispon\xEDvel ou tente mais tarde."
|
|
584
|
+
},
|
|
585
|
+
generic: {
|
|
586
|
+
icon: TriangleAlert,
|
|
587
|
+
severity: "critical",
|
|
588
|
+
title: "Este conte\xFAdo n\xE3o carregou",
|
|
589
|
+
description: "Tente novamente em alguns instantes.",
|
|
590
|
+
pageTitle: "Esta p\xE1gina n\xE3o carregou"
|
|
591
|
+
}
|
|
592
|
+
};
|
|
593
|
+
var ErrorStateContext = React.createContext({
|
|
594
|
+
size: "section",
|
|
595
|
+
severity: "neutral"
|
|
596
|
+
});
|
|
597
|
+
function useErrorStateContext() {
|
|
598
|
+
return React.useContext(ErrorStateContext);
|
|
599
|
+
}
|
|
600
|
+
var MEDIA_SEVERITY = {
|
|
601
|
+
neutral: "bg-muted text-foreground border border-border",
|
|
602
|
+
warning: "theme-warning bg-background text-foreground",
|
|
603
|
+
critical: "theme-critical bg-background text-foreground"
|
|
604
|
+
};
|
|
605
|
+
var MEDIA_SIZE = {
|
|
606
|
+
page: "size-14 rounded-xl",
|
|
607
|
+
section: "size-8 rounded-lg"
|
|
608
|
+
};
|
|
609
|
+
function ErrorStateMedia(_a) {
|
|
610
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
611
|
+
const { size, severity } = useErrorStateContext();
|
|
612
|
+
return /* @__PURE__ */ jsx(
|
|
613
|
+
"div",
|
|
614
|
+
__spreadValues({
|
|
615
|
+
"data-slot": "error-state-media",
|
|
616
|
+
className: cn(
|
|
617
|
+
"mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
618
|
+
MEDIA_SIZE[size],
|
|
619
|
+
MEDIA_SEVERITY[severity],
|
|
620
|
+
className
|
|
621
|
+
)
|
|
622
|
+
}, props)
|
|
623
|
+
);
|
|
624
|
+
}
|
|
625
|
+
var ErrorStateTitle = React.forwardRef(
|
|
626
|
+
function ErrorStateTitle2(_a, ref) {
|
|
627
|
+
var _b = _a, { className, level } = _b, props = __objRest(_b, ["className", "level"]);
|
|
628
|
+
const { size } = useErrorStateContext();
|
|
629
|
+
const Tag = `h${level != null ? level : size === "page" ? 1 : 2}`;
|
|
630
|
+
return /* @__PURE__ */ jsx(
|
|
631
|
+
Tag,
|
|
632
|
+
__spreadValues({
|
|
633
|
+
ref,
|
|
634
|
+
"data-slot": "error-state-title",
|
|
635
|
+
className: cn(
|
|
636
|
+
"text-balance outline-none",
|
|
637
|
+
size === "page" ? "text-2xl font-semibold tracking-tight" : "text-sm font-semibold tracking-tight",
|
|
638
|
+
className
|
|
639
|
+
)
|
|
640
|
+
}, props)
|
|
641
|
+
);
|
|
642
|
+
}
|
|
643
|
+
);
|
|
644
|
+
function ErrorStateDescription(_a) {
|
|
645
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
646
|
+
const { size } = useErrorStateContext();
|
|
647
|
+
return /* @__PURE__ */ jsx(
|
|
648
|
+
"p",
|
|
649
|
+
__spreadValues({
|
|
650
|
+
"data-slot": "error-state-description",
|
|
651
|
+
className: cn(
|
|
652
|
+
"text-balance text-muted-foreground",
|
|
653
|
+
size === "page" ? "text-sm max-w-md" : "text-xs/relaxed max-w-sm",
|
|
654
|
+
className
|
|
655
|
+
)
|
|
656
|
+
}, props)
|
|
657
|
+
);
|
|
658
|
+
}
|
|
659
|
+
function ErrorStateActions(_a) {
|
|
660
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
661
|
+
return /* @__PURE__ */ jsx(
|
|
662
|
+
"div",
|
|
663
|
+
__spreadValues({
|
|
664
|
+
"data-slot": "error-state-actions",
|
|
665
|
+
className: cn("mt-3 flex flex-wrap items-center justify-center gap-2", className)
|
|
666
|
+
}, props)
|
|
667
|
+
);
|
|
668
|
+
}
|
|
669
|
+
function ErrorStateMeta(_a) {
|
|
670
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
671
|
+
const { size } = useErrorStateContext();
|
|
672
|
+
return /* @__PURE__ */ jsx(
|
|
673
|
+
"div",
|
|
674
|
+
__spreadValues({
|
|
675
|
+
"data-slot": "error-state-meta",
|
|
676
|
+
className: cn(
|
|
677
|
+
"flex flex-wrap items-center justify-center gap-2 font-mono text-xs/relaxed text-muted-foreground",
|
|
678
|
+
size === "page" ? "mt-3" : "mt-2",
|
|
679
|
+
className
|
|
680
|
+
)
|
|
681
|
+
}, props)
|
|
682
|
+
);
|
|
683
|
+
}
|
|
684
|
+
function CopyReference({ value }) {
|
|
685
|
+
const [copied, setCopied] = React.useState(false);
|
|
686
|
+
React.useEffect(() => {
|
|
687
|
+
if (!copied) return;
|
|
688
|
+
const id = setTimeout(() => setCopied(false), 2e3);
|
|
689
|
+
return () => clearTimeout(id);
|
|
690
|
+
}, [copied]);
|
|
691
|
+
const handleCopy = async () => {
|
|
692
|
+
try {
|
|
693
|
+
await navigator.clipboard.writeText(value);
|
|
694
|
+
setCopied(true);
|
|
695
|
+
} catch (e) {
|
|
696
|
+
}
|
|
697
|
+
};
|
|
698
|
+
return /* @__PURE__ */ jsxs(
|
|
699
|
+
Button,
|
|
700
|
+
{
|
|
701
|
+
type: "button",
|
|
702
|
+
variant: "link",
|
|
703
|
+
size: "xs",
|
|
704
|
+
onClick: handleCopy,
|
|
705
|
+
"aria-label": copied ? "Copiado" : "Copiar refer\xEAncia",
|
|
706
|
+
className: "font-sans",
|
|
707
|
+
children: [
|
|
708
|
+
/* @__PURE__ */ jsx(CycleIcon, { icon: copied ? Check : Copy, size: "2xs", decorative: true }),
|
|
709
|
+
/* @__PURE__ */ jsx("span", { "aria-live": "polite", children: copied ? "Copiado" : "Copiar" })
|
|
710
|
+
]
|
|
711
|
+
}
|
|
712
|
+
);
|
|
713
|
+
}
|
|
714
|
+
function ErrorState(_a) {
|
|
715
|
+
var _b = _a, {
|
|
716
|
+
kind = "generic",
|
|
717
|
+
size = "section",
|
|
718
|
+
severity: severityProp,
|
|
719
|
+
title,
|
|
720
|
+
description,
|
|
721
|
+
media,
|
|
722
|
+
code,
|
|
723
|
+
referenceId,
|
|
724
|
+
onRetry,
|
|
725
|
+
retryLabel = "Tentar novamente",
|
|
726
|
+
onReport,
|
|
727
|
+
reportLabel = "Relatar problema",
|
|
728
|
+
actions,
|
|
729
|
+
bordered = false,
|
|
730
|
+
autoFocus = true,
|
|
731
|
+
headingLevel,
|
|
732
|
+
className
|
|
733
|
+
} = _b, props = __objRest(_b, [
|
|
734
|
+
"kind",
|
|
735
|
+
"size",
|
|
736
|
+
"severity",
|
|
737
|
+
"title",
|
|
738
|
+
"description",
|
|
739
|
+
"media",
|
|
740
|
+
"code",
|
|
741
|
+
"referenceId",
|
|
742
|
+
"onRetry",
|
|
743
|
+
"retryLabel",
|
|
744
|
+
"onReport",
|
|
745
|
+
"reportLabel",
|
|
746
|
+
"actions",
|
|
747
|
+
"bordered",
|
|
748
|
+
"autoFocus",
|
|
749
|
+
"headingLevel",
|
|
750
|
+
"className"
|
|
751
|
+
]);
|
|
752
|
+
var _a2, _b2;
|
|
753
|
+
const preset = ERROR_STATE_PRESETS[kind];
|
|
754
|
+
const severity = severityProp != null ? severityProp : preset.severity;
|
|
755
|
+
const titleRef = React.useRef(null);
|
|
756
|
+
React.useEffect(() => {
|
|
757
|
+
var _a3;
|
|
758
|
+
if (size === "page" && autoFocus) {
|
|
759
|
+
(_a3 = titleRef.current) == null ? void 0 : _a3.focus({ preventScroll: true });
|
|
760
|
+
}
|
|
761
|
+
}, [size, autoFocus]);
|
|
762
|
+
const resolvedTitle = title != null ? title : size === "page" ? (_a2 = preset.pageTitle) != null ? _a2 : preset.title : preset.title;
|
|
763
|
+
const resolvedDescription = description != null ? description : size === "page" ? (_b2 = preset.pageDescription) != null ? _b2 : preset.description : preset.description;
|
|
764
|
+
const liveProps = size === "section" ? severity === "critical" ? { role: "alert" } : { role: "status", "aria-live": "polite" } : {};
|
|
765
|
+
return /* @__PURE__ */ jsx(ErrorStateContext.Provider, { value: { size, severity }, children: /* @__PURE__ */ jsxs(
|
|
766
|
+
"div",
|
|
767
|
+
__spreadProps(__spreadValues(__spreadValues({
|
|
768
|
+
"data-slot": "error-state",
|
|
769
|
+
"data-kind": kind,
|
|
770
|
+
"data-size": size,
|
|
771
|
+
"data-severity": severity,
|
|
772
|
+
className: cn(
|
|
773
|
+
"flex flex-col items-center text-center gap-2",
|
|
774
|
+
size === "page" ? "flex-1 justify-center px-6 py-16" : "p-6",
|
|
775
|
+
size === "section" && bordered && "rounded-lg border border-dashed border-border",
|
|
776
|
+
className
|
|
777
|
+
)
|
|
778
|
+
}, props), liveProps), {
|
|
779
|
+
children: [
|
|
780
|
+
media != null ? media : /* @__PURE__ */ jsx(ErrorStateMedia, { children: /* @__PURE__ */ jsx(CycleIcon, { icon: preset.icon, size: size === "page" ? "md" : "xs", decorative: true }) }),
|
|
781
|
+
/* @__PURE__ */ jsx(ErrorStateTitle, { ref: titleRef, level: headingLevel, tabIndex: size === "page" ? -1 : void 0, children: resolvedTitle }),
|
|
782
|
+
resolvedDescription && /* @__PURE__ */ jsx(ErrorStateDescription, { children: resolvedDescription }),
|
|
783
|
+
(actions || onRetry) && /* @__PURE__ */ jsxs(ErrorStateActions, { children: [
|
|
784
|
+
actions,
|
|
785
|
+
onRetry && /* @__PURE__ */ jsxs(Button, { type: "button", size: size === "page" ? "default" : "sm", onClick: onRetry, children: [
|
|
786
|
+
/* @__PURE__ */ jsx(CycleIcon, { icon: RefreshCw, size: "xs", decorative: true }),
|
|
787
|
+
retryLabel
|
|
788
|
+
] })
|
|
789
|
+
] }),
|
|
790
|
+
(code != null || referenceId) && /* @__PURE__ */ jsxs(ErrorStateMeta, { children: [
|
|
791
|
+
code != null && /* @__PURE__ */ jsx(
|
|
792
|
+
Badge2,
|
|
793
|
+
{
|
|
794
|
+
variant: "outline",
|
|
795
|
+
size: "sm",
|
|
796
|
+
className: cn(
|
|
797
|
+
"font-mono",
|
|
798
|
+
severity === "critical" && "theme-critical bg-background text-foreground border-border"
|
|
799
|
+
),
|
|
800
|
+
children: code
|
|
801
|
+
}
|
|
802
|
+
),
|
|
803
|
+
referenceId && /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
804
|
+
/* @__PURE__ */ jsx("span", { children: "Refer\xEAncia" }),
|
|
805
|
+
/* @__PURE__ */ jsx("code", { className: "rounded-sm bg-accent px-1.5 py-0.5 text-foreground", children: referenceId }),
|
|
806
|
+
/* @__PURE__ */ jsx(CopyReference, { value: referenceId })
|
|
807
|
+
] })
|
|
808
|
+
] }),
|
|
809
|
+
onReport && /* @__PURE__ */ jsx(Button, { type: "button", variant: "link", size: "sm", onClick: onReport, className: "mt-1 text-muted-foreground", children: reportLabel })
|
|
810
|
+
]
|
|
811
|
+
})
|
|
812
|
+
) });
|
|
813
|
+
}
|
|
546
814
|
var Input = React.forwardRef(
|
|
547
815
|
(_a, ref) => {
|
|
548
816
|
var _b = _a, { className, type, inputSize = "default", variant = "outline" } = _b, props = __objRest(_b, ["className", "type", "inputSize", "variant"]);
|
|
@@ -1331,6 +1599,6 @@ function PulseLogo({ className = "size-6" }) {
|
|
|
1331
1599
|
);
|
|
1332
1600
|
}
|
|
1333
1601
|
|
|
1334
|
-
export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge2 as Badge, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ClassLogo, Collapsible, CollapsibleContent, CollapsibleTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, FluencypassIcon, FluencypassLogo, GroupTalkLogo, Input, Label, PrivateTalkLogo, ProductLogo, PulseLogo, RadioGroup, RadioGroupItem, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Skeleton, Spinner, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, checkboxVariants, radioVariants, switchVariants, tabsListVariants };
|
|
1602
|
+
export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge2 as Badge, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, ClassLogo, Collapsible, CollapsibleContent, CollapsibleTrigger, ERROR_STATE_PRESETS, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, ErrorState, ErrorStateActions, ErrorStateDescription, ErrorStateMedia, ErrorStateMeta, ErrorStateTitle, FluencypassIcon, FluencypassLogo, GroupTalkLogo, Input, Label, PrivateTalkLogo, ProductLogo, PulseLogo, RadioGroup, RadioGroupItem, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Skeleton, Spinner, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants, checkboxVariants, radioVariants, switchVariants, tabsListVariants };
|
|
1335
1603
|
//# sourceMappingURL=index.js.map
|
|
1336
1604
|
//# sourceMappingURL=index.js.map
|