@snksergio/design-system 0.32.1 → 0.34.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/{input-BjUSWce3.cjs → input-CizzMZ20.cjs} +3 -3
- package/dist-lib/chunks/{input-BjUSWce3.cjs.map → input-CizzMZ20.cjs.map} +1 -1
- package/dist-lib/chunks/{input-DCDU4i4S.mjs → input-Cym0k4ZI.mjs} +2 -2
- package/dist-lib/chunks/{input-DCDU4i4S.mjs.map → input-Cym0k4ZI.mjs.map} +1 -1
- package/dist-lib/chunks/{kpi-delta-C_3V6uG6.cjs → kpi-delta-DrSJPMCY.cjs} +8 -8
- package/dist-lib/chunks/{kpi-delta-C_3V6uG6.cjs.map → kpi-delta-DrSJPMCY.cjs.map} +1 -1
- package/dist-lib/chunks/{kpi-delta-DpYuDY4h.mjs → kpi-delta-FhfuIg27.mjs} +2 -2
- package/dist-lib/chunks/{kpi-delta-DpYuDY4h.mjs.map → kpi-delta-FhfuIg27.mjs.map} +1 -1
- package/dist-lib/chunks/{page-header-D0rpU0yn.cjs → page-header-BMzUloFi.cjs} +4 -4
- package/dist-lib/chunks/{page-header-D0rpU0yn.cjs.map → page-header-BMzUloFi.cjs.map} +1 -1
- package/dist-lib/chunks/{page-header-B6XJyIMz.mjs → page-header-Buh6YlQM.mjs} +2 -2
- package/dist-lib/chunks/{page-header-B6XJyIMz.mjs.map → page-header-Buh6YlQM.mjs.map} +1 -1
- package/dist-lib/chunks/{panel-8FiBxwcI.mjs → panel-Cdl0GPVE.mjs} +3 -3
- package/dist-lib/chunks/{panel-8FiBxwcI.mjs.map → panel-Cdl0GPVE.mjs.map} +1 -1
- package/dist-lib/chunks/{panel-BOrETqXz.cjs → panel-DlyaLunw.cjs} +401 -401
- package/dist-lib/chunks/{panel-BOrETqXz.cjs.map → panel-DlyaLunw.cjs.map} +1 -1
- package/dist-lib/chunks/{app-shell-Cyh8AUJT.cjs → useTheme-D4alxxGV.cjs} +70 -4
- package/dist-lib/chunks/useTheme-D4alxxGV.cjs.map +1 -0
- package/dist-lib/chunks/{app-shell-78w0pYdP.mjs → useTheme-DF2xbSdI.mjs} +107 -41
- package/dist-lib/chunks/useTheme-DF2xbSdI.mjs.map +1 -0
- package/dist-lib/index.cjs +224 -154
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.mjs +110 -40
- package/dist-lib/index.mjs.map +1 -1
- package/dist-lib/preview/chat.cjs +54 -55
- package/dist-lib/preview/chat.cjs.map +1 -1
- package/dist-lib/preview/chat.mjs +2 -3
- package/dist-lib/preview/chat.mjs.map +1 -1
- package/dist-lib/preview/clientes.cjs +28 -29
- package/dist-lib/preview/clientes.cjs.map +1 -1
- package/dist-lib/preview/clientes.mjs +4 -5
- package/dist-lib/preview/clientes.mjs.map +1 -1
- package/dist-lib/preview/dashboard.cjs +24 -25
- package/dist-lib/preview/dashboard.cjs.map +1 -1
- package/dist-lib/preview/dashboard.mjs +3 -4
- package/dist-lib/preview/dashboard.mjs.map +1 -1
- package/dist-lib/src/components/index.d.ts +4 -0
- package/dist-lib/src/components/index.d.ts.map +1 -1
- package/dist-lib/src/components/ui/AppShell/app-shell.d.ts +3 -2
- package/dist-lib/src/components/ui/AppShell/app-shell.d.ts.map +1 -1
- package/dist-lib/src/components/ui/AppShell/app-shell.styles.d.ts +21 -4
- package/dist-lib/src/components/ui/AppShell/app-shell.styles.d.ts.map +1 -1
- package/dist-lib/src/components/ui/AppShell/app-shell.types.d.ts +13 -3
- package/dist-lib/src/components/ui/AppShell/app-shell.types.d.ts.map +1 -1
- package/dist-lib/src/hooks/useBrand.d.ts +49 -16
- package/dist-lib/src/hooks/useBrand.d.ts.map +1 -1
- package/dist-lib/theme/brand-blue.css +6 -3
- package/dist-lib/theme/brand-green.css +6 -3
- package/dist-lib/theme/brand-pay.css +6 -3
- package/dist-lib/theme/brand-vibrant.css +6 -3
- package/dist-lib/theme.css +5 -2
- package/package.json +4 -2
- package/dist-lib/chunks/app-shell-78w0pYdP.mjs.map +0 -1
- package/dist-lib/chunks/app-shell-Cyh8AUJT.cjs.map +0 -1
- package/dist-lib/chunks/useTheme-BUPLZBMs.mjs +0 -66
- package/dist-lib/chunks/useTheme-BUPLZBMs.mjs.map +0 -1
- package/dist-lib/chunks/useTheme-Dee4mo-A.cjs +0 -65
- package/dist-lib/chunks/useTheme-Dee4mo-A.cjs.map +0 -1
package/dist-lib/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { C as Checkbox, 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 ACTIONS_COLUMN_WIDTH, l as Calendar, m as Textarea } from "./chunks/panel-
|
|
2
|
-
import { n, A, B, o, q, r, s, t, D, u, v, w, x, y, z, E, G, H, d, I, J, K, L, M, F, b, N, c, O, Q, P, R, S, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, p, am, an, ao, ap, aq } from "./chunks/panel-
|
|
3
|
-
import { t as tv, c as cn, P as Popover, j as PopoverTrigger, k as PopoverContent, B as Button, l as Dialog, m as DialogTrigger, n as DialogContent, o as DialogTitle, C as Chip, p as PopoverAnchor, q as DialogClose, r as DialogDescription, D as DropdownMenu, f as DropdownMenuTrigger, g as DropdownMenuContent, h as DropdownMenuItem, s as CommandDialog,
|
|
4
|
-
import { A as A2, d as d2, e, H as H2,
|
|
1
|
+
import { C as Checkbox, 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 ACTIONS_COLUMN_WIDTH, l as Calendar, m as Textarea } from "./chunks/panel-Cdl0GPVE.mjs";
|
|
2
|
+
import { n, A, B, o, q, r, s, t, D, u, v, w, x, y, z, E, G, H, d, I, J, K, L, M, F, b, N, c, O, Q, P, R, S, U, V, W, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, p, am, an, ao, ap, aq } from "./chunks/panel-Cdl0GPVE.mjs";
|
|
3
|
+
import { t as tv, c as cn, P as Popover, j as PopoverTrigger, k as PopoverContent, B as Button, l as Dialog, m as DialogTrigger, n as DialogContent, o as DialogTitle, C as Chip, p as PopoverAnchor, q as DialogClose, r as DialogDescription, D as DropdownMenu, f as DropdownMenuTrigger, g as DropdownMenuContent, h as DropdownMenuItem, s as CommandDialog, v as CommandInput, w as CommandList, x as CommandEmpty, y as CommandGroup, z as CommandItem, E as DropdownMenuGroup, F as DropdownMenuLabel, i as DropdownMenuSeparator } from "./chunks/useTheme-DF2xbSdI.mjs";
|
|
4
|
+
import { A as A2, d as d2, e, H as H2, G as G2, I as I2, J as J2, K as K2, L as L2, M as M2, N as N2, O as O2, Q as Q2, R as R2, S as S2, T, U as U2, V as V2, W as W2, X as X2, Y as Y2, Z as Z2, _ as _2, $ as $2, a0 as a02, a1 as a12, a2 as a22, a3 as a32, a4 as a42, a5 as a52, a6 as a62, a7 as a72, a8 as a82, u as u2 } from "./chunks/useTheme-DF2xbSdI.mjs";
|
|
5
5
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import { forwardRef, useId, useState, Fragment as Fragment$1, isValidElement, useCallback, useMemo, createElement, useRef, useEffect, useLayoutEffect, createContext, useContext } from "react";
|
|
8
8
|
import { Check, MoreHorizontal, SlidersHorizontal, Calendar as Calendar$1, AlertCircle, CheckCheck, Clock, MoreVertical, Ban, X as X3, CalendarDays, ChevronDown, ChevronLeft, ChevronRight, PanelLeftClose, ChevronsUpDown, Search, User } from "lucide-react";
|
|
9
9
|
import { Reply } from "lucide-react";
|
|
10
10
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
11
|
-
import { I as Input } from "./chunks/input-
|
|
12
|
-
import { i } from "./chunks/input-
|
|
13
|
-
import { a, b as b2, K as K3 } from "./chunks/kpi-delta-
|
|
14
|
-
import { P as P2, p as p2 } from "./chunks/page-header-
|
|
11
|
+
import { I as Input } from "./chunks/input-Cym0k4ZI.mjs";
|
|
12
|
+
import { i } from "./chunks/input-Cym0k4ZI.mjs";
|
|
13
|
+
import { a, b as b2, K as K3 } from "./chunks/kpi-delta-FhfuIg27.mjs";
|
|
14
|
+
import { P as P2, p as p2 } from "./chunks/page-header-Buh6YlQM.mjs";
|
|
15
15
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
16
16
|
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
17
17
|
const cardCheckbox = tv({
|
|
@@ -6431,9 +6431,9 @@ function clipCircle(radius) {
|
|
|
6431
6431
|
if (!determinant) return !two && a10;
|
|
6432
6432
|
var c1 = cr * n2n2 / determinant, c2 = -cr * n1n2 / determinant, n1xn2 = cartesianCross(n1, n2), A3 = cartesianScale(n1, c1), B2 = cartesianScale(n2, c2);
|
|
6433
6433
|
cartesianAddInPlace(A3, B2);
|
|
6434
|
-
var
|
|
6434
|
+
var u3 = n1xn2, w2 = cartesianDot(A3, u3), uu = cartesianDot(u3, u3), t2 = w2 * w2 - uu * (cartesianDot(A3, A3) - 1);
|
|
6435
6435
|
if (t2 < 0) return;
|
|
6436
|
-
var t3 = sqrt(t2), q2 = cartesianScale(
|
|
6436
|
+
var t3 = sqrt(t2), q2 = cartesianScale(u3, (-w2 - t3) / uu);
|
|
6437
6437
|
cartesianAddInPlace(q2, A3);
|
|
6438
6438
|
q2 = spherical(q2);
|
|
6439
6439
|
if (!two) return q2;
|
|
@@ -6442,7 +6442,7 @@ function clipCircle(radius) {
|
|
|
6442
6442
|
var delta2 = lambda1 - lambda0, polar = abs(delta2 - pi) < epsilon, meridian = polar || delta2 < epsilon;
|
|
6443
6443
|
if (!polar && phi1 < phi0) z2 = phi0, phi0 = phi1, phi1 = z2;
|
|
6444
6444
|
if (meridian ? polar ? phi0 + phi1 > 0 ^ q2[1] < (abs(q2[0] - lambda0) < epsilon ? phi0 : phi1) : phi0 <= q2[1] && q2[1] <= phi1 : delta2 > pi ^ (lambda0 <= q2[0] && q2[0] <= lambda1)) {
|
|
6445
|
-
var q1 = cartesianScale(
|
|
6445
|
+
var q1 = cartesianScale(u3, (-w2 + t3) / uu);
|
|
6446
6446
|
cartesianAddInPlace(q1, A3);
|
|
6447
6447
|
return [q2, spherical(q1)];
|
|
6448
6448
|
}
|
|
@@ -7514,11 +7514,79 @@ const ChoroplethMap = forwardRef(
|
|
|
7514
7514
|
}
|
|
7515
7515
|
);
|
|
7516
7516
|
ChoroplethMap.displayName = "ChoroplethMap";
|
|
7517
|
+
const BRANDS = [
|
|
7518
|
+
{ id: "default", label: "iGreen", swatch: "oklch(0.5248 0.1415 150.9)" },
|
|
7519
|
+
{ id: "blue", label: "Azul", swatch: "oklch(0.52 0.180 264)" },
|
|
7520
|
+
{ id: "green", label: "Verde", swatch: "oklch(0.58 0.170 142)" },
|
|
7521
|
+
{ id: "pay", label: "Pay", swatch: "#00a859" },
|
|
7522
|
+
{ id: "vibrant", label: "iGreen Vibrant", swatch: "oklch(0.866993 0.294055 142.3546)" }
|
|
7523
|
+
];
|
|
7524
|
+
const STORAGE_KEY = "igreen-ds-brand";
|
|
7525
|
+
const CHANGE_EVENT = "igreen-ds-brand-change";
|
|
7526
|
+
const ATTR = "data-theme";
|
|
7527
|
+
function useBrand(options) {
|
|
7528
|
+
const brands = options?.brands ?? BRANDS;
|
|
7529
|
+
const ids = useMemo(() => brands.map((b3) => b3.id).join(","), [brands]);
|
|
7530
|
+
const isBrand = useCallback(
|
|
7531
|
+
(value) => typeof value === "string" && ids.split(",").includes(value),
|
|
7532
|
+
[ids]
|
|
7533
|
+
);
|
|
7534
|
+
const fallback = brands[0]?.id ?? "default";
|
|
7535
|
+
const [brand, setBrandState] = useState(() => {
|
|
7536
|
+
if (typeof window === "undefined") return fallback;
|
|
7537
|
+
const stored = window.localStorage.getItem(STORAGE_KEY);
|
|
7538
|
+
return typeof stored === "string" && ids.split(",").includes(stored) ? stored : fallback;
|
|
7539
|
+
});
|
|
7540
|
+
useEffect(() => {
|
|
7541
|
+
if (typeof document === "undefined") return;
|
|
7542
|
+
const root = document.documentElement;
|
|
7543
|
+
if (brand === "default") root.removeAttribute(ATTR);
|
|
7544
|
+
else root.setAttribute(ATTR, brand);
|
|
7545
|
+
}, [brand]);
|
|
7546
|
+
const setBrand = useCallback((next) => {
|
|
7547
|
+
setBrandState(next);
|
|
7548
|
+
if (typeof window === "undefined") return;
|
|
7549
|
+
try {
|
|
7550
|
+
window.localStorage.setItem(STORAGE_KEY, next);
|
|
7551
|
+
} catch {
|
|
7552
|
+
}
|
|
7553
|
+
window.dispatchEvent(new CustomEvent(CHANGE_EVENT, { detail: next }));
|
|
7554
|
+
}, []);
|
|
7555
|
+
useEffect(() => {
|
|
7556
|
+
if (typeof window === "undefined") return;
|
|
7557
|
+
const valido = (v2) => typeof v2 === "string" && ids.split(",").includes(v2);
|
|
7558
|
+
const onCustom = (e2) => {
|
|
7559
|
+
const next = e2.detail;
|
|
7560
|
+
if (valido(next)) setBrandState(next);
|
|
7561
|
+
};
|
|
7562
|
+
const onStorage = (e2) => {
|
|
7563
|
+
if (e2.key !== STORAGE_KEY) return;
|
|
7564
|
+
if (valido(e2.newValue)) setBrandState(e2.newValue);
|
|
7565
|
+
};
|
|
7566
|
+
window.addEventListener(CHANGE_EVENT, onCustom);
|
|
7567
|
+
window.addEventListener("storage", onStorage);
|
|
7568
|
+
return () => {
|
|
7569
|
+
window.removeEventListener(CHANGE_EVENT, onCustom);
|
|
7570
|
+
window.removeEventListener("storage", onStorage);
|
|
7571
|
+
};
|
|
7572
|
+
}, [ids]);
|
|
7573
|
+
const toggle = useCallback(() => {
|
|
7574
|
+
const lista = ids.split(",");
|
|
7575
|
+
const i2 = lista.indexOf(brand);
|
|
7576
|
+
setBrand(lista[(i2 + 1) % lista.length] ?? fallback);
|
|
7577
|
+
}, [brand, ids, setBrand, fallback]);
|
|
7578
|
+
const current = useMemo(
|
|
7579
|
+
() => brands.find((b3) => b3.id === brand) ?? brands[0],
|
|
7580
|
+
[brands, brand]
|
|
7581
|
+
);
|
|
7582
|
+
return { brand, brands, current, setBrand, toggle, isBrand };
|
|
7583
|
+
}
|
|
7517
7584
|
export {
|
|
7518
7585
|
n as AddViewModal,
|
|
7519
7586
|
A as AlertModal,
|
|
7520
7587
|
A2 as AppShell,
|
|
7521
7588
|
Avatar,
|
|
7589
|
+
BRANDS,
|
|
7522
7590
|
Badge,
|
|
7523
7591
|
B as BulkActionButton,
|
|
7524
7592
|
o as BulkActionsBar,
|
|
@@ -7564,25 +7632,25 @@ export {
|
|
|
7564
7632
|
N as FormFieldSwitch,
|
|
7565
7633
|
c as FormFieldTextarea,
|
|
7566
7634
|
H2 as Header,
|
|
7567
|
-
|
|
7568
|
-
|
|
7569
|
-
|
|
7570
|
-
|
|
7571
|
-
|
|
7635
|
+
G2 as HeaderBreadcrumb,
|
|
7636
|
+
I2 as HeaderMessages,
|
|
7637
|
+
J2 as HeaderNotifications,
|
|
7638
|
+
K2 as HeaderSearch,
|
|
7639
|
+
L2 as HeaderThemeSwitcher,
|
|
7572
7640
|
Icon,
|
|
7573
7641
|
Input,
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7642
|
+
M2 as InputGroup,
|
|
7643
|
+
N2 as InputGroupAddon,
|
|
7644
|
+
O2 as InputGroupButton,
|
|
7645
|
+
Q2 as InputGroupInput,
|
|
7646
|
+
R2 as InputGroupText,
|
|
7647
|
+
S2 as InputGroupTextarea,
|
|
7580
7648
|
O as Kanban,
|
|
7581
7649
|
a as Kpi,
|
|
7582
7650
|
b2 as KpiDelta,
|
|
7583
7651
|
K3 as KpiGroup,
|
|
7584
7652
|
MarkdownText,
|
|
7585
|
-
|
|
7653
|
+
T as MenuSidebar,
|
|
7586
7654
|
MessageAck,
|
|
7587
7655
|
MessageBubble,
|
|
7588
7656
|
MessageComposer,
|
|
@@ -7591,11 +7659,11 @@ export {
|
|
|
7591
7659
|
Modal,
|
|
7592
7660
|
MonthYearPicker,
|
|
7593
7661
|
Q as MoreMenu,
|
|
7594
|
-
|
|
7662
|
+
U2 as MoreMenuCheckboxItem,
|
|
7595
7663
|
DropdownMenuItem as MoreMenuItem,
|
|
7596
7664
|
DropdownMenuLabel as MoreMenuLabel,
|
|
7597
|
-
|
|
7598
|
-
|
|
7665
|
+
V2 as MoreMenuRadioGroup,
|
|
7666
|
+
W2 as MoreMenuRadioItem,
|
|
7599
7667
|
DropdownMenuSeparator as MoreMenuSeparator,
|
|
7600
7668
|
P2 as PageHeader,
|
|
7601
7669
|
P as Panel,
|
|
@@ -7607,13 +7675,13 @@ export {
|
|
|
7607
7675
|
X as PanelRoot,
|
|
7608
7676
|
Y as PanelTrigger,
|
|
7609
7677
|
Z as SELECTION_COLUMN_WIDTH,
|
|
7610
|
-
|
|
7611
|
-
|
|
7612
|
-
|
|
7613
|
-
|
|
7614
|
-
|
|
7615
|
-
|
|
7616
|
-
|
|
7678
|
+
X2 as SidebarBrandIcon,
|
|
7679
|
+
Y2 as SidebarItem,
|
|
7680
|
+
Z2 as SidebarPanel,
|
|
7681
|
+
_2 as SidebarPill,
|
|
7682
|
+
$2 as SidebarRail,
|
|
7683
|
+
a02 as SidebarSection,
|
|
7684
|
+
a12 as SidebarSubgroup,
|
|
7617
7685
|
SingleMenuSidebar,
|
|
7618
7686
|
_ as SortPanel,
|
|
7619
7687
|
$ as SortPopover,
|
|
@@ -7641,15 +7709,15 @@ export {
|
|
|
7641
7709
|
ToolbarSimpleFilterDrawer,
|
|
7642
7710
|
ag as ToolbarTabs,
|
|
7643
7711
|
ToolbarToolButton,
|
|
7644
|
-
|
|
7712
|
+
a22 as UserMenu,
|
|
7645
7713
|
ah as ViewsPopover,
|
|
7646
7714
|
actionColumn,
|
|
7647
7715
|
ai as avatarVariants,
|
|
7648
7716
|
badgeVariants,
|
|
7649
|
-
|
|
7717
|
+
a32 as buttonVariants,
|
|
7650
7718
|
cardCheckbox,
|
|
7651
|
-
|
|
7652
|
-
|
|
7719
|
+
a42 as chipCount,
|
|
7720
|
+
a52 as chipVariants,
|
|
7653
7721
|
colorPickerStyles,
|
|
7654
7722
|
aj as columnTypeRegistry,
|
|
7655
7723
|
conversationListItemStyles,
|
|
@@ -7662,7 +7730,7 @@ export {
|
|
|
7662
7730
|
ak as floatingPanelStyles,
|
|
7663
7731
|
iconStyles,
|
|
7664
7732
|
icons,
|
|
7665
|
-
|
|
7733
|
+
a62 as inputGroupVariants,
|
|
7666
7734
|
i as inputVariants,
|
|
7667
7735
|
isFilterEntryActive,
|
|
7668
7736
|
markdownTextStyles,
|
|
@@ -7678,12 +7746,14 @@ export {
|
|
|
7678
7746
|
am as savedViewsMockService,
|
|
7679
7747
|
statusColumn,
|
|
7680
7748
|
textColumn,
|
|
7749
|
+
useBrand,
|
|
7681
7750
|
an as useColumnResize,
|
|
7682
7751
|
ao as useColumnWidths,
|
|
7683
|
-
|
|
7752
|
+
a72 as useControllable,
|
|
7684
7753
|
ap as useDataTableContext,
|
|
7685
7754
|
aq as useFloatingPanelResize,
|
|
7686
|
-
|
|
7755
|
+
a82 as useMediaQuery,
|
|
7756
|
+
u2 as useTheme,
|
|
7687
7757
|
useToolbarFilterControl,
|
|
7688
7758
|
useToolbarFilters,
|
|
7689
7759
|
useToolbarSort
|