@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
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
5
|
-
import {
|
|
5
|
+
import { createContext, forwardRef, useContext, useState, Children, isValidElement, useId, useRef, useCallback, useEffect, useMemo, Fragment as Fragment$1, useImperativeHandle, memo } from "react";
|
|
6
6
|
import { A as AlertDialog, c as AlertDialogContent, f as AlertDialogHeader, i as AlertDialogTitle, d as AlertDialogDescription, e as AlertDialogFooter, b as AlertDialogCancel, a as AlertDialogAction, T as Textarea, S as Select, D as SelectTrigger, E as SelectValue, u as SelectContent, w as SelectItem, l as Checkbox, Q as Switch, C as Calendar$1, R as getPaginationRange, P as Pagination, o as PaginationFirst, t as PaginationPrevious, m as PaginationContent, p as PaginationItem, n as PaginationEllipsis, r as PaginationLink, s as PaginationNext, q as PaginationLast, N as SheetTitle, I as SheetDescription, G as SheetClose, F as Sheet, O as SheetTrigger, L as SheetOverlay } from "./sheet-DIpYkRYS.mjs";
|
|
7
7
|
import { useSensors, useSensor, PointerSensor, KeyboardSensor, DndContext, closestCorners, DragOverlay, useDroppable, useDraggable, closestCenter } from "@dnd-kit/core";
|
|
8
8
|
import { useSortable, sortableKeyboardCoordinates, SortableContext, horizontalListSortingStrategy, arrayMove } from "@dnd-kit/sortable";
|
|
@@ -158,6 +158,7 @@ function getContrastTextColor(bgColor) {
|
|
|
158
158
|
const blackContrast = contrastRatio(0, bgLum);
|
|
159
159
|
return whiteContrast >= blackContrast ? "white" : "black";
|
|
160
160
|
}
|
|
161
|
+
const AvatarGroupContext = createContext(void 0);
|
|
161
162
|
const avatarVariants = tv({
|
|
162
163
|
base: [
|
|
163
164
|
"inline-flex items-center justify-center",
|
|
@@ -197,21 +198,59 @@ const avatarVariants = tv({
|
|
|
197
198
|
color: "muted"
|
|
198
199
|
}
|
|
199
200
|
});
|
|
201
|
+
const avatarGroupRoot = tv({ base: "flex items-center" });
|
|
202
|
+
const avatarGroupItem = tv({
|
|
203
|
+
base: ["relative inline-flex rounded-radius-full ring-2"],
|
|
204
|
+
variants: {
|
|
205
|
+
/** Deslocamento negativo ≈ 25% do diâmetro, em token. Ver o bloco acima. */
|
|
206
|
+
size: {
|
|
207
|
+
xs: "-ml-sp-xs",
|
|
208
|
+
// 20px → 4
|
|
209
|
+
sm: "-ml-sp-sm",
|
|
210
|
+
// 24px → 6
|
|
211
|
+
md: "-ml-sp-sm",
|
|
212
|
+
// 28px → 6
|
|
213
|
+
lg: "-ml-sp-md",
|
|
214
|
+
// 32px → 8
|
|
215
|
+
xl: "-ml-sp-lg"
|
|
216
|
+
// 40px → 10
|
|
217
|
+
},
|
|
218
|
+
/** Cor do anel = superfície de trás. */
|
|
219
|
+
surface: {
|
|
220
|
+
surface: "ring-bg-surface",
|
|
221
|
+
canvas: "ring-bg-canvas",
|
|
222
|
+
subtle: "ring-bg-subtle",
|
|
223
|
+
muted: "ring-bg-muted",
|
|
224
|
+
table: "ring-bg-table"
|
|
225
|
+
},
|
|
226
|
+
/** O primeiro não desloca — senão a pilha inteira sai da margem esquerda. */
|
|
227
|
+
primeiro: { true: "ml-0" }
|
|
228
|
+
},
|
|
229
|
+
defaultVariants: {
|
|
230
|
+
size: "md",
|
|
231
|
+
surface: "surface"
|
|
232
|
+
}
|
|
233
|
+
});
|
|
200
234
|
const Avatar = forwardRef(
|
|
201
235
|
function Avatar2({
|
|
202
236
|
size,
|
|
203
237
|
color,
|
|
204
238
|
colorHex,
|
|
239
|
+
src,
|
|
205
240
|
children,
|
|
206
241
|
className,
|
|
207
242
|
style,
|
|
208
243
|
"aria-label": ariaLabel,
|
|
209
244
|
...rest
|
|
210
245
|
}, ref) {
|
|
246
|
+
const grupo = useContext(AvatarGroupContext);
|
|
247
|
+
const sizeEfetivo = size ?? grupo?.size;
|
|
248
|
+
const [urlQueFalhou, setUrlQueFalhou] = useState(null);
|
|
249
|
+
const mostraFoto = typeof src === "string" && src !== "" && urlQueFalhou !== src;
|
|
211
250
|
const isHex = typeof colorHex === "string" && colorHex.startsWith("#");
|
|
212
251
|
const autoTextClass = isHex ? getContrastTextColor(colorHex) === "black" ? "text-black" : "text-white" : null;
|
|
213
252
|
const computedClassName = avatarVariants({
|
|
214
|
-
size,
|
|
253
|
+
size: sizeEfetivo,
|
|
215
254
|
color: isHex ? "_custom" : color,
|
|
216
255
|
className: isHex ? [autoTextClass, className].filter(Boolean).join(" ") : className
|
|
217
256
|
});
|
|
@@ -224,12 +263,72 @@ const Avatar = forwardRef(
|
|
|
224
263
|
style: computedStyle,
|
|
225
264
|
...ariaLabel ? { role: "img", "aria-label": ariaLabel } : { "aria-hidden": true },
|
|
226
265
|
...rest,
|
|
227
|
-
children
|
|
266
|
+
children: mostraFoto ? /* @__PURE__ */ jsx(
|
|
267
|
+
"img",
|
|
268
|
+
{
|
|
269
|
+
src,
|
|
270
|
+
alt: "",
|
|
271
|
+
className: "size-full object-cover",
|
|
272
|
+
draggable: false,
|
|
273
|
+
onError: () => setUrlQueFalhou(src ?? null)
|
|
274
|
+
}
|
|
275
|
+
) : children
|
|
228
276
|
}
|
|
229
277
|
);
|
|
230
278
|
}
|
|
231
279
|
);
|
|
232
280
|
Avatar.displayName = "Avatar";
|
|
281
|
+
const AvatarGroup = forwardRef(
|
|
282
|
+
function AvatarGroup2({
|
|
283
|
+
size = "md",
|
|
284
|
+
max,
|
|
285
|
+
total,
|
|
286
|
+
surface = "surface",
|
|
287
|
+
children,
|
|
288
|
+
className,
|
|
289
|
+
"aria-label": ariaLabel,
|
|
290
|
+
...rest
|
|
291
|
+
}, ref) {
|
|
292
|
+
const itens = Children.toArray(children).filter(isValidElement);
|
|
293
|
+
const visiveis = typeof max === "number" ? itens.slice(0, max) : itens;
|
|
294
|
+
const escondidos = (total ?? itens.length) - visiveis.length;
|
|
295
|
+
return /* @__PURE__ */ jsx(AvatarGroupContext.Provider, { value: { size, surface }, children: /* @__PURE__ */ jsxs(
|
|
296
|
+
"div",
|
|
297
|
+
{
|
|
298
|
+
ref,
|
|
299
|
+
className: avatarGroupRoot({ className }),
|
|
300
|
+
role: "group",
|
|
301
|
+
"aria-label": ariaLabel,
|
|
302
|
+
...rest,
|
|
303
|
+
children: [
|
|
304
|
+
visiveis.map((filho, i) => /* @__PURE__ */ jsx(
|
|
305
|
+
"span",
|
|
306
|
+
{
|
|
307
|
+
className: avatarGroupItem({ size, surface, primeiro: i === 0 }),
|
|
308
|
+
style: { zIndex: visiveis.length - i },
|
|
309
|
+
children: filho
|
|
310
|
+
},
|
|
311
|
+
i
|
|
312
|
+
)),
|
|
313
|
+
escondidos > 0 && /* O `+N` é `aria-hidden`: a contagem real já está no `aria-label` do grupo, e
|
|
314
|
+
anunciar "mais 9" solto não diz de quê. */
|
|
315
|
+
/* @__PURE__ */ jsx(
|
|
316
|
+
"span",
|
|
317
|
+
{
|
|
318
|
+
className: avatarGroupItem({ size, surface, primeiro: false }),
|
|
319
|
+
style: { zIndex: 0 },
|
|
320
|
+
children: /* @__PURE__ */ jsxs(Avatar, { size, color: "muted", "aria-hidden": true, children: [
|
|
321
|
+
"+",
|
|
322
|
+
escondidos
|
|
323
|
+
] })
|
|
324
|
+
}
|
|
325
|
+
)
|
|
326
|
+
]
|
|
327
|
+
}
|
|
328
|
+
) });
|
|
329
|
+
}
|
|
330
|
+
);
|
|
331
|
+
AvatarGroup.displayName = "AvatarGroup";
|
|
233
332
|
const buttonGroupVariants = tv({
|
|
234
333
|
base: [
|
|
235
334
|
"inline-flex items-stretch",
|
|
@@ -12987,58 +13086,61 @@ function Panel({
|
|
|
12987
13086
|
] });
|
|
12988
13087
|
}
|
|
12989
13088
|
export {
|
|
12990
|
-
|
|
13089
|
+
SELECTION_COLUMN_WIDTH as $,
|
|
12991
13090
|
AlertModal as A,
|
|
12992
13091
|
BulkActionButton as B,
|
|
12993
13092
|
ColsPanel as C,
|
|
12994
13093
|
DataTable as D,
|
|
12995
|
-
|
|
13094
|
+
DataTableEditCell as E,
|
|
12996
13095
|
FormFieldInput as F,
|
|
12997
|
-
|
|
12998
|
-
|
|
12999
|
-
|
|
13000
|
-
|
|
13001
|
-
|
|
13096
|
+
DataTableEmpty as G,
|
|
13097
|
+
DataTableFloatingBulkBar as H,
|
|
13098
|
+
DataTableLoading as I,
|
|
13099
|
+
DataTableNoResults as J,
|
|
13100
|
+
DataTableTotalizerRow as K,
|
|
13002
13101
|
ListItem as L,
|
|
13003
|
-
|
|
13004
|
-
|
|
13005
|
-
|
|
13102
|
+
FLOATING_PANEL_SIZE_PX as M,
|
|
13103
|
+
FilterPanel as N,
|
|
13104
|
+
FloatingPanelField as O,
|
|
13006
13105
|
Panel as P,
|
|
13007
|
-
|
|
13008
|
-
|
|
13009
|
-
|
|
13106
|
+
FloatingPanelSection as Q,
|
|
13107
|
+
FooterTable as R,
|
|
13108
|
+
FooterTableSkeleton as S,
|
|
13010
13109
|
ToolbarToolButton as T,
|
|
13011
|
-
|
|
13012
|
-
|
|
13013
|
-
|
|
13014
|
-
|
|
13015
|
-
|
|
13016
|
-
|
|
13017
|
-
|
|
13110
|
+
FormFieldCheckbox as U,
|
|
13111
|
+
FormFieldSwitch as V,
|
|
13112
|
+
Kanban as W,
|
|
13113
|
+
MoreMenu as X,
|
|
13114
|
+
PanelBody as Y,
|
|
13115
|
+
PanelFooter as Z,
|
|
13116
|
+
PanelHeader as _,
|
|
13018
13117
|
FormField as a,
|
|
13019
|
-
|
|
13020
|
-
|
|
13021
|
-
|
|
13022
|
-
|
|
13023
|
-
|
|
13024
|
-
|
|
13025
|
-
|
|
13026
|
-
|
|
13027
|
-
|
|
13028
|
-
|
|
13029
|
-
|
|
13030
|
-
|
|
13031
|
-
|
|
13032
|
-
|
|
13033
|
-
|
|
13034
|
-
|
|
13035
|
-
|
|
13036
|
-
|
|
13037
|
-
|
|
13038
|
-
|
|
13039
|
-
|
|
13040
|
-
|
|
13041
|
-
|
|
13118
|
+
SortPanel as a0,
|
|
13119
|
+
SortPopover as a1,
|
|
13120
|
+
TABLE_HEADER_HEIGHT as a2,
|
|
13121
|
+
Table as a3,
|
|
13122
|
+
TableBody as a4,
|
|
13123
|
+
TableCardRow as a5,
|
|
13124
|
+
TableCell as a6,
|
|
13125
|
+
TableHead as a7,
|
|
13126
|
+
TableHeadCell as a8,
|
|
13127
|
+
TableRow as a9,
|
|
13128
|
+
TableToolbarViews as aa,
|
|
13129
|
+
ToolbarDivider as ab,
|
|
13130
|
+
ToolbarSaveButton as ac,
|
|
13131
|
+
ToolbarSegmented as ad,
|
|
13132
|
+
ToolbarSettingsMenu as ae,
|
|
13133
|
+
ViewsPopover as af,
|
|
13134
|
+
avatarGroupItem as ag,
|
|
13135
|
+
avatarGroupRoot as ah,
|
|
13136
|
+
avatarVariants as ai,
|
|
13137
|
+
floatingPanelStyles as aj,
|
|
13138
|
+
panelContainer as ak,
|
|
13139
|
+
savedViewsMockService as al,
|
|
13140
|
+
useColumnResize as am,
|
|
13141
|
+
useColumnWidths as an,
|
|
13142
|
+
useDataTableContext as ao,
|
|
13143
|
+
useFloatingPanelResize as ap,
|
|
13042
13144
|
FormFieldSelect as b,
|
|
13043
13145
|
FormFieldTextarea as c,
|
|
13044
13146
|
FloatingPanel as d,
|
|
@@ -13058,11 +13160,11 @@ export {
|
|
|
13058
13160
|
columnTypeRegistry as r,
|
|
13059
13161
|
List as s,
|
|
13060
13162
|
AddViewModal as t,
|
|
13061
|
-
|
|
13062
|
-
|
|
13063
|
-
|
|
13064
|
-
|
|
13065
|
-
|
|
13066
|
-
|
|
13163
|
+
AvatarGroup as u,
|
|
13164
|
+
BulkActionsBar as v,
|
|
13165
|
+
ColsPopover as w,
|
|
13166
|
+
Combobox as x,
|
|
13167
|
+
DEFAULT_FILTER_OPERATORS as y,
|
|
13168
|
+
DataTableActionsCell as z
|
|
13067
13169
|
};
|
|
13068
|
-
//# sourceMappingURL=panel-
|
|
13170
|
+
//# sourceMappingURL=panel-DsOKm4Im.mjs.map
|