@vowt-tech/ui 0.0.0-stage → 0.177.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +13 -2
  2. package/bin/vowt-ux-ui-design.mjs +483 -0
  3. package/guia/LEIA-PRIMEIRO.md +106 -0
  4. package/guia/VERSAO +1 -0
  5. package/guia/componentes.md +104 -0
  6. package/guia/regras/atualizar.md +136 -0
  7. package/guia/regras/componentes.md +374 -0
  8. package/guia/regras/fundamentos.md +257 -0
  9. package/guia/regras/marca.md +200 -0
  10. package/guia/regras/medidas.md +114 -0
  11. package/guia/regras/regras-de-base.md +85 -0
  12. package/guia/regras/telas/acoes.md +56 -0
  13. package/guia/regras/telas/direcao-ux.md +327 -0
  14. package/guia/regras/telas/padroes.md +58 -0
  15. package/guia/regras/telas/regras.md +171 -0
  16. package/guia/regras/telas/voz.md +134 -0
  17. package/package.json +72 -4
  18. package/src/brand/icons.ts +215 -0
  19. package/src/brand/logo.tsx +288 -0
  20. package/src/components/accordion.tsx +58 -0
  21. package/src/components/ai-orb.tsx +67 -0
  22. package/src/components/alert-dialog.tsx +227 -0
  23. package/src/components/alert.tsx +128 -0
  24. package/src/components/area-chart.tsx +180 -0
  25. package/src/components/attachment.tsx +339 -0
  26. package/src/components/avatar.tsx +197 -0
  27. package/src/components/badge.tsx +242 -0
  28. package/src/components/bar-chart.tsx +138 -0
  29. package/src/components/bar-list.tsx +85 -0
  30. package/src/components/brand-icon.tsx +52 -0
  31. package/src/components/breadcrumb.tsx +96 -0
  32. package/src/components/button-group.tsx +29 -0
  33. package/src/components/button.tsx +208 -0
  34. package/src/components/calendar.tsx +238 -0
  35. package/src/components/card.tsx +136 -0
  36. package/src/components/chart.tsx +289 -0
  37. package/src/components/checkbox.tsx +42 -0
  38. package/src/components/code-block.tsx +31 -0
  39. package/src/components/collapsible.tsx +114 -0
  40. package/src/components/color-picker.tsx +93 -0
  41. package/src/components/combo-chart.tsx +139 -0
  42. package/src/components/combobox.tsx +200 -0
  43. package/src/components/command.tsx +191 -0
  44. package/src/components/date-picker.tsx +435 -0
  45. package/src/components/description-list.tsx +280 -0
  46. package/src/components/dialog.tsx +192 -0
  47. package/src/components/diff-view.tsx +109 -0
  48. package/src/components/dropdown-menu.tsx +248 -0
  49. package/src/components/emoji-picker.tsx +299 -0
  50. package/src/components/empty.tsx +197 -0
  51. package/src/components/field.tsx +226 -0
  52. package/src/components/file-upload.tsx +186 -0
  53. package/src/components/funnel-chart.tsx +224 -0
  54. package/src/components/gauge-chart.tsx +109 -0
  55. package/src/components/heatmap.tsx +105 -0
  56. package/src/components/hover-card.tsx +47 -0
  57. package/src/components/image-viewer.tsx +174 -0
  58. package/src/components/input-otp.tsx +86 -0
  59. package/src/components/input.tsx +470 -0
  60. package/src/components/item.tsx +94 -0
  61. package/src/components/kbd.tsx +28 -0
  62. package/src/components/label.tsx +21 -0
  63. package/src/components/line-chart.tsx +92 -0
  64. package/src/components/link.tsx +34 -0
  65. package/src/components/message.tsx +903 -0
  66. package/src/components/number-field.tsx +79 -0
  67. package/src/components/pagination.tsx +208 -0
  68. package/src/components/phone-input.tsx +147 -0
  69. package/src/components/pie-chart.tsx +117 -0
  70. package/src/components/popover.tsx +102 -0
  71. package/src/components/powered-by.tsx +39 -0
  72. package/src/components/progress.tsx +278 -0
  73. package/src/components/prose.tsx +42 -0
  74. package/src/components/radar-chart.tsx +66 -0
  75. package/src/components/radial-chart.tsx +73 -0
  76. package/src/components/radio-group.tsx +135 -0
  77. package/src/components/rating.tsx +192 -0
  78. package/src/components/rich-text.tsx +1651 -0
  79. package/src/components/scatter-chart.tsx +115 -0
  80. package/src/components/scroll-area.tsx +50 -0
  81. package/src/components/select.tsx +193 -0
  82. package/src/components/separator.tsx +20 -0
  83. package/src/components/sheet.tsx +142 -0
  84. package/src/components/sidebar.tsx +570 -0
  85. package/src/components/skeleton.tsx +18 -0
  86. package/src/components/slider.tsx +47 -0
  87. package/src/components/sonner.tsx +178 -0
  88. package/src/components/sparkline.tsx +68 -0
  89. package/src/components/spinner.tsx +35 -0
  90. package/src/components/status-dot.tsx +45 -0
  91. package/src/components/stepper.tsx +228 -0
  92. package/src/components/switch.tsx +35 -0
  93. package/src/components/table.tsx +267 -0
  94. package/src/components/tabs.tsx +184 -0
  95. package/src/components/tag-input.tsx +238 -0
  96. package/src/components/textarea.tsx +47 -0
  97. package/src/components/time-picker.tsx +183 -0
  98. package/src/components/timeline.tsx +75 -0
  99. package/src/components/toggle-group.tsx +93 -0
  100. package/src/components/toggle.tsx +51 -0
  101. package/src/components/tooltip.tsx +160 -0
  102. package/src/components/tree.tsx +136 -0
  103. package/src/components/voice-message.tsx +193 -0
  104. package/src/css.d.ts +2 -0
  105. package/src/hooks/use-appearance.ts +57 -0
  106. package/src/hooks/use-mobile.ts +20 -0
  107. package/src/lib/appearance.ts +16 -0
  108. package/src/lib/button-render.ts +32 -0
  109. package/src/lib/char-count.tsx +67 -0
  110. package/src/lib/date.ts +45 -0
  111. package/src/lib/file-accept.ts +59 -0
  112. package/src/lib/markdown.ts +187 -0
  113. package/src/lib/utils.ts +29 -0
  114. package/src/lib/voice.ts +68 -0
  115. package/src/styles/shadcn.css +642 -0
  116. package/src/styles/theme.css +1825 -0
