@aspprev/versi-ds 0.4.8 → 0.5.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/README.md +1 -1
- package/dist/{chunk-3UXUAX5K.js → chunk-5Q7V22OH.js} +87 -141
- package/dist/chunk-5Q7V22OH.js.map +1 -0
- package/dist/core.d.ts +28 -14
- package/dist/core.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/manifest.json +2 -2
- package/dist/styles.css +1 -1
- package/dist/themes.css +10 -0
- package/package.json +1 -1
- package/dist/chunk-3UXUAX5K.js.map +0 -1
package/README.md
CHANGED
|
@@ -95,7 +95,7 @@ import {
|
|
|
95
95
|
- `validateFiles` retorna `code`, nome, extensão, tamanho e limite da rejeição e aceita mensagens por código; `FileViewer` também aceita `Promise<FileViewerSource>` como source.
|
|
96
96
|
- Upload e `FileViewer` são controlados pelo consumidor; transporte, autenticação, persistência e download não fazem parte do pacote.
|
|
97
97
|
- `DatePicker` aceita `selectionMode="year"` e mantém `selectionMode="day"` como padrão.
|
|
98
|
-
- `DomainStatusBadge` aceita `statusMap`
|
|
98
|
+
- `StatusBadge` oferece as cores `primary`, `blue`, `green`, `orange`, `yellow`, `red`, `slate` e `black` nas aparências `solid`, `soft` e `outline`. `DomainStatusBadge` aceita um `statusMap` definido pelo consumidor; o DS não associa nomes de status a cores.
|
|
99
99
|
- `Table` preserva os modos `fit`, `adaptive` e `scroll`; filtros e paginação respondem ao espaço do container.
|
|
100
100
|
- `InputPhone`/`PhoneInput` e `SelectCountry` aceitam `showFlags`; o padrão é `true` e `showFlags={false}` remove a bandeira sem reservar espaço.
|
|
101
101
|
- Os controles de formulário ocupam a largura disponível do container; `className="w-full"` pode ser usado em grids, flex containers e colunas responsivas.
|
|
@@ -868,7 +868,6 @@ var PAGINATION_SIZE_CLASSES = {
|
|
|
868
868
|
normal: {
|
|
869
869
|
itemHeight: "box-border h-7 min-h-7",
|
|
870
870
|
pageWidth: "w-8",
|
|
871
|
-
controlWidth: "w-24",
|
|
872
871
|
controlPadding: "px-2",
|
|
873
872
|
text: "text-sm",
|
|
874
873
|
gap: "gap-1.5"
|
|
@@ -876,7 +875,6 @@ var PAGINATION_SIZE_CLASSES = {
|
|
|
876
875
|
small: {
|
|
877
876
|
itemHeight: "box-border h-6 min-h-6",
|
|
878
877
|
pageWidth: "w-6",
|
|
879
|
-
controlWidth: "w-20",
|
|
880
878
|
controlPadding: "px-1.5",
|
|
881
879
|
text: "text-xs",
|
|
882
880
|
gap: "gap-1"
|
|
@@ -985,7 +983,7 @@ function PaginationView(props) {
|
|
|
985
983
|
} = props;
|
|
986
984
|
const totalPages = Math.max(1, Math.ceil(totalResults / perPage));
|
|
987
985
|
const sizeClasses = PAGINATION_SIZE_CLASSES[size];
|
|
988
|
-
const controlWidth = variant === "arrows" ? sizeClasses.pageWidth :
|
|
986
|
+
const controlWidth = variant === "arrows" ? sizeClasses.pageWidth : "";
|
|
989
987
|
return /* @__PURE__ */ jsxs9(
|
|
990
988
|
"nav",
|
|
991
989
|
{
|
|
@@ -1014,7 +1012,7 @@ function PaginationView(props) {
|
|
|
1014
1012
|
controlWidth,
|
|
1015
1013
|
sizeClasses.controlPadding,
|
|
1016
1014
|
"rounded-sm border border-border-default",
|
|
1017
|
-
"flex items-center justify-center gap-1 text-content-primary",
|
|
1015
|
+
"flex items-center justify-center gap-1 whitespace-nowrap text-content-primary",
|
|
1018
1016
|
sizeClasses.text,
|
|
1019
1017
|
"cursor-pointer focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring"
|
|
1020
1018
|
),
|
|
@@ -1045,7 +1043,7 @@ function PaginationView(props) {
|
|
|
1045
1043
|
controlWidth,
|
|
1046
1044
|
sizeClasses.controlPadding,
|
|
1047
1045
|
"rounded-sm border border-border-default",
|
|
1048
|
-
"flex items-center justify-center gap-1 text-content-primary",
|
|
1046
|
+
"flex items-center justify-center gap-1 whitespace-nowrap text-content-primary",
|
|
1049
1047
|
sizeClasses.text,
|
|
1050
1048
|
"cursor-pointer focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring"
|
|
1051
1049
|
),
|
|
@@ -1776,150 +1774,84 @@ function FilterBar({
|
|
|
1776
1774
|
}
|
|
1777
1775
|
|
|
1778
1776
|
// src/utils/resolve-status-appearance.ts
|
|
1779
|
-
var
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
"AGUARDANDO ASSINATURA"
|
|
1786
|
-
]),
|
|
1787
|
-
warning: /* @__PURE__ */ new Set([
|
|
1788
|
-
"EM ANALISE",
|
|
1789
|
-
"PENDENTE",
|
|
1790
|
-
"SUSPENSO",
|
|
1791
|
-
"AGUARDANDO PARTICIPANTE"
|
|
1792
|
-
]),
|
|
1793
|
-
success: /* @__PURE__ */ new Set([
|
|
1794
|
-
"DEFERIDO",
|
|
1795
|
-
"QUITADO",
|
|
1796
|
-
"LIBERADO",
|
|
1797
|
-
"ATIVO",
|
|
1798
|
-
"VIGENTE",
|
|
1799
|
-
"RESPONDIDO",
|
|
1800
|
-
"ASSINADO"
|
|
1801
|
-
]),
|
|
1802
|
-
danger: /* @__PURE__ */ new Set(["INDEFERIDO", "VENCIDO", "CANCELADO", "ERRO"]),
|
|
1803
|
-
neutral: /* @__PURE__ */ new Set([
|
|
1804
|
-
"CONCLUIDO",
|
|
1805
|
-
"ENCERRADO",
|
|
1806
|
-
"FINALIZADO",
|
|
1807
|
-
"RENEGOCIADO",
|
|
1808
|
-
"INATIVO"
|
|
1809
|
-
])
|
|
1777
|
+
var TONE_TO_COLOR = {
|
|
1778
|
+
info: "blue",
|
|
1779
|
+
warning: "yellow",
|
|
1780
|
+
success: "green",
|
|
1781
|
+
danger: "red",
|
|
1782
|
+
neutral: "slate"
|
|
1810
1783
|
};
|
|
1811
1784
|
var normalizeStatus = (status) => String(status ?? "").normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/\s+/g, " ").trim().toUpperCase();
|
|
1812
|
-
var
|
|
1813
|
-
|
|
1814
|
-
return { tone: "info", appearance: "outline" };
|
|
1815
|
-
}
|
|
1816
|
-
if (NORMALIZED_STATUS.infoSolid.has(status)) {
|
|
1817
|
-
return { tone: "info", appearance: "solid" };
|
|
1818
|
-
}
|
|
1819
|
-
if (NORMALIZED_STATUS.warning.has(status)) {
|
|
1820
|
-
return { tone: "warning", appearance: "soft" };
|
|
1821
|
-
}
|
|
1822
|
-
if (NORMALIZED_STATUS.success.has(status)) {
|
|
1823
|
-
return { tone: "success", appearance: "solid" };
|
|
1824
|
-
}
|
|
1825
|
-
if (NORMALIZED_STATUS.danger.has(status)) {
|
|
1826
|
-
return { tone: "danger", appearance: "solid" };
|
|
1827
|
-
}
|
|
1828
|
-
if (NORMALIZED_STATUS.neutral.has(status)) {
|
|
1829
|
-
return { tone: "neutral", appearance: "solid" };
|
|
1830
|
-
}
|
|
1831
|
-
return { tone: "neutral", appearance: "outline" };
|
|
1832
|
-
};
|
|
1785
|
+
var isLegacyConfig = (config) => "tone" in config;
|
|
1786
|
+
var normalizeConfig = (config) => isLegacyConfig(config) ? { color: TONE_TO_COLOR[config.tone], appearance: config.appearance } : config;
|
|
1833
1787
|
var resolveStatusAppearance = (status, domain = "generic", options) => {
|
|
1788
|
+
void domain;
|
|
1834
1789
|
const normalized = normalizeStatus(status);
|
|
1835
|
-
if (
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
(
|
|
1840
|
-
)?.[1] : void 0;
|
|
1841
|
-
if (mappedAppearance) return mappedAppearance;
|
|
1842
|
-
if (domain === "beneficiary") {
|
|
1843
|
-
if (normalized === "VIGENTE") return { tone: "success", appearance: "solid" };
|
|
1844
|
-
if (normalized === "ENCERRADO") return { tone: "neutral", appearance: "solid" };
|
|
1790
|
+
if (normalized && options?.map) {
|
|
1791
|
+
const mappedAppearance = Object.entries(options.map).find(
|
|
1792
|
+
([key]) => normalizeStatus(key) === normalized
|
|
1793
|
+
)?.[1];
|
|
1794
|
+
if (mappedAppearance) return normalizeConfig(mappedAppearance);
|
|
1845
1795
|
}
|
|
1846
|
-
if (
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
return { tone: "warning", appearance: "soft" };
|
|
1852
|
-
}
|
|
1853
|
-
if (normalized === "BLOQUEADO") return { tone: "neutral", appearance: "solid" };
|
|
1854
|
-
}
|
|
1855
|
-
if (domain === "signature") {
|
|
1856
|
-
if (normalized === "ASSINADO") return { tone: "success", appearance: "solid" };
|
|
1857
|
-
if (normalized.includes("AGUARDANDO")) return { tone: "warning", appearance: "soft" };
|
|
1858
|
-
if (normalized === "NAO ASSINADO") return { tone: "info", appearance: "solid" };
|
|
1859
|
-
}
|
|
1860
|
-
if (domain === "benefit") {
|
|
1861
|
-
if (normalized === "EM PAGAMENTO") return { tone: "info", appearance: "outline" };
|
|
1862
|
-
if (normalized === "SUSPENSO") return { tone: "warning", appearance: "soft" };
|
|
1863
|
-
}
|
|
1864
|
-
if (domain === "participation") {
|
|
1865
|
-
return { tone: "neutral", appearance: "solid" };
|
|
1866
|
-
}
|
|
1867
|
-
if (domain === "payment") {
|
|
1868
|
-
if (["PAGO", "QUITADO", "LIBERADO"].includes(normalized)) {
|
|
1869
|
-
return { tone: "success", appearance: "solid" };
|
|
1870
|
-
}
|
|
1871
|
-
if (["EM PAGAMENTO", "AGUARDANDO PAGAMENTO"].includes(normalized)) {
|
|
1872
|
-
return { tone: "info", appearance: "outline" };
|
|
1873
|
-
}
|
|
1874
|
-
if (["VENCIDO", "ESTORNADO", "FALHOU"].includes(normalized)) {
|
|
1875
|
-
return { tone: "danger", appearance: "solid" };
|
|
1876
|
-
}
|
|
1796
|
+
if (options?.color) {
|
|
1797
|
+
return {
|
|
1798
|
+
color: options.color,
|
|
1799
|
+
appearance: options.appearance ?? "outline"
|
|
1800
|
+
};
|
|
1877
1801
|
}
|
|
1878
|
-
if (
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
return { tone: "warning", appearance: "soft" };
|
|
1884
|
-
}
|
|
1885
|
-
if (["APROVADO", "CONCEDIDO", "ATENDIDO"].includes(normalized)) {
|
|
1886
|
-
return { tone: "success", appearance: "solid" };
|
|
1887
|
-
}
|
|
1888
|
-
if (["NEGADO", "ARQUIVADO", "RECUSADO"].includes(normalized)) {
|
|
1889
|
-
return { tone: "danger", appearance: "solid" };
|
|
1890
|
-
}
|
|
1802
|
+
if (options?.tone) {
|
|
1803
|
+
return {
|
|
1804
|
+
color: TONE_TO_COLOR[options.tone],
|
|
1805
|
+
appearance: options.appearance ?? "outline"
|
|
1806
|
+
};
|
|
1891
1807
|
}
|
|
1892
|
-
return options?.fallback ??
|
|
1808
|
+
return options?.fallback ?? { color: "slate", appearance: "outline" };
|
|
1893
1809
|
};
|
|
1810
|
+
var getStatusBadgeColorFromTone = (tone) => TONE_TO_COLOR[tone];
|
|
1894
1811
|
|
|
1895
1812
|
// src/components/status-badge/StatusBadge.tsx
|
|
1896
1813
|
import classNames12 from "classnames";
|
|
1897
1814
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1898
|
-
var
|
|
1899
|
-
|
|
1900
|
-
outline: "border-
|
|
1901
|
-
soft: "border-
|
|
1902
|
-
solid: "border-
|
|
1815
|
+
var COLOR_STYLES = {
|
|
1816
|
+
primary: {
|
|
1817
|
+
outline: "border-primary-1 text-primary-1",
|
|
1818
|
+
soft: "border-primary-1 bg-primary-5 text-primary-2",
|
|
1819
|
+
solid: "border-action-primary bg-action-primary text-action-primary-content"
|
|
1820
|
+
},
|
|
1821
|
+
blue: {
|
|
1822
|
+
outline: "border-status-blue-outline-border text-status-blue-outline-foreground",
|
|
1823
|
+
soft: "border-status-blue-outline-border bg-status-blue-soft-background text-status-blue-soft-foreground",
|
|
1824
|
+
solid: "border-status-blue-solid-background bg-status-blue-solid-background text-status-blue-solid-foreground"
|
|
1825
|
+
},
|
|
1826
|
+
green: {
|
|
1827
|
+
outline: "border-status-green-outline-border text-status-green-outline-foreground",
|
|
1828
|
+
soft: "border-status-green-outline-border bg-status-green-soft-background text-status-green-soft-foreground",
|
|
1829
|
+
solid: "border-status-green-solid-background bg-status-green-solid-background text-status-green-solid-foreground"
|
|
1903
1830
|
},
|
|
1904
|
-
|
|
1905
|
-
outline: "border-
|
|
1906
|
-
soft: "border-
|
|
1907
|
-
solid: "border-
|
|
1831
|
+
orange: {
|
|
1832
|
+
outline: "border-status-orange-outline-border text-status-orange-outline-foreground",
|
|
1833
|
+
soft: "border-status-orange-outline-border bg-status-orange-soft-background text-status-orange-soft-foreground",
|
|
1834
|
+
solid: "border-status-orange-solid-background bg-status-orange-solid-background text-status-orange-solid-foreground"
|
|
1908
1835
|
},
|
|
1909
|
-
|
|
1910
|
-
outline: "border-
|
|
1911
|
-
soft: "border-
|
|
1912
|
-
solid: "border-
|
|
1836
|
+
yellow: {
|
|
1837
|
+
outline: "border-status-yellow-outline-border text-status-yellow-outline-foreground",
|
|
1838
|
+
soft: "border-status-yellow-outline-border bg-status-yellow-soft-background text-status-yellow-soft-foreground",
|
|
1839
|
+
solid: "border-status-yellow-solid-background bg-status-yellow-solid-background text-status-yellow-solid-foreground"
|
|
1913
1840
|
},
|
|
1914
|
-
|
|
1915
|
-
outline: "border-
|
|
1916
|
-
soft: "border-
|
|
1917
|
-
solid: "border-
|
|
1841
|
+
red: {
|
|
1842
|
+
outline: "border-status-red-outline-border text-status-red-outline-foreground",
|
|
1843
|
+
soft: "border-status-red-outline-border bg-status-red-soft-background text-status-red-soft-foreground",
|
|
1844
|
+
solid: "border-status-red-solid-background bg-status-red-solid-background text-status-red-solid-foreground"
|
|
1918
1845
|
},
|
|
1919
|
-
|
|
1920
|
-
outline: "border-border
|
|
1921
|
-
soft: "border-border
|
|
1922
|
-
solid: "border-
|
|
1846
|
+
slate: {
|
|
1847
|
+
outline: "border-status-slate-outline-border text-status-slate-outline-foreground",
|
|
1848
|
+
soft: "border-status-slate-outline-border bg-status-slate-soft-background text-status-slate-soft-foreground",
|
|
1849
|
+
solid: "border-status-slate-solid-background bg-status-slate-solid-background text-status-slate-solid-foreground"
|
|
1850
|
+
},
|
|
1851
|
+
black: {
|
|
1852
|
+
outline: "border-status-black-outline-border text-status-black-outline-foreground",
|
|
1853
|
+
soft: "border-status-black-outline-border bg-status-black-soft-background text-status-black-soft-foreground",
|
|
1854
|
+
solid: "border-status-black-solid-background bg-status-black-solid-background text-status-black-solid-foreground"
|
|
1923
1855
|
}
|
|
1924
1856
|
};
|
|
1925
1857
|
var SIZE_STYLES = {
|
|
@@ -1928,7 +1860,8 @@ var SIZE_STYLES = {
|
|
|
1928
1860
|
};
|
|
1929
1861
|
function StatusBadge({
|
|
1930
1862
|
children,
|
|
1931
|
-
|
|
1863
|
+
color,
|
|
1864
|
+
tone,
|
|
1932
1865
|
appearance = "outline",
|
|
1933
1866
|
size = "md",
|
|
1934
1867
|
overflow = "wrap",
|
|
@@ -1943,7 +1876,7 @@ function StatusBadge({
|
|
|
1943
1876
|
className: classNames12(
|
|
1944
1877
|
"inline-flex w-fit max-w-full items-center justify-center rounded-sm border-2 text-center font-bold uppercase tracking-wide",
|
|
1945
1878
|
SIZE_STYLES[size],
|
|
1946
|
-
|
|
1879
|
+
COLOR_STYLES[color ?? getStatusBadgeColorFromTone(tone ?? "neutral")][appearance],
|
|
1947
1880
|
overflow === "truncate" ? "overflow-hidden text-ellipsis whitespace-nowrap" : "whitespace-normal break-words",
|
|
1948
1881
|
className
|
|
1949
1882
|
),
|
|
@@ -1954,7 +1887,10 @@ function StatusBadge({
|
|
|
1954
1887
|
}
|
|
1955
1888
|
);
|
|
1956
1889
|
}
|
|
1957
|
-
var getStatusBadgeClassName = (
|
|
1890
|
+
var getStatusBadgeClassName = (colorOrTone, appearance) => {
|
|
1891
|
+
const color = colorOrTone in COLOR_STYLES ? colorOrTone : getStatusBadgeColorFromTone(colorOrTone);
|
|
1892
|
+
return COLOR_STYLES[color][appearance];
|
|
1893
|
+
};
|
|
1958
1894
|
|
|
1959
1895
|
// src/components/status-badge/DomainStatusBadge.tsx
|
|
1960
1896
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
@@ -1964,15 +1900,25 @@ function DomainStatusBadge({
|
|
|
1964
1900
|
empty = "hide",
|
|
1965
1901
|
placeholder = "-",
|
|
1966
1902
|
statusMap,
|
|
1903
|
+
fallback,
|
|
1904
|
+
color,
|
|
1905
|
+
tone,
|
|
1906
|
+
appearance,
|
|
1967
1907
|
...rest
|
|
1968
1908
|
}) {
|
|
1969
1909
|
const label = status?.trim();
|
|
1970
1910
|
if (!label && empty === "hide") return null;
|
|
1971
|
-
const resolved = resolveStatusAppearance(label, domain, {
|
|
1911
|
+
const resolved = resolveStatusAppearance(label, domain, {
|
|
1912
|
+
map: statusMap,
|
|
1913
|
+
color,
|
|
1914
|
+
tone,
|
|
1915
|
+
appearance,
|
|
1916
|
+
fallback
|
|
1917
|
+
});
|
|
1972
1918
|
return /* @__PURE__ */ jsx28(
|
|
1973
1919
|
StatusBadge,
|
|
1974
1920
|
{
|
|
1975
|
-
|
|
1921
|
+
color: resolved.color,
|
|
1976
1922
|
appearance: resolved.appearance,
|
|
1977
1923
|
...rest,
|
|
1978
1924
|
children: label || placeholder
|
|
@@ -2659,7 +2605,7 @@ function TableView({
|
|
|
2659
2605
|
onClick: pagination.onPrevious,
|
|
2660
2606
|
disabled: pagination.currentPage === 1,
|
|
2661
2607
|
"aria-label": "Ir para a p\xE1gina anterior",
|
|
2662
|
-
className: `${paginationSizeClasses.itemHeight} inline-flex ${paginationVariant === "arrows" ? paginationSizeClasses.pageWidth :
|
|
2608
|
+
className: `${paginationSizeClasses.itemHeight} inline-flex ${paginationVariant === "arrows" ? paginationSizeClasses.pageWidth : ""} items-center justify-center gap-1 whitespace-nowrap rounded border border-border-default ${paginationSizeClasses.controlPadding} ${paginationSizeClasses.text} leading-none text-content-primary hover:border-border-strong disabled:cursor-not-allowed disabled:border-border-default disabled:opacity-50`,
|
|
2663
2609
|
children: [
|
|
2664
2610
|
/* @__PURE__ */ jsx33(MdKeyboardArrowLeft, { className: "h-3 w-3 text-content-muted" }),
|
|
2665
2611
|
paginationVariant !== "arrows" && "Anterior"
|
|
@@ -2682,7 +2628,7 @@ function TableView({
|
|
|
2682
2628
|
onClick: pagination.onNext,
|
|
2683
2629
|
disabled: pagination.currentPage === pagination.totalPages,
|
|
2684
2630
|
"aria-label": "Ir para a pr\xF3xima p\xE1gina",
|
|
2685
|
-
className: `${paginationSizeClasses.itemHeight} inline-flex ${paginationVariant === "arrows" ? paginationSizeClasses.pageWidth :
|
|
2631
|
+
className: `${paginationSizeClasses.itemHeight} inline-flex ${paginationVariant === "arrows" ? paginationSizeClasses.pageWidth : ""} items-center justify-center gap-1 whitespace-nowrap rounded border border-border-default ${paginationSizeClasses.controlPadding} ${paginationSizeClasses.text} leading-none text-content-primary hover:border-border-strong disabled:cursor-not-allowed disabled:border-border-default disabled:opacity-50`,
|
|
2686
2632
|
children: [
|
|
2687
2633
|
paginationVariant !== "arrows" && "Pr\xF3xima",
|
|
2688
2634
|
/* @__PURE__ */ jsx33(MdKeyboardArrowRight, { className: "h-3 w-3 text-content-muted" })
|
|
@@ -3341,4 +3287,4 @@ export {
|
|
|
3341
3287
|
resolveContainerBreakpoint,
|
|
3342
3288
|
useContainerBreakpoint
|
|
3343
3289
|
};
|
|
3344
|
-
//# sourceMappingURL=chunk-
|
|
3290
|
+
//# sourceMappingURL=chunk-5Q7V22OH.js.map
|