@vowt-tech/ui 0.0.0-stage → 0.177.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/README.md +13 -2
- package/bin/vowt-ux-ui-design.mjs +483 -0
- package/guia/LEIA-PRIMEIRO.md +106 -0
- package/guia/VERSAO +1 -0
- package/guia/componentes.md +104 -0
- package/guia/regras/atualizar.md +136 -0
- package/guia/regras/componentes.md +374 -0
- package/guia/regras/fundamentos.md +257 -0
- package/guia/regras/marca.md +200 -0
- package/guia/regras/medidas.md +114 -0
- package/guia/regras/regras-de-base.md +85 -0
- package/guia/regras/telas/acoes.md +56 -0
- package/guia/regras/telas/direcao-ux.md +327 -0
- package/guia/regras/telas/padroes.md +58 -0
- package/guia/regras/telas/regras.md +171 -0
- package/guia/regras/telas/voz.md +134 -0
- package/package.json +72 -4
- package/src/brand/icons.ts +215 -0
- package/src/brand/logo.tsx +288 -0
- package/src/components/accordion.tsx +58 -0
- package/src/components/ai-orb.tsx +67 -0
- package/src/components/alert-dialog.tsx +227 -0
- package/src/components/alert.tsx +128 -0
- package/src/components/area-chart.tsx +180 -0
- package/src/components/attachment.tsx +339 -0
- package/src/components/avatar.tsx +197 -0
- package/src/components/badge.tsx +242 -0
- package/src/components/bar-chart.tsx +138 -0
- package/src/components/bar-list.tsx +85 -0
- package/src/components/brand-icon.tsx +52 -0
- package/src/components/breadcrumb.tsx +96 -0
- package/src/components/button-group.tsx +29 -0
- package/src/components/button.tsx +208 -0
- package/src/components/calendar.tsx +238 -0
- package/src/components/card.tsx +136 -0
- package/src/components/chart.tsx +289 -0
- package/src/components/checkbox.tsx +42 -0
- package/src/components/code-block.tsx +31 -0
- package/src/components/collapsible.tsx +114 -0
- package/src/components/color-picker.tsx +93 -0
- package/src/components/combo-chart.tsx +139 -0
- package/src/components/combobox.tsx +200 -0
- package/src/components/command.tsx +191 -0
- package/src/components/date-picker.tsx +435 -0
- package/src/components/description-list.tsx +280 -0
- package/src/components/dialog.tsx +192 -0
- package/src/components/diff-view.tsx +109 -0
- package/src/components/dropdown-menu.tsx +248 -0
- package/src/components/emoji-picker.tsx +299 -0
- package/src/components/empty.tsx +197 -0
- package/src/components/field.tsx +226 -0
- package/src/components/file-upload.tsx +186 -0
- package/src/components/funnel-chart.tsx +224 -0
- package/src/components/gauge-chart.tsx +109 -0
- package/src/components/heatmap.tsx +105 -0
- package/src/components/hover-card.tsx +47 -0
- package/src/components/image-viewer.tsx +174 -0
- package/src/components/input-otp.tsx +86 -0
- package/src/components/input.tsx +470 -0
- package/src/components/item.tsx +94 -0
- package/src/components/kbd.tsx +28 -0
- package/src/components/label.tsx +21 -0
- package/src/components/line-chart.tsx +92 -0
- package/src/components/link.tsx +34 -0
- package/src/components/message.tsx +903 -0
- package/src/components/number-field.tsx +79 -0
- package/src/components/pagination.tsx +208 -0
- package/src/components/phone-input.tsx +147 -0
- package/src/components/pie-chart.tsx +117 -0
- package/src/components/popover.tsx +102 -0
- package/src/components/powered-by.tsx +39 -0
- package/src/components/progress.tsx +278 -0
- package/src/components/prose.tsx +42 -0
- package/src/components/radar-chart.tsx +66 -0
- package/src/components/radial-chart.tsx +73 -0
- package/src/components/radio-group.tsx +135 -0
- package/src/components/rating.tsx +192 -0
- package/src/components/rich-text.tsx +1651 -0
- package/src/components/scatter-chart.tsx +115 -0
- package/src/components/scroll-area.tsx +50 -0
- package/src/components/select.tsx +193 -0
- package/src/components/separator.tsx +20 -0
- package/src/components/sheet.tsx +142 -0
- package/src/components/sidebar.tsx +570 -0
- package/src/components/skeleton.tsx +18 -0
- package/src/components/slider.tsx +47 -0
- package/src/components/sonner.tsx +178 -0
- package/src/components/sparkline.tsx +68 -0
- package/src/components/spinner.tsx +35 -0
- package/src/components/status-dot.tsx +45 -0
- package/src/components/stepper.tsx +228 -0
- package/src/components/switch.tsx +35 -0
- package/src/components/table.tsx +267 -0
- package/src/components/tabs.tsx +184 -0
- package/src/components/tag-input.tsx +238 -0
- package/src/components/textarea.tsx +47 -0
- package/src/components/time-picker.tsx +183 -0
- package/src/components/timeline.tsx +75 -0
- package/src/components/toggle-group.tsx +93 -0
- package/src/components/toggle.tsx +51 -0
- package/src/components/tooltip.tsx +160 -0
- package/src/components/tree.tsx +136 -0
- package/src/components/voice-message.tsx +193 -0
- package/src/css.d.ts +2 -0
- package/src/hooks/use-appearance.ts +57 -0
- package/src/hooks/use-mobile.ts +20 -0
- package/src/lib/appearance.ts +16 -0
- package/src/lib/button-render.ts +32 -0
- package/src/lib/char-count.tsx +67 -0
- package/src/lib/date.ts +45 -0
- package/src/lib/file-accept.ts +59 -0
- package/src/lib/markdown.ts +187 -0
- package/src/lib/utils.ts +29 -0
- package/src/lib/voice.ts +68 -0
- package/src/styles/shadcn.css +642 -0
- package/src/styles/theme.css +1825 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
CartesianGrid,
|
|
5
|
+
Line,
|
|
6
|
+
LineChart as LinePrimitive,
|
|
7
|
+
ReferenceLine,
|
|
8
|
+
XAxis,
|
|
9
|
+
YAxis,
|
|
10
|
+
} from 'recharts';
|
|
11
|
+
import {
|
|
12
|
+
AXIS,
|
|
13
|
+
type ChartDatum,
|
|
14
|
+
type ChartSeries,
|
|
15
|
+
ChartContainer,
|
|
16
|
+
ChartLegend,
|
|
17
|
+
ChartTooltip,
|
|
18
|
+
formatNumber,
|
|
19
|
+
seriesConfig,
|
|
20
|
+
CHART_ANIMATION,
|
|
21
|
+
} from './chart';
|
|
22
|
+
import { cn } from '../lib/utils';
|
|
23
|
+
|
|
24
|
+
// Gráfico de linhas pronto (D-156): comparar séries ao longo do tempo, como este mês contra o
|
|
25
|
+
// anterior. Linha de 2px; pontos só quando há poucos dados; linha de meta opcional.
|
|
26
|
+
|
|
27
|
+
function LineChart({
|
|
28
|
+
data,
|
|
29
|
+
index,
|
|
30
|
+
series,
|
|
31
|
+
curve = 'smooth',
|
|
32
|
+
dots = false,
|
|
33
|
+
goal,
|
|
34
|
+
yAxis = true,
|
|
35
|
+
format = formatNumber,
|
|
36
|
+
className,
|
|
37
|
+
}: {
|
|
38
|
+
data: ChartDatum[];
|
|
39
|
+
index: string;
|
|
40
|
+
series: ChartSeries[];
|
|
41
|
+
curve?: 'smooth' | 'linear' | 'step';
|
|
42
|
+
/** Pontos em cada valor; bom com até uns 12 pontos. */
|
|
43
|
+
dots?: boolean;
|
|
44
|
+
/** Linha de meta, tracejada, com o rótulo. */
|
|
45
|
+
goal?: { value: number; label: string };
|
|
46
|
+
yAxis?: boolean;
|
|
47
|
+
format?: (value: unknown) => string;
|
|
48
|
+
className?: string;
|
|
49
|
+
}) {
|
|
50
|
+
const type = curve === 'smooth' ? 'monotone' : curve === 'step' ? 'step' : 'linear';
|
|
51
|
+
return (
|
|
52
|
+
<ChartContainer config={seriesConfig(series)} className={cn('aspect-auto h-64', className)}>
|
|
53
|
+
{(hidden) => (
|
|
54
|
+
<LinePrimitive data={data} margin={{ top: 8, right: 8, left: 0, bottom: 0 }}>
|
|
55
|
+
<CartesianGrid vertical={false} />
|
|
56
|
+
<XAxis dataKey={index} {...AXIS} minTickGap={24} />
|
|
57
|
+
{yAxis && <YAxis {...AXIS} width="auto" tickFormatter={(v) => format(v)} />}
|
|
58
|
+
{goal && (
|
|
59
|
+
<ReferenceLine
|
|
60
|
+
y={goal.value}
|
|
61
|
+
stroke="var(--muted-foreground)"
|
|
62
|
+
strokeDasharray="4 4"
|
|
63
|
+
label={{
|
|
64
|
+
value: goal.label,
|
|
65
|
+
position: 'insideTopLeft',
|
|
66
|
+
className: 'fill-muted-foreground text-body-12',
|
|
67
|
+
}}
|
|
68
|
+
/>
|
|
69
|
+
)}
|
|
70
|
+
<ChartTooltip formatValue={format} />
|
|
71
|
+
{series.length > 1 && <ChartLegend />}
|
|
72
|
+
{series.map((s) => (
|
|
73
|
+
<Line
|
|
74
|
+
key={s.key}
|
|
75
|
+
{...CHART_ANIMATION}
|
|
76
|
+
dataKey={s.key}
|
|
77
|
+
hide={hidden.has(s.key)}
|
|
78
|
+
type={type}
|
|
79
|
+
stroke={`var(--color-${s.key})`}
|
|
80
|
+
strokeWidth={2}
|
|
81
|
+
strokeDasharray={s.dashed ? '4 4' : undefined}
|
|
82
|
+
dot={dots ? { r: 4, strokeWidth: 2, fill: 'var(--card)' } : false}
|
|
83
|
+
activeDot={{ r: 4, strokeWidth: 2, stroke: 'var(--card)' }}
|
|
84
|
+
/>
|
|
85
|
+
))}
|
|
86
|
+
</LinePrimitive>
|
|
87
|
+
)}
|
|
88
|
+
</ChartContainer>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export { LineChart };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
createContext,
|
|
5
|
+
useContext,
|
|
6
|
+
type AnchorHTMLAttributes,
|
|
7
|
+
type ComponentType,
|
|
8
|
+
type ReactNode,
|
|
9
|
+
} from 'react';
|
|
10
|
+
|
|
11
|
+
// Os componentes do pacote não dependem do Next.js. O app informa uma vez, no layout raiz, qual
|
|
12
|
+
// link usar (no Next, o next/link), e os links internos dos componentes navegam sem recarregar a
|
|
13
|
+
// página. Sem o LinkProvider, vira um <a> comum.
|
|
14
|
+
|
|
15
|
+
export type LinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & { href: string };
|
|
16
|
+
|
|
17
|
+
const LinkContext = createContext<ComponentType<LinkProps> | 'a'>('a');
|
|
18
|
+
|
|
19
|
+
export function LinkProvider({
|
|
20
|
+
component,
|
|
21
|
+
children,
|
|
22
|
+
}: {
|
|
23
|
+
component: ComponentType<LinkProps>;
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
}) {
|
|
26
|
+
return <LinkContext.Provider value={component}>{children}</LinkContext.Provider>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default function Link(props: LinkProps) {
|
|
30
|
+
const Component = useContext(LinkContext);
|
|
31
|
+
return <Component {...props} />;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { Link };
|