@snksergio/design-system 0.52.0 → 0.53.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/dist-lib/chunks/{panel-Bly-rNP9.cjs → panel-CTbiCa0_.cjs} +105 -3
- package/dist-lib/chunks/panel-CTbiCa0_.cjs.map +1 -0
- package/dist-lib/chunks/{panel-DA6K3a3n.mjs → panel-DsOKm4Im.mjs} +155 -53
- package/dist-lib/chunks/panel-DsOKm4Im.mjs.map +1 -0
- package/dist-lib/index.cjs +4 -1
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.mjs +54 -51
- package/dist-lib/preview/clientes.cjs +1 -1
- package/dist-lib/preview/clientes.mjs +1 -1
- package/dist-lib/src/components/ui/avatar-ig/avatar-group-context.d.ts +24 -0
- package/dist-lib/src/components/ui/avatar-ig/avatar-group-context.d.ts.map +1 -0
- package/dist-lib/src/components/ui/avatar-ig/avatar-group.d.ts +52 -0
- package/dist-lib/src/components/ui/avatar-ig/avatar-group.d.ts.map +1 -0
- package/dist-lib/src/components/ui/avatar-ig/avatar.d.ts +9 -0
- package/dist-lib/src/components/ui/avatar-ig/avatar.d.ts.map +1 -1
- package/dist-lib/src/components/ui/avatar-ig/avatar.styles.d.ts +93 -0
- package/dist-lib/src/components/ui/avatar-ig/avatar.styles.d.ts.map +1 -1
- package/dist-lib/src/components/ui/avatar-ig/avatar.types.d.ts +37 -0
- package/dist-lib/src/components/ui/avatar-ig/avatar.types.d.ts.map +1 -1
- package/dist-lib/src/components/ui/avatar-ig/index.d.ts +3 -2
- package/dist-lib/src/components/ui/avatar-ig/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist-lib/chunks/panel-Bly-rNP9.cjs.map +0 -1
- package/dist-lib/chunks/panel-DA6K3a3n.mjs.map +0 -1
package/dist-lib/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as getContrastTextColor, a as FormField, e as Avatar, i as isFilterEntryActive, f as FilterPopover, T as ToolbarToolButton, h as ButtonGroup, j as ToolbarSimpleFilterDrawer, k as TableToolbar, l as ToolbarActions, m as ToolbarFilterButton, n as ToolbarSearch, o as ToolbarApplied, q as ToolbarTabs, r as columnTypeRegistry, L as ListItem, s as List } from "./chunks/panel-
|
|
2
|
-
import { t, A, B,
|
|
1
|
+
import { g as getContrastTextColor, a as FormField, e as Avatar, i as isFilterEntryActive, f as FilterPopover, T as ToolbarToolButton, h as ButtonGroup, j as ToolbarSimpleFilterDrawer, k as TableToolbar, l as ToolbarActions, m as ToolbarFilterButton, n as ToolbarSearch, o as ToolbarApplied, q as ToolbarTabs, r as columnTypeRegistry, L as ListItem, s as List } from "./chunks/panel-DsOKm4Im.mjs";
|
|
2
|
+
import { t, A, u, B, v, C, w, x, y, D, z, E, G, H, I, J, K, M, N, d, O, Q, R, S, U, F, b, V, c, W, X, P, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, p, al, am, an, ao, ap } from "./chunks/panel-DsOKm4Im.mjs";
|
|
3
3
|
import { C as Chip } from "./chunks/useTheme-Bk8AYqLr.mjs";
|
|
4
4
|
import { A as A2, a, b as b2, H as H2, c as c2, d as d2, e, f, g, M as M2, S as S2, h, i, j, k, l, m, n, U as U2, o, p as p2, q, r, s, t as t2, v as v2, w as w2, u as u2 } from "./chunks/useTheme-Bk8AYqLr.mjs";
|
|
5
5
|
import { a8 as tv, c as cn, V as Popover, Z as PopoverTrigger, Y as PopoverContent, a7 as Button, D as Dialog, w as DialogTrigger, p as DialogContent, v as DialogTitle, W as PopoverAnchor, o as DialogClose, q as DialogDescription, x as DropdownMenu, O as DropdownMenuTrigger, z as DropdownMenuContent, J as DropdownMenuSeparator, E as DropdownMenuItem } from "./chunks/avatar-FPbG1TRy.mjs";
|
|
@@ -8295,10 +8295,11 @@ export {
|
|
|
8295
8295
|
A as AlertModal,
|
|
8296
8296
|
A2 as AppShell,
|
|
8297
8297
|
Avatar,
|
|
8298
|
+
u as AvatarGroup,
|
|
8298
8299
|
BRANDS,
|
|
8299
8300
|
B2 as Badge,
|
|
8300
8301
|
B as BulkActionButton,
|
|
8301
|
-
|
|
8302
|
+
v as BulkActionsBar,
|
|
8302
8303
|
Button,
|
|
8303
8304
|
ButtonGroup,
|
|
8304
8305
|
CardCheckbox,
|
|
@@ -8316,38 +8317,38 @@ export {
|
|
|
8316
8317
|
ChoroplethMap,
|
|
8317
8318
|
ColorPicker,
|
|
8318
8319
|
C as ColsPanel,
|
|
8319
|
-
|
|
8320
|
-
|
|
8320
|
+
w as ColsPopover,
|
|
8321
|
+
x as Combobox,
|
|
8321
8322
|
ConversationListItem,
|
|
8322
8323
|
DEFAULT_COLOR_PRESETS,
|
|
8323
|
-
|
|
8324
|
+
y as DEFAULT_FILTER_OPERATORS,
|
|
8324
8325
|
DEFAULT_MESSAGE_VARIABLES,
|
|
8325
8326
|
DataList,
|
|
8326
8327
|
D as DataTable,
|
|
8327
|
-
|
|
8328
|
-
|
|
8329
|
-
|
|
8330
|
-
|
|
8331
|
-
|
|
8332
|
-
|
|
8333
|
-
|
|
8328
|
+
z as DataTableActionsCell,
|
|
8329
|
+
E as DataTableEditCell,
|
|
8330
|
+
G as DataTableEmpty,
|
|
8331
|
+
H as DataTableFloatingBulkBar,
|
|
8332
|
+
I as DataTableLoading,
|
|
8333
|
+
J as DataTableNoResults,
|
|
8334
|
+
K as DataTableTotalizerRow,
|
|
8334
8335
|
DatePicker,
|
|
8335
8336
|
DateSeparatorChip,
|
|
8336
8337
|
EmptyState,
|
|
8337
|
-
|
|
8338
|
+
M as FLOATING_PANEL_SIZE_PX,
|
|
8338
8339
|
FileUploadField,
|
|
8339
|
-
|
|
8340
|
+
N as FilterPanel,
|
|
8340
8341
|
FilterPopover,
|
|
8341
8342
|
d as FloatingPanel,
|
|
8342
|
-
|
|
8343
|
-
|
|
8344
|
-
|
|
8345
|
-
|
|
8343
|
+
O as FloatingPanelField,
|
|
8344
|
+
Q as FloatingPanelSection,
|
|
8345
|
+
R as FooterTable,
|
|
8346
|
+
S as FooterTableSkeleton,
|
|
8346
8347
|
FormField,
|
|
8347
|
-
|
|
8348
|
+
U as FormFieldCheckbox,
|
|
8348
8349
|
F as FormFieldInput,
|
|
8349
8350
|
b as FormFieldSelect,
|
|
8350
|
-
|
|
8351
|
+
V as FormFieldSwitch,
|
|
8351
8352
|
c as FormFieldTextarea,
|
|
8352
8353
|
H2 as Header,
|
|
8353
8354
|
c2 as HeaderBreadcrumb,
|
|
@@ -8363,7 +8364,7 @@ export {
|
|
|
8363
8364
|
S3 as InputGroupInput,
|
|
8364
8365
|
T as InputGroupText,
|
|
8365
8366
|
U3 as InputGroupTextarea,
|
|
8366
|
-
|
|
8367
|
+
W as Kanban,
|
|
8367
8368
|
a10 as Kpi,
|
|
8368
8369
|
b3 as KpiDelta,
|
|
8369
8370
|
K2 as KpiGroup,
|
|
@@ -8378,7 +8379,7 @@ export {
|
|
|
8378
8379
|
MessageVariablesPicker,
|
|
8379
8380
|
Modal,
|
|
8380
8381
|
MonthYearPicker,
|
|
8381
|
-
|
|
8382
|
+
X as MoreMenu,
|
|
8382
8383
|
y2 as MoreMenuCheckboxItem,
|
|
8383
8384
|
DropdownMenuItem as MoreMenuItem,
|
|
8384
8385
|
F2 as MoreMenuLabel,
|
|
@@ -8387,14 +8388,14 @@ export {
|
|
|
8387
8388
|
DropdownMenuSeparator as MoreMenuSeparator,
|
|
8388
8389
|
P3 as PageHeader,
|
|
8389
8390
|
P as Panel,
|
|
8390
|
-
|
|
8391
|
+
Y as PanelBody,
|
|
8391
8392
|
G2 as PanelCloseAction,
|
|
8392
8393
|
H4 as PanelContent,
|
|
8393
|
-
|
|
8394
|
-
|
|
8394
|
+
Z as PanelFooter,
|
|
8395
|
+
_ as PanelHeader,
|
|
8395
8396
|
F3 as PanelRoot,
|
|
8396
8397
|
O2 as PanelTrigger,
|
|
8397
|
-
|
|
8398
|
+
$ as SELECTION_COLUMN_WIDTH,
|
|
8398
8399
|
ScreenLoader,
|
|
8399
8400
|
S2 as SidebarBrandIcon,
|
|
8400
8401
|
h as SidebarItem,
|
|
@@ -8404,37 +8405,39 @@ export {
|
|
|
8404
8405
|
l as SidebarSection,
|
|
8405
8406
|
m as SidebarSubgroup,
|
|
8406
8407
|
n as SingleMenuSidebar,
|
|
8407
|
-
|
|
8408
|
-
|
|
8408
|
+
a0 as SortPanel,
|
|
8409
|
+
a1 as SortPopover,
|
|
8409
8410
|
Spinner,
|
|
8410
|
-
|
|
8411
|
-
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8411
|
+
a2 as TABLE_HEADER_HEIGHT,
|
|
8412
|
+
a3 as Table,
|
|
8413
|
+
a4 as TableBody,
|
|
8414
|
+
a5 as TableCardRow,
|
|
8415
|
+
a6 as TableCell,
|
|
8416
|
+
a7 as TableHead,
|
|
8417
|
+
a8 as TableHeadCell,
|
|
8418
|
+
a9 as TableRow,
|
|
8418
8419
|
TableToolbar,
|
|
8419
|
-
|
|
8420
|
+
aa as TableToolbarViews,
|
|
8420
8421
|
ToastCard,
|
|
8421
8422
|
ToolbarApplied,
|
|
8422
|
-
|
|
8423
|
+
ab as ToolbarDivider,
|
|
8423
8424
|
ToolbarFilterControl,
|
|
8424
8425
|
ToolbarMobileDialog,
|
|
8425
8426
|
ToolbarMobileSection,
|
|
8426
8427
|
ToolbarMobileSheet,
|
|
8427
|
-
|
|
8428
|
+
ac as ToolbarSaveButton,
|
|
8428
8429
|
ToolbarSearch,
|
|
8429
|
-
|
|
8430
|
-
|
|
8430
|
+
ad as ToolbarSegmented,
|
|
8431
|
+
ae as ToolbarSettingsMenu,
|
|
8431
8432
|
ToolbarSimpleFilterDrawer,
|
|
8432
8433
|
ToolbarTabs,
|
|
8433
8434
|
ToolbarToolButton,
|
|
8434
8435
|
U2 as UserMenu,
|
|
8435
|
-
|
|
8436
|
+
af as ViewsPopover,
|
|
8436
8437
|
actionColumn,
|
|
8437
|
-
|
|
8438
|
+
ag as avatarGroupItem,
|
|
8439
|
+
ah as avatarGroupRoot,
|
|
8440
|
+
ai as avatarVariants,
|
|
8438
8441
|
aJ as badgeVariants,
|
|
8439
8442
|
a92 as buttonVariants,
|
|
8440
8443
|
cardCheckbox,
|
|
@@ -8451,7 +8454,7 @@ export {
|
|
|
8451
8454
|
dateSeparatorChipStyles,
|
|
8452
8455
|
emailColumn,
|
|
8453
8456
|
emptyStateStyles,
|
|
8454
|
-
|
|
8457
|
+
aj as floatingPanelStyles,
|
|
8455
8458
|
iconStyles,
|
|
8456
8459
|
icons,
|
|
8457
8460
|
a62 as inputGroupVariants,
|
|
@@ -8467,10 +8470,10 @@ export {
|
|
|
8467
8470
|
messageVariablesPickerStyles,
|
|
8468
8471
|
numberColumn,
|
|
8469
8472
|
p3 as pageHeaderStyles,
|
|
8470
|
-
|
|
8473
|
+
ak as panelContainer,
|
|
8471
8474
|
phoneColumn,
|
|
8472
8475
|
p as presetView,
|
|
8473
|
-
|
|
8476
|
+
al as savedViewsMockService,
|
|
8474
8477
|
t2 as shouldPreventNavigation,
|
|
8475
8478
|
statusColumn,
|
|
8476
8479
|
textColumn,
|
|
@@ -8478,11 +8481,11 @@ export {
|
|
|
8478
8481
|
toastVariants,
|
|
8479
8482
|
useBrand,
|
|
8480
8483
|
useChart,
|
|
8481
|
-
|
|
8482
|
-
|
|
8484
|
+
am as useColumnResize,
|
|
8485
|
+
an as useColumnWidths,
|
|
8483
8486
|
v2 as useControllable,
|
|
8484
|
-
|
|
8485
|
-
|
|
8487
|
+
ao as useDataTableContext,
|
|
8488
|
+
ap as useFloatingPanelResize,
|
|
8486
8489
|
w2 as useMediaQuery,
|
|
8487
8490
|
u2 as useTheme,
|
|
8488
8491
|
useToolbarFilterControl,
|
|
@@ -5,7 +5,7 @@ const React = require("react");
|
|
|
5
5
|
const useTheme = require("../chunks/useTheme-Dh3POjCr.cjs");
|
|
6
6
|
const lucideReact = require("lucide-react");
|
|
7
7
|
const clientesShowcaseMocks = require("../chunks/clientes-showcase-mocks-CwhluBTT.cjs");
|
|
8
|
-
const panel = require("../chunks/panel-
|
|
8
|
+
const panel = require("../chunks/panel-CTbiCa0_.cjs");
|
|
9
9
|
const avatar = require("../chunks/avatar-DAmZ7fBZ.cjs");
|
|
10
10
|
require("../chunks/input-Ci_2-5Te.cjs");
|
|
11
11
|
require("../chunks/sheet-rg6uupt1.cjs");
|
|
@@ -3,7 +3,7 @@ import { useState, useEffect, useRef, useCallback, useMemo } from "react";
|
|
|
3
3
|
import { a as ChipGroup, b as ChipGroupItem, C as Chip, u as useTheme, A as AppShell } from "../chunks/useTheme-Bk8AYqLr.mjs";
|
|
4
4
|
import { Pencil, Trash2, ChevronDown, MoreHorizontal, Plus, Download, Maximize2, Copy, Upload, RotateCcw, MessageSquare, Archive, Clock } from "lucide-react";
|
|
5
5
|
import { S as STATUSES, a as STATUS_DOT, C as CATEGORIES, b as CITIES, A as AGENTS, d as CATEGORY_KIND, f as formatBRL, e as formatShortDate, g as CLIENTS_87, K as KANBAN_COLUMNS, h as STATUS_OPTIONS, i as CATEGORY_OPTIONS, j as AGENTS_LOOKUP, k as AGENT_OPTIONS } from "../chunks/clientes-showcase-mocks-CwWGCCmf.mjs";
|
|
6
|
-
import { P as Panel, F as FormFieldInput, a as FormField, b as FormFieldSelect, c as FormFieldTextarea, d as FloatingPanel, p as presetView, D as DataTable, B as BulkActionButton, A as AlertModal } from "../chunks/panel-
|
|
6
|
+
import { P as Panel, F as FormFieldInput, a as FormField, b as FormFieldSelect, c as FormFieldTextarea, d as FloatingPanel, p as presetView, D as DataTable, B as BulkActionButton, A as AlertModal } from "../chunks/panel-DsOKm4Im.mjs";
|
|
7
7
|
import { a8 as tv, a7 as Button, A as Avatar, a as AvatarFallback } from "../chunks/avatar-FPbG1TRy.mjs";
|
|
8
8
|
import "../chunks/input-tjIT8HNE.mjs";
|
|
9
9
|
import "../chunks/sheet-DIpYkRYS.mjs";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AvatarSize, AvatarSurface } from './avatar.types';
|
|
2
|
+
/**
|
|
3
|
+
* Contexto do `AvatarGroup` — é assim que o `size` chega nos filhos.
|
|
4
|
+
*
|
|
5
|
+
* ## Por que num arquivo só dele
|
|
6
|
+
*
|
|
7
|
+
* Evita ciclo de import: o `AvatarGroup` precisa do `Avatar` (renderiza o `+N`) e o `Avatar`
|
|
8
|
+
* precisa do contexto (lê o `size`). Com o contexto dentro do `avatar-group.tsx`, os dois
|
|
9
|
+
* módulos se importariam mutuamente — funciona em ESM na maioria dos casos, mas depende da
|
|
10
|
+
* ordem de avaliação e alguns bundlers avisam. Arquivo próprio corta a dependência.
|
|
11
|
+
*
|
|
12
|
+
* ## Por que contexto e não `cloneElement`
|
|
13
|
+
*
|
|
14
|
+
* Mesmo mecanismo do `ChipGroup`, do `KpiGroup` e do `CardOptionGroup`. Clonar filhos quebra
|
|
15
|
+
* quando eles vêm de um `map`, de um fragmento ou de um wrapper — que é exatamente como uma
|
|
16
|
+
* lista de responsáveis costuma ser montada.
|
|
17
|
+
*
|
|
18
|
+
* `undefined` = sem grupo em volta, e aí o `Avatar` mantém o default dele (`md`).
|
|
19
|
+
*/
|
|
20
|
+
export declare const AvatarGroupContext: import('react').Context<{
|
|
21
|
+
size?: AvatarSize;
|
|
22
|
+
surface: AvatarSurface;
|
|
23
|
+
} | undefined>;
|
|
24
|
+
//# sourceMappingURL=avatar-group-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar-group-context.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/avatar-ig/avatar-group-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEhE;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,kBAAkB;WACpB,UAAU;aAAW,aAAa;cACjC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { AvatarGroupProps } from './avatar.types';
|
|
2
|
+
/**
|
|
3
|
+
* `AvatarGroup` — pilha de avatares sobrepostos, com `size` propagado e excedente resumido.
|
|
4
|
+
*
|
|
5
|
+
* ## Por que existe
|
|
6
|
+
*
|
|
7
|
+
* A pilha era feita na mão em cada tela (`-ml-…` + `ring` escolhidos no olho), e três coisas
|
|
8
|
+
* saíam diferentes toda vez: quanto sobrepor, qual cor de anel, e o que fazer quando são 12
|
|
9
|
+
* pessoas. As três viram decisão do componente aqui.
|
|
10
|
+
*
|
|
11
|
+
* ## As quatro decisões, e por quê
|
|
12
|
+
*
|
|
13
|
+
* **1. A sobreposição escala com o tamanho.** Não é constante: 6px num avatar de 20px é 30% de
|
|
14
|
+
* sobreposição, e no de 40px é 15% — visualmente são arranjos diferentes. O mapa em
|
|
15
|
+
* `avatar.styles.ts` mantém ~25% em toda a escala.
|
|
16
|
+
*
|
|
17
|
+
* **2. O anel é da cor da SUPERFÍCIE DE TRÁS**, e é aqui que se erra. O anel separa um avatar
|
|
18
|
+
* do outro pintando o que está atrás; com o token errado ele deixa de separar e vira um halo.
|
|
19
|
+
* Por isso `surface` é **prop**, não constante.
|
|
20
|
+
*
|
|
21
|
+
* ⚠️ `table` e `surface` resolvem pro MESMO valor hoje (medido: `oklch(1 0 0)` no claro,
|
|
22
|
+
* `oklch(0.225 0 0)` no escuro). Dentro de tabela a escolha é **semântica**, não visual —
|
|
23
|
+
* declare `table` assim mesmo, pra a pilha seguir certa se um dia divergirem. Onde a diferença
|
|
24
|
+
* é visível hoje é em `canvas`, `subtle` e `muted`.
|
|
25
|
+
*
|
|
26
|
+
* **3. O primeiro fica por cima.** O empilhamento natural do DOM põe o último por cima; aqui o
|
|
27
|
+
* z-index é decrescente, porque a leitura é da esquerda pra direita e o primeiro avatar é o
|
|
28
|
+
* principal. É a convenção de Material e Ant, e é o que faz a pilha parecer uma fila.
|
|
29
|
+
*
|
|
30
|
+
* **4. O grupo fala, os avatares calam.** Três avatares soltos fazem o leitor de tela ler três
|
|
31
|
+
* nomes sem dizer que são um conjunto. O container leva `role="group"` + `aria-label`, e o
|
|
32
|
+
* `+N` é `aria-hidden` — o número já está no rótulo do grupo.
|
|
33
|
+
*
|
|
34
|
+
* ## Gotchas
|
|
35
|
+
*
|
|
36
|
+
* - **`size` no filho vence o do grupo.** É escape hatch pro caso de um avatar destacado; sem
|
|
37
|
+
* ele, não haveria como quebrar a uniformidade quando o desenho pede.
|
|
38
|
+
* - **`total` existe pra contagem do SERVIDOR.** Sem ele o `+N` conta só o que foi renderizado
|
|
39
|
+
* — e uma lista paginada em 5 mostraria `+0` tendo 40 pessoas.
|
|
40
|
+
* - **Não use pra 2 avatares sem sobreposição.** Aí é um `flex gap-gp-sm` comum: a pilha
|
|
41
|
+
* comunica "muitos, e o conjunto importa mais que cada um".
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* <AvatarGroup size="sm" max={3} total={12} aria-label="12 responsáveis">
|
|
45
|
+
* <Avatar colorHex="#2563EB">MD</Avatar>
|
|
46
|
+
* <Avatar colorHex="#CC092F">AC</Avatar>
|
|
47
|
+
* <Avatar colorHex="#7C3AED">JS</Avatar>
|
|
48
|
+
* <Avatar colorHex="#0891B2">TK</Avatar>
|
|
49
|
+
* </AvatarGroup>
|
|
50
|
+
*/
|
|
51
|
+
export declare const AvatarGroup: import('react').ForwardRefExoticComponent<AvatarGroupProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
52
|
+
//# sourceMappingURL=avatar-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar-group.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/avatar-ig/avatar-group.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,eAAO,MAAM,WAAW,6GAwDvB,CAAC"}
|
|
@@ -15,6 +15,15 @@ import { AvatarProps } from './avatar.types';
|
|
|
15
15
|
* `className` com classe Tailwind `text-X` — ela sobrescreve a auto-pickada
|
|
16
16
|
* pela ordem de cascade.
|
|
17
17
|
*
|
|
18
|
+
* Foto (v0.53.0): passe `src` e mantenha as iniciais em `children` — elas são o
|
|
19
|
+
* **fallback** quando a URL falha. A imagem interna é `alt=""`; o nome da pessoa mora no
|
|
20
|
+
* `aria-label` do avatar, pra não ser anunciado duas vezes.
|
|
21
|
+
*
|
|
22
|
+
* ⚠️ Quando usar o `Avatar` compound do shadcn (`avatar`, com `AvatarImage`/`AvatarFallback`)
|
|
23
|
+
* em vez deste: quando o fallback não é iniciais (ícone, skeleton) ou você precisa controlar
|
|
24
|
+
* o estado de carregamento. Pra foto de pessoa dentro do DS — e sempre dentro de
|
|
25
|
+
* `AvatarGroup`, que propaga `size` por contexto — o certo é este.
|
|
26
|
+
*
|
|
18
27
|
* Accessibility:
|
|
19
28
|
* - With `aria-label` → role="img" (semantic avatar)
|
|
20
29
|
* - Without `aria-label` → aria-hidden="true" (decorative, inside a card/cell)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/avatar-ig/avatar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/avatar-ig/avatar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,MAAM,wGAqFlB,CAAC"}
|
|
@@ -71,4 +71,97 @@ export declare const avatarVariants: import('tailwind-variants').TVReturnType<{
|
|
|
71
71
|
};
|
|
72
72
|
}, undefined, string[], unknown, unknown, undefined>>;
|
|
73
73
|
export type AvatarVariantProps = VariantProps<typeof avatarVariants>;
|
|
74
|
+
/**
|
|
75
|
+
* Item da pilha do `AvatarGroup` — o wrapper que sobrepõe e desenha o anel de separação.
|
|
76
|
+
*
|
|
77
|
+
* ## Por que o anel mora AQUI e não no `Avatar`
|
|
78
|
+
*
|
|
79
|
+
* `ring` acompanha o `border-radius` do elemento em que está. Num wrapper quadrado ele
|
|
80
|
+
* traçaria um quadrado em volta do círculo — daí o `rounded-radius-full` no próprio wrapper.
|
|
81
|
+
* E ficar no wrapper (e não no `Avatar`) mantém o `Avatar` solto sem anel nenhum: o anel só
|
|
82
|
+
* existe porque há sobreposição.
|
|
83
|
+
*
|
|
84
|
+
* ## A sobreposição escala com o tamanho
|
|
85
|
+
*
|
|
86
|
+
* Não é constante: 6px num avatar de 20px é **30%** de sobreposição, e no de 40px é **15%** —
|
|
87
|
+
* visualmente são arranjos diferentes. O mapa abaixo mantém ~25% em toda a escala, e cada
|
|
88
|
+
* valor é token de spacing (`sp-*`), não px na unha.
|
|
89
|
+
*
|
|
90
|
+
* ## O `surface` existe porque o anel é da cor do que está ATRÁS
|
|
91
|
+
*
|
|
92
|
+
* `ring-bg-surface` num painel funciona; na linha de uma tabela (`bg-bg-table`) apareceria um
|
|
93
|
+
* halo claro em volta de cada avatar. Quem sabe o que está atrás é quem compõe — daí ser prop.
|
|
94
|
+
*/
|
|
95
|
+
/**
|
|
96
|
+
* Container da pilha. É um `tv()` de uma linha só de propósito: sem ele o `className` do
|
|
97
|
+
* consumidor entraria por concatenação crua, e `items-start` não venceria o `items-center`
|
|
98
|
+
* daqui (é o `twMerge` embutido no `tv` que resolve conflito de classe). Também mantém o
|
|
99
|
+
* `avatar-ig` dependendo só de `@igreen/tv` — usar o `cn` de `@/lib/utils` acrescentaria uma
|
|
100
|
+
* `registryDependency` ao item por causa de duas classes.
|
|
101
|
+
*/
|
|
102
|
+
export declare const avatarGroupRoot: import('tailwind-variants').TVReturnType<{} | {} | {}, undefined, "flex items-center", {} | {}, undefined, import('tailwind-variants').TVReturnType<unknown, undefined, "flex items-center", unknown, unknown, undefined>>;
|
|
103
|
+
export declare const avatarGroupItem: import('tailwind-variants').TVReturnType<{
|
|
104
|
+
/** Deslocamento negativo ≈ 25% do diâmetro, em token. Ver o bloco acima. */
|
|
105
|
+
size: {
|
|
106
|
+
xs: string;
|
|
107
|
+
sm: string;
|
|
108
|
+
md: string;
|
|
109
|
+
lg: string;
|
|
110
|
+
xl: string;
|
|
111
|
+
};
|
|
112
|
+
/** Cor do anel = superfície de trás. */
|
|
113
|
+
surface: {
|
|
114
|
+
surface: string;
|
|
115
|
+
canvas: string;
|
|
116
|
+
subtle: string;
|
|
117
|
+
muted: string;
|
|
118
|
+
table: string;
|
|
119
|
+
};
|
|
120
|
+
/** O primeiro não desloca — senão a pilha inteira sai da margem esquerda. */
|
|
121
|
+
primeiro: {
|
|
122
|
+
true: string;
|
|
123
|
+
};
|
|
124
|
+
}, undefined, string[], {
|
|
125
|
+
/** Deslocamento negativo ≈ 25% do diâmetro, em token. Ver o bloco acima. */
|
|
126
|
+
size: {
|
|
127
|
+
xs: string;
|
|
128
|
+
sm: string;
|
|
129
|
+
md: string;
|
|
130
|
+
lg: string;
|
|
131
|
+
xl: string;
|
|
132
|
+
};
|
|
133
|
+
/** Cor do anel = superfície de trás. */
|
|
134
|
+
surface: {
|
|
135
|
+
surface: string;
|
|
136
|
+
canvas: string;
|
|
137
|
+
subtle: string;
|
|
138
|
+
muted: string;
|
|
139
|
+
table: string;
|
|
140
|
+
};
|
|
141
|
+
/** O primeiro não desloca — senão a pilha inteira sai da margem esquerda. */
|
|
142
|
+
primeiro: {
|
|
143
|
+
true: string;
|
|
144
|
+
};
|
|
145
|
+
}, undefined, import('tailwind-variants').TVReturnType<{
|
|
146
|
+
/** Deslocamento negativo ≈ 25% do diâmetro, em token. Ver o bloco acima. */
|
|
147
|
+
size: {
|
|
148
|
+
xs: string;
|
|
149
|
+
sm: string;
|
|
150
|
+
md: string;
|
|
151
|
+
lg: string;
|
|
152
|
+
xl: string;
|
|
153
|
+
};
|
|
154
|
+
/** Cor do anel = superfície de trás. */
|
|
155
|
+
surface: {
|
|
156
|
+
surface: string;
|
|
157
|
+
canvas: string;
|
|
158
|
+
subtle: string;
|
|
159
|
+
muted: string;
|
|
160
|
+
table: string;
|
|
161
|
+
};
|
|
162
|
+
/** O primeiro não desloca — senão a pilha inteira sai da margem esquerda. */
|
|
163
|
+
primeiro: {
|
|
164
|
+
true: string;
|
|
165
|
+
};
|
|
166
|
+
}, undefined, string[], unknown, unknown, undefined>>;
|
|
74
167
|
//# sourceMappingURL=avatar.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/avatar-ig/avatar.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;QA2BrB,8DAA8D;;;;;;;;;;;;;;;;;;QAA9D,8DAA8D;;;;;;;;;;;;;;;;;;QAA9D,8DAA8D;;;qDASlE,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"avatar.styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/avatar-ig/avatar.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;QA2BrB,8DAA8D;;;;;;;;;;;;;;;;;;QAA9D,8DAA8D;;;;;;;;;;;;;;;;;;QAA9D,8DAA8D;;;qDASlE,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,4NAAoC,CAAC;AAEjE,eAAO,MAAM,eAAe;IAIxB,4EAA4E;;;;;;;;IAS5E,wCAAwC;;;;;;;;IASxC,6EAA6E;;;;;IAlB7E,4EAA4E;;;;;;;;IAS5E,wCAAwC;;;;;;;;IASxC,6EAA6E;;;;;IAlB7E,4EAA4E;;;;;;;;IAS5E,wCAAwC;;;;;;;;IASxC,6EAA6E;;;;qDAQ/E,CAAC"}
|
|
@@ -12,5 +12,42 @@ export interface AvatarProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
|
|
|
12
12
|
* Takes precedence over `color`.
|
|
13
13
|
*/
|
|
14
14
|
colorHex?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Foto da pessoa. Quando carrega, cobre o círculo inteiro; quando **falha**, o avatar
|
|
17
|
+
* volta pras iniciais (`children`) com a cor de sempre — por isso continue passando as
|
|
18
|
+
* iniciais mesmo com `src`.
|
|
19
|
+
*
|
|
20
|
+
* Não há prop `alt`: o nome mora no `aria-label` do avatar (a imagem interna é
|
|
21
|
+
* `alt=""`). Dois rótulos no mesmo elemento fariam o leitor de tela anunciar a pessoa
|
|
22
|
+
* duas vezes.
|
|
23
|
+
*/
|
|
24
|
+
src?: string;
|
|
25
|
+
}
|
|
26
|
+
/** Tamanhos do avatar — reusado pelo grupo, que os propaga por contexto. */
|
|
27
|
+
export type AvatarSize = NonNullable<AvatarVariantProps["size"]>;
|
|
28
|
+
/**
|
|
29
|
+
* Superfície ATRÁS do grupo — define a cor do anel que separa um avatar do outro.
|
|
30
|
+
* Errar aqui é o defeito clássico da pilha: anel `surface` numa linha de tabela vira halo.
|
|
31
|
+
*/
|
|
32
|
+
export type AvatarSurface = "surface" | "canvas" | "subtle" | "muted" | "table";
|
|
33
|
+
export interface AvatarGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "color"> {
|
|
34
|
+
/**
|
|
35
|
+
* Tamanho de TODOS os avatares do grupo, propagado por contexto.
|
|
36
|
+
* `size` no filho vence — escape hatch pro caso de um destacado.
|
|
37
|
+
* @default "md"
|
|
38
|
+
*/
|
|
39
|
+
size?: AvatarSize;
|
|
40
|
+
/** Acima disso, corta e mostra `+N` no fim. Sem `max`, mostra todos. */
|
|
41
|
+
max?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Contagem REAL, quando ela não é o número de filhos renderizados.
|
|
44
|
+
* Sem isso, uma lista paginada em 5 mostraria `+0` tendo 40 pessoas.
|
|
45
|
+
*/
|
|
46
|
+
total?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Superfície atrás do grupo — cor do anel de separação.
|
|
49
|
+
* @default "surface"
|
|
50
|
+
*/
|
|
51
|
+
surface?: AvatarSurface;
|
|
15
52
|
}
|
|
16
53
|
//# sourceMappingURL=avatar.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/avatar-ig/avatar.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,EACzD,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAC;IACnC;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;IAExE;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"avatar.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/avatar-ig/avatar.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,EACzD,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAC;IACnC;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;IAExE;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;;;;OAQG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,4EAA4E;AAC5E,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;AAEjE;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;AAEhF,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAC3D;;;;OAIG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB,wEAAwE;IACxE,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { Avatar } from './avatar';
|
|
2
|
-
export {
|
|
3
|
-
export type
|
|
2
|
+
export { AvatarGroup } from './avatar-group';
|
|
3
|
+
export { avatarVariants, avatarGroupRoot, avatarGroupItem, type AvatarVariantProps, } from './avatar.styles';
|
|
4
|
+
export type { AvatarProps, AvatarGroupProps, AvatarSize, AvatarSurface, } from './avatar.types';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/avatar-ig/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/avatar-ig/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,cAAc,EACd,eAAe,EACf,eAAe,EACf,KAAK,kBAAkB,GACxB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,aAAa,GACd,MAAM,gBAAgB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snksergio/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.0",
|
|
4
4
|
"//distribuicao": "Canal PRIMARIO = registry shadcn (copy-in) + CLI @snksergio/create-design-system; sobe sozinho no merge (Vercel). Canal SECUNDARIO = este pacote npm (@snksergio/design-system), publicado por passo MANUAL do mantenedor, entao costuma ficar atras do registry. SECUNDARIO descreve a ORDEM DE PUBLICACAO, nao o nivel de suporte: NAO e depreciado, e desde a 0.37.0 entrega 41 dos 42 componentes ui/ no barrel raiz + os 41 primitivos shadcn no subpath ./shadcn (so TabelaTeste, demo interno, fica de fora). Publish so pelo Passo 7 do .claude/skills/ds-dev/release.md (valida com `npm run lib:verify`, pede o token, publica, revoga). Ver DISTRIBUICAO.md.",
|
|
5
5
|
"description": "iGreen Design System — internal library for SaaS CRM, admin panels and dashboards. React 19 + Tailwind v4 + Shadcn + Radix.",
|
|
6
6
|
"license": "UNLICENSED",
|