@@ -0,0 +1,115 @@
1
+ 'use client';
2
+
3
+ import {
4
+ CartesianGrid,
5
+ Scatter,
6
+ ScatterChart as ScatterPrimitive,
7
+ XAxis,
8
+ YAxis,
9
+ ZAxis,
10
+ } from 'recharts';
11
+ import {
12
+ AXIS,
13
+ CHART_ANIMATION,
14
+ ChartContainer,
15
+ ChartLegend,
16
+ ChartTooltip,
17
+ formatNumber,
18
+ } from './chart';
19
+ import { cn } from '../lib/utils';
20
+
21
+ // Gráfico de bolhas, D-731: duas medidas ao mesmo tempo, como o ticket médio contra os dias para
22
+ // converter, por origem. A posição dá as duas medidas e o tamanho da bolha, a quantidade. Uma cor
23
+ // por grupo, com a legenda.
24
+
25
+ export type ScatterPoint = {
26
+ key: string;
27
+ label: string;
28
+ x: number;
29
+ y: number;
30
+ /** Tamanho da bolha, como a quantidade de negócios. */
31
+ size?: number;
32
+ color?: string;
33
+ };
34
+
35
+ const COLORS = [
36
+ 'var(--chart-1)',
37
+ 'var(--chart-2)',
38
+ 'var(--chart-3)',
39
+ 'var(--chart-4)',
40
+ 'var(--chart-5)',
41
+ ];
42
+
43
+ function ScatterChart({
44
+ points,
45
+ xLabel,
46
+ yLabel,
47
+ formatX = formatNumber,
48
+ formatY = formatNumber,
49
+ className,
50
+ }: {
51
+ points: ScatterPoint[];
52
+ /** Nome da medida de baixo, como "Ticket médio". */
53
+ xLabel: string;
54
+ /** Nome da medida do lado, como "Dias para converter". */
55
+ yLabel: string;
56
+ formatX?: (value: unknown) => string;
57
+ formatY?: (value: unknown) => string;
58
+ className?: string;
59
+ }) {
60
+ const config = Object.fromEntries(
61
+ points.map((p, i) => [p.key, { label: p.label, color: p.color ?? COLORS[i % 5]! }]),
62
+ );
63
+ const sizes = points.map((p) => p.size ?? 1);
64
+ return (
65
+ <ChartContainer config={config} className={cn('aspect-auto h-64', className)}>
66
+ {(hidden) => (
67
+ <ScatterPrimitive margin={{ top: 12, right: 12, left: 0, bottom: 0 }}>
68
+ <CartesianGrid />
69
+ <XAxis
70
+ type="number"
71
+ dataKey="x"
72
+ name={xLabel}
73
+ {...AXIS}
74
+ tickFormatter={(v) => formatX(v)}
75
+ domain={['auto', 'auto']}
76
+ />
77
+ <YAxis
78
+ type="number"
79
+ dataKey="y"
80
+ name={yLabel}
81
+ {...AXIS}
82
+ width="auto"
83
+ tickFormatter={(v) => formatY(v)}
84
+ domain={['auto', 'auto']}
85
+ />
86
+ <ZAxis
87
+ type="number"
88
+ dataKey="size"
89
+ range={[80, 600]}
90
+ domain={[Math.min(...sizes), Math.max(...sizes)]}
91
+ />
92
+ <ChartTooltip
93
+ formatValue={(v, key) =>
94
+ key === 'x' ? formatX(v) : key === 'y' ? formatY(v) : String(v)
95
+ }
96
+ />
97
+ {points.length > 1 && <ChartLegend />}
98
+ {points.map((p) => (
99
+ <Scatter
100
+ key={p.key}
101
+ {...CHART_ANIMATION}
102
+ name={p.key}
103
+ data={[{ x: p.x, y: p.y, size: p.size ?? 1 }]}
104
+ hide={hidden.has(p.key)}
105
+ fill={`var(--color-${p.key})`}
106
+ fillOpacity={0.85}
107
+ />
108
+ ))}
109
+ </ScatterPrimitive>
110
+ )}
111
+ </ChartContainer>
112
+ );
113
+ }
114
+
115
+ export { ScatterChart };
@@ -0,0 +1,50 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import { ScrollArea as ScrollAreaPrimitive } from '@base-ui/react/scroll-area';
5
+ import { cn } from '../lib/utils';
6
+
7
+ function ScrollArea({ className, children, ...props }: ScrollAreaPrimitive.Root.Props) {
8
+ return (
9
+ <ScrollAreaPrimitive.Root
10
+ data-slot="scroll-area"
11
+ className={cn('relative', className)}
12
+ {...props}
13
+ >
14
+ <ScrollAreaPrimitive.Viewport
15
+ data-slot="scroll-area-viewport"
16
+ className="size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:focus-ring focus-visible:outline-1"
17
+ >
18
+ {children}
19
+ </ScrollAreaPrimitive.Viewport>
20
+ <ScrollBar />
21
+ <ScrollAreaPrimitive.Corner />
22
+ </ScrollAreaPrimitive.Root>
23
+ );
24
+ }
25
+
26
+ function ScrollBar({
27
+ className,
28
+ orientation = 'vertical',
29
+ ...props
30
+ }: ScrollAreaPrimitive.Scrollbar.Props) {
31
+ return (
32
+ <ScrollAreaPrimitive.Scrollbar
33
+ data-slot="scroll-area-scrollbar"
34
+ data-orientation={orientation}
35
+ orientation={orientation}
36
+ className={cn(
37
+ 'flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent',
38
+ className,
39
+ )}
40
+ {...props}
41
+ >
42
+ <ScrollAreaPrimitive.Thumb
43
+ data-slot="scroll-area-thumb"
44
+ className="relative flex-1 rounded-full bg-border"
45
+ />
46
+ </ScrollAreaPrimitive.Scrollbar>
47
+ );
48
+ }
49
+
50
+ export { ScrollArea, ScrollBar };
@@ -0,0 +1,193 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import { Select as SelectPrimitive } from '@base-ui/react/select';
5
+ import { cn } from '../lib/utils';
6
+ import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from 'lucide-react';
7
+
8
+ const Select = SelectPrimitive.Root;
9
+
10
+ function SelectGroup({ className, ...props }: SelectPrimitive.Group.Props) {
11
+ return (
12
+ <SelectPrimitive.Group
13
+ data-slot="select-group"
14
+ className={cn('scroll-my-1 p-1', className)}
15
+ {...props}
16
+ />
17
+ );
18
+ }
19
+
20
+ function SelectValue({ className, ...props }: SelectPrimitive.Value.Props) {
21
+ return (
22
+ <SelectPrimitive.Value
23
+ data-slot="select-value"
24
+ // Texto longo termina em reticências; com ícone na frente, fica lado a lado com ele.
25
+ className={cn(
26
+ 'block min-w-0 flex-1 truncate text-left has-[>svg]:flex has-[>svg]:items-center has-[>svg]:gap-1.5',
27
+ className,
28
+ )}
29
+ {...props}
30
+ />
31
+ );
32
+ }
33
+
34
+ function SelectTrigger({
35
+ className,
36
+ size = 'default',
37
+ children,
38
+ ...props
39
+ }: SelectPrimitive.Trigger.Props & {
40
+ size?: 'sm' | 'default' | 'lg';
41
+ }) {
42
+ return (
43
+ <SelectPrimitive.Trigger
44
+ data-slot="select-trigger"
45
+ data-size={size}
46
+ className={cn(
47
+ "flex w-fit items-center justify-between gap-1.5 rounded-control border border-input bg-surface-control px-2.5 py-2 text-body-13 whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring-strong focus-visible:focus-ring-field disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-ring-invalid data-placeholder:text-muted-foreground data-[size=default]:h-control data-[size=lg]:h-control-lg data-[size=sm]:h-control-sm dark:hover:bg-hover dark:aria-invalid:border-border-error [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-icon",
48
+ className,
49
+ )}
50
+ {...props}
51
+ >
52
+ {children}
53
+ <SelectPrimitive.Icon
54
+ render={
55
+ <ChevronDownIcon className="pointer-events-none size-icon-xs text-muted-foreground" />
56
+ }
57
+ />
58
+ </SelectPrimitive.Trigger>
59
+ );
60
+ }
61
+
62
+ function SelectContent({
63
+ className,
64
+ children,
65
+ side = 'bottom',
66
+ sideOffset = 4,
67
+ align = 'center',
68
+ alignOffset = 0,
69
+ alignItemWithTrigger = false,
70
+ ...props
71
+ }: SelectPrimitive.Popup.Props &
72
+ Pick<
73
+ SelectPrimitive.Positioner.Props,
74
+ 'align' | 'alignOffset' | 'side' | 'sideOffset' | 'alignItemWithTrigger'
75
+ >) {
76
+ return (
77
+ <SelectPrimitive.Portal>
78
+ <SelectPrimitive.Positioner
79
+ side={side}
80
+ sideOffset={sideOffset}
81
+ align={align}
82
+ alignOffset={alignOffset}
83
+ alignItemWithTrigger={alignItemWithTrigger}
84
+ className="isolate z-50"
85
+ >
86
+ <SelectPrimitive.Popup
87
+ data-slot="select-content"
88
+ data-align-trigger={alignItemWithTrigger}
89
+ className={cn(
90
+ 'relative isolate z-50 max-h-(--available-height) w-max max-w-[min(32rem,var(--available-width))] min-w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-menu bg-popover p-1 text-popover-foreground shadow-menu ring-1 ring-border duration-(--duration-fast) data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',
91
+ className,
92
+ )}
93
+ {...props}
94
+ >
95
+ <SelectScrollUpButton />
96
+ <SelectPrimitive.List>{children}</SelectPrimitive.List>
97
+ <SelectScrollDownButton />
98
+ </SelectPrimitive.Popup>
99
+ </SelectPrimitive.Positioner>
100
+ </SelectPrimitive.Portal>
101
+ );
102
+ }
103
+
104
+ function SelectLabel({ className, ...props }: SelectPrimitive.GroupLabel.Props) {
105
+ return (
106
+ <SelectPrimitive.GroupLabel
107
+ data-slot="select-label"
108
+ className={cn('px-2.5 py-1.5 text-body-12-medium text-muted-foreground', className)}
109
+ {...props}
110
+ />
111
+ );
112
+ }
113
+
114
+ function SelectItem({ className, children, ...props }: SelectPrimitive.Item.Props) {
115
+ return (
116
+ <SelectPrimitive.Item
117
+ data-slot="select-item"
118
+ className={cn(
119
+ "relative flex w-full cursor-default items-center min-h-control-sm gap-2 rounded-item py-1.5 pr-8 pl-3 text-body-13 outline-hidden data-highlighted:bg-hover select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-icon-menu *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
120
+ className,
121
+ )}
122
+ {...props}
123
+ >
124
+ <SelectPrimitive.ItemText className="flex min-w-0 flex-1 items-center gap-2 truncate whitespace-nowrap">
125
+ {children}
126
+ </SelectPrimitive.ItemText>
127
+ <SelectPrimitive.ItemIndicator
128
+ render={
129
+ <span className="pointer-events-none absolute right-3 flex size-4 items-center justify-center" />
130
+ }
131
+ >
132
+ <CheckIcon className="pointer-events-none" />
133
+ </SelectPrimitive.ItemIndicator>
134
+ </SelectPrimitive.Item>
135
+ );
136
+ }
137
+
138
+ function SelectSeparator({ className, ...props }: SelectPrimitive.Separator.Props) {
139
+ return (
140
+ <SelectPrimitive.Separator
141
+ data-slot="select-separator"
142
+ className={cn('pointer-events-none -mx-1 my-1 h-px bg-border', className)}
143
+ {...props}
144
+ />
145
+ );
146
+ }
147
+
148
+ function SelectScrollUpButton({
149
+ className,
150
+ ...props
151
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollUpArrow>) {
152
+ return (
153
+ <SelectPrimitive.ScrollUpArrow
154
+ data-slot="select-scroll-up-button"
155
+ className={cn(
156
+ "top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3",
157
+ className,
158
+ )}
159
+ {...props}
160
+ >
161
+ <ChevronUpIcon />
162
+ </SelectPrimitive.ScrollUpArrow>
163
+ );
164
+ }
165
+
166
+ function SelectScrollDownButton({
167
+ className,
168
+ ...props
169
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollDownArrow>) {
170
+ return (
171
+ <SelectPrimitive.ScrollDownArrow
172
+ data-slot="select-scroll-down-button"
173
+ className={cn(
174
+ "bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-3",
175
+ className,
176
+ )}
177
+ {...props}
178
+ >
179
+ <ChevronDownIcon />
180
+ </SelectPrimitive.ScrollDownArrow>
181
+ );
182
+ }
183
+
184
+ export {
185
+ Select,
186
+ SelectContent,
187
+ SelectGroup,
188
+ SelectItem,
189
+ SelectLabel,
190
+ SelectSeparator,
191
+ SelectTrigger,
192
+ SelectValue,
193
+ };
@@ -0,0 +1,20 @@
1
+ 'use client';
2
+
3
+ import { Separator as SeparatorPrimitive } from '@base-ui/react/separator';
4
+ import { cn } from '../lib/utils';
5
+
6
+ function Separator({ className, orientation = 'horizontal', ...props }: SeparatorPrimitive.Props) {
7
+ return (
8
+ <SeparatorPrimitive
9
+ data-slot="separator"
10
+ orientation={orientation}
11
+ className={cn(
12
+ 'shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch',
13
+ className,
14
+ )}
15
+ {...props}
16
+ />
17
+ );
18
+ }
19
+
20
+ export { Separator };
@@ -0,0 +1,142 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import { Dialog as SheetPrimitive } from '@base-ui/react/dialog';
5
+ import { cn } from '../lib/utils';
6
+
7
+ import { Button } from './button';
8
+ import { useQuietInitialFocus } from './dialog';
9
+ import { XIcon } from 'lucide-react';
10
+
11
+ function Sheet({ ...props }: SheetPrimitive.Root.Props) {
12
+ return <SheetPrimitive.Root data-slot="sheet" {...props} />;
13
+ }
14
+
15
+ function SheetTrigger({ ...props }: SheetPrimitive.Trigger.Props) {
16
+ return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />;
17
+ }
18
+
19
+ function SheetClose({ ...props }: SheetPrimitive.Close.Props) {
20
+ return <SheetPrimitive.Close data-slot="sheet-close" {...props} />;
21
+ }
22
+
23
+ function SheetPortal({ ...props }: SheetPrimitive.Portal.Props) {
24
+ return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />;
25
+ }
26
+
27
+ function SheetOverlay({ className, ...props }: SheetPrimitive.Backdrop.Props) {
28
+ return (
29
+ <SheetPrimitive.Backdrop
30
+ data-slot="sheet-overlay"
31
+ className={cn(
32
+ 'fixed inset-0 z-50 bg-surface-overlay transition-opacity duration-(--duration-medium) data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs',
33
+ className,
34
+ )}
35
+ {...props}
36
+ />
37
+ );
38
+ }
39
+
40
+ function SheetContent({
41
+ className,
42
+ children,
43
+ side = 'right',
44
+ showCloseButton = true,
45
+ size = 'default',
46
+ ref,
47
+ initialFocus,
48
+ ...props
49
+ }: SheetPrimitive.Popup.Props & {
50
+ side?: 'top' | 'right' | 'bottom' | 'left';
51
+ /** Sem o X do canto, para quando o painel tem cabeçalho próprio com o fechar. */
52
+ showCloseButton?: boolean;
53
+ /**
54
+ * Largura do painel lateral: sm 384px, default 448px, md 512px, como o assistente de IA, e lg
55
+ * 576px, como os dados do cliente. No celular, ocupa três quartos da tela. D-659: flutua a 8px das
56
+ * bordas da tela, com canto arredondado. D-823: xl 1024px, o painel largo, para a ficha de um
57
+ * registro aberta por cima da lista ou do quadro, como o negócio sobre o funil. No celular e no
58
+ * tablet, o xl ocupa a tela toda, menos os 8px de cada lado.
59
+ */
60
+ size?: 'sm' | 'default' | 'md' | 'lg' | 'xl';
61
+ }) {
62
+ const focus = useQuietInitialFocus(ref);
63
+ return (
64
+ <SheetPortal>
65
+ <SheetOverlay />
66
+ <SheetPrimitive.Popup
67
+ data-slot="sheet-content"
68
+ data-side={side}
69
+ data-size={size}
70
+ className={cn(
71
+ 'fixed z-50 flex flex-col gap-4 overflow-hidden rounded-card border bg-popover outline-none bg-clip-padding text-body-13 text-popover-foreground shadow-dialog transition duration-(--duration-medium) ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-2 data-[side=bottom]:bottom-2 data-[side=bottom]:h-auto data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-2 data-[side=left]:left-2 data-[side=left]:w-3/4 data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-2 data-[side=right]:right-2 data-[side=right]:w-3/4 data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-2 data-[side=top]:top-2 data-[side=top]:h-auto data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-md data-[side=right]:sm:max-w-md data-[size=sm]:data-[side=left]:sm:max-w-sm data-[size=sm]:data-[side=right]:sm:max-w-sm data-[size=md]:data-[side=left]:sm:max-w-lg data-[size=md]:data-[side=right]:sm:max-w-lg data-[size=lg]:data-[side=left]:sm:max-w-xl data-[size=lg]:data-[side=right]:sm:max-w-xl data-[size=xl]:data-[side=left]:w-[calc(100%-1rem)] data-[size=xl]:data-[side=left]:sm:max-w-5xl data-[size=xl]:data-[side=right]:w-[calc(100%-1rem)] data-[size=xl]:data-[side=right]:sm:max-w-5xl',
72
+ className,
73
+ )}
74
+ ref={focus.ref}
75
+ initialFocus={initialFocus ?? focus.initialFocus}
76
+ {...props}
77
+ >
78
+ {children}
79
+ {showCloseButton && (
80
+ <SheetPrimitive.Close
81
+ data-slot="sheet-close"
82
+ render={<Button variant="ghost" className="absolute top-5 right-5" size="icon-sm" />}
83
+ >
84
+ <XIcon />
85
+ <span className="sr-only">Fechar</span>
86
+ </SheetPrimitive.Close>
87
+ )}
88
+ </SheetPrimitive.Popup>
89
+ </SheetPortal>
90
+ );
91
+ }
92
+
93
+ function SheetHeader({ className, ...props }: React.ComponentProps<'div'>) {
94
+ return (
95
+ <div
96
+ data-slot="sheet-header"
97
+ className={cn('flex flex-col gap-0.5 p-6', className)}
98
+ {...props}
99
+ />
100
+ );
101
+ }
102
+
103
+ function SheetFooter({ className, ...props }: React.ComponentProps<'div'>) {
104
+ return (
105
+ <div
106
+ data-slot="sheet-footer"
107
+ className={cn('mt-auto flex flex-col gap-2 p-6', className)}
108
+ {...props}
109
+ />
110
+ );
111
+ }
112
+
113
+ function SheetTitle({ className, ...props }: SheetPrimitive.Title.Props) {
114
+ return (
115
+ <SheetPrimitive.Title
116
+ data-slot="sheet-title"
117
+ className={cn('text-title-dialog text-foreground', className)}
118
+ {...props}
119
+ />
120
+ );
121
+ }
122
+
123
+ function SheetDescription({ className, ...props }: SheetPrimitive.Description.Props) {
124
+ return (
125
+ <SheetPrimitive.Description
126
+ data-slot="sheet-description"
127
+ className={cn('text-body-13 text-muted-foreground', className)}
128
+ {...props}
129
+ />
130
+ );
131
+ }
132
+
133
+ export {
134
+ Sheet,
135
+ SheetTrigger,
136
+ SheetClose,
137
+ SheetContent,
138
+ SheetHeader,
139
+ SheetFooter,
140
+ SheetTitle,
141
+ SheetDescription,
142
+ };