@aspprev/versi-ds 0.4.3 → 0.4.4

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.
@@ -616,7 +616,8 @@ var avatarSizeMap = {
616
616
  xs: "w-5 h-5 text-2xs",
617
617
  sm: "w-6 h-6 text-sm",
618
618
  md: "w-8 h-8 text-xl",
619
- lg: "w-9 h-9 text-2xl"
619
+ lg: "w-9 h-9 text-2xl",
620
+ xl: "w-[4rem] h-[4rem] text-[2rem]"
620
621
  };
621
622
  function Inicials(name) {
622
623
  const nome = name;
@@ -1341,6 +1342,7 @@ var InputSlider = ({
1341
1342
  functionChange,
1342
1343
  initialValue,
1343
1344
  prefix,
1345
+ suffix,
1344
1346
  sufix,
1345
1347
  marks,
1346
1348
  valueLabelDisplay = "auto",
@@ -1353,6 +1355,7 @@ var InputSlider = ({
1353
1355
  ...rest
1354
1356
  }) => {
1355
1357
  const [value, setValue] = useState2(initialValue);
1358
+ const resolvedSuffix = suffix ?? sufix;
1356
1359
  const controlLabel = ariaLabel || name;
1357
1360
  const valueInputId = `${name}-value`;
1358
1361
  const handleSliderChange = useCallback2(
@@ -1415,7 +1418,12 @@ var InputSlider = ({
1415
1418
  "aria-label": `${controlLabel} valor`,
1416
1419
  disabled: disabled || inputDisabled
1417
1420
  }
1418
- )
1421
+ ),
1422
+ (showLabel || prefix || resolvedSuffix || valueFormmated) && /* @__PURE__ */ jsxs12("span", { className: "shrink-0 text-sm text-content-secondary", children: [
1423
+ prefix,
1424
+ valueFormmated ?? value,
1425
+ resolvedSuffix
1426
+ ] })
1419
1427
  ] });
1420
1428
  };
1421
1429
  var InputSliderView_default = InputSlider;
@@ -1482,6 +1490,9 @@ function FormGrid({ columns = 2, className, ...rest }) {
1482
1490
  import classNames9 from "classnames";
1483
1491
  import { MdArrowBack } from "react-icons/md";
1484
1492
  import { Fragment as Fragment3, jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
1493
+ function getTitleAttribute(title) {
1494
+ return typeof title === "string" || typeof title === "number" ? String(title) : void 0;
1495
+ }
1485
1496
  function BackContent({ label }) {
1486
1497
  return /* @__PURE__ */ jsxs13(Fragment3, { children: [
1487
1498
  /* @__PURE__ */ jsx23(MdArrowBack, { "aria-hidden": "true", className: "h-5 w-5 shrink-0" }),
@@ -1503,6 +1514,7 @@ function PageHeading({
1503
1514
  spacing = "default"
1504
1515
  }) {
1505
1516
  const backHref = getBackHref(back?.href);
1517
+ const titleAttribute = getTitleAttribute(title);
1506
1518
  const backClassName = "mb-2 inline-flex w-fit items-center gap-1 text-sm font-semibold text-content-link hover:underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring";
1507
1519
  return /* @__PURE__ */ jsxs13(
1508
1520
  "header",
@@ -1513,7 +1525,7 @@ function PageHeading({
1513
1525
  className
1514
1526
  ),
1515
1527
  children: [
1516
- /* @__PURE__ */ jsxs13("div", { className: classNames9("min-w-0", contentClassName), children: [
1528
+ /* @__PURE__ */ jsxs13("div", { className: classNames9("min-w-0 flex-1", contentClassName), children: [
1517
1529
  back && backHref ? /* @__PURE__ */ jsx23("a", { className: backClassName, href: backHref, children: /* @__PURE__ */ jsx23(BackContent, { label: back.label }) }) : back ? /* @__PURE__ */ jsx23(
1518
1530
  "button",
1519
1531
  {
@@ -1523,7 +1535,16 @@ function PageHeading({
1523
1535
  children: /* @__PURE__ */ jsx23(BackContent, { label: back.label })
1524
1536
  }
1525
1537
  ) : null,
1526
- /* @__PURE__ */ jsx23(typography_default, { element: "h1", semanticRole: "page-title", children: title }),
1538
+ /* @__PURE__ */ jsx23(
1539
+ typography_default,
1540
+ {
1541
+ element: "h1",
1542
+ semanticRole: "page-title",
1543
+ title: titleAttribute,
1544
+ className: "min-w-0 tablet:truncate",
1545
+ children: title
1546
+ }
1547
+ ),
1527
1548
  subtitle !== void 0 && subtitle !== null && /* @__PURE__ */ jsx23(
1528
1549
  typography_default,
1529
1550
  {
@@ -1534,7 +1555,7 @@ function PageHeading({
1534
1555
  }
1535
1556
  )
1536
1557
  ] }),
1537
- actions && /* @__PURE__ */ jsx23("div", { className: "flex w-full flex-wrap items-center gap-2 tablet:w-auto tablet:justify-end", children: actions })
1558
+ actions && /* @__PURE__ */ jsx23("div", { className: "flex w-full flex-wrap items-center gap-2 tablet:w-auto tablet:shrink-0 tablet:justify-end", children: actions })
1538
1559
  ]
1539
1560
  }
1540
1561
  );
@@ -1555,12 +1576,12 @@ function PageTabsHeader({
1555
1576
  {
1556
1577
  className: `flex flex-col gap-4 tablet:flex-row tablet:items-end tablet:justify-between ${className}`,
1557
1578
  children: [
1558
- /* @__PURE__ */ jsx24(PageHeading, { title, spacing: "none" }),
1579
+ /* @__PURE__ */ jsx24("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx24(PageHeading, { title, spacing: "none" }) }),
1559
1580
  tabs.length > 1 && /* @__PURE__ */ jsx24(
1560
1581
  "nav",
1561
1582
  {
1562
1583
  "aria-label": title,
1563
- className: "flex w-full max-w-full flex-row flex-nowrap items-end gap-3 overflow-x-auto tablet:w-fit tablet:justify-end tablet:overflow-visible",
1584
+ className: "flex w-full max-w-full flex-row flex-nowrap items-end gap-3 overflow-x-auto tablet:w-fit tablet:shrink-0 tablet:justify-end tablet:overflow-visible",
1564
1585
  children: /* @__PURE__ */ jsx24("div", { role: "tablist", className: "flex flex-nowrap items-end gap-3", children: tabs.map((tab) => {
1565
1586
  const Icon = tab.icon;
1566
1587
  const isActive = activeTab === tab.id;
@@ -2232,6 +2253,9 @@ var HEADER_DENSITY_CLASSES = {
2232
2253
  };
2233
2254
  function TableView({
2234
2255
  children,
2256
+ loading = false,
2257
+ loadingMessage = "Carregando dados\u2026",
2258
+ errorMessage,
2235
2259
  header,
2236
2260
  accessibleName,
2237
2261
  caption,
@@ -2439,7 +2463,7 @@ function TableView({
2439
2463
  ref: tableWrapperRef,
2440
2464
  className: `relative flex h-full min-h-0 min-w-0 flex-col ${isAdaptiveCompact ? "table-adaptive-compact" : ""}`,
2441
2465
  children: [
2442
- /* @__PURE__ */ jsx33(
2466
+ /* @__PURE__ */ jsxs18(
2443
2467
  "div",
2444
2468
  {
2445
2469
  ref: scrollContainerRef,
@@ -2450,59 +2474,72 @@ function TableView({
2450
2474
  "data-responsive-mode": overflowMode,
2451
2475
  style: { maxHeight: resolvedScrollAreaMaxHeight },
2452
2476
  className: `min-h-0 min-w-0 flex-1 overflow-y-auto ${overflowClass}`,
2453
- children: /* @__PURE__ */ jsxs18(
2454
- "table",
2455
- {
2456
- "aria-label": caption ? void 0 : accessibleName ?? `Tabela: ${header.map((item) => item.title).join(", ")}`,
2457
- className: `w-full max-w-full ${resolvedTotalWidthUnits && !isAdaptiveCompact ? "table-fixed" : ""} ${className ?? ""}`,
2458
- children: [
2459
- caption && /* @__PURE__ */ jsx33("caption", { className: "sr-only", children: caption }),
2460
- resolvedTotalWidthUnits && !isAdaptiveCompact && /* @__PURE__ */ jsx33("colgroup", { children: header.map((item, index) => /* @__PURE__ */ jsx33("col", { width: getColumnWidth(item.widthUnits) }, index)) }),
2461
- /* @__PURE__ */ jsx33("thead", { className: "border-b border-border-default", children: /* @__PURE__ */ jsx33("tr", { className: HEADER_DENSITY_CLASSES[density].row, children: header.map((item, index) => {
2462
- const canOpenFilter = hasFilterEnabled(item);
2463
- const headerIcon = getHeaderIcon(item);
2464
- return /* @__PURE__ */ jsx33(
2465
- "th",
2466
- {
2467
- scope: "col",
2468
- "aria-sort": getSortDirection(item),
2469
- ref: (element) => {
2470
- headerCellRefs.current[index] = element;
2477
+ children: [
2478
+ /* @__PURE__ */ jsxs18(
2479
+ "table",
2480
+ {
2481
+ "aria-label": caption ? void 0 : accessibleName ?? `Tabela: ${header.map((item) => item.title).join(", ")}`,
2482
+ className: `w-full max-w-full ${resolvedTotalWidthUnits && !isAdaptiveCompact ? "table-fixed" : ""} ${className ?? ""}`,
2483
+ children: [
2484
+ caption && /* @__PURE__ */ jsx33("caption", { className: "sr-only", children: caption }),
2485
+ resolvedTotalWidthUnits && !isAdaptiveCompact && /* @__PURE__ */ jsx33("colgroup", { children: header.map((item, index) => /* @__PURE__ */ jsx33("col", { width: getColumnWidth(item.widthUnits) }, index)) }),
2486
+ /* @__PURE__ */ jsx33("thead", { className: "border-b border-border-default", children: /* @__PURE__ */ jsx33("tr", { className: HEADER_DENSITY_CLASSES[density].row, children: header.map((item, index) => {
2487
+ const canOpenFilter = hasFilterEnabled(item);
2488
+ const headerIcon = getHeaderIcon(item);
2489
+ return /* @__PURE__ */ jsx33(
2490
+ "th",
2491
+ {
2492
+ scope: "col",
2493
+ "aria-sort": getSortDirection(item),
2494
+ ref: (element) => {
2495
+ headerCellRefs.current[index] = element;
2496
+ },
2497
+ className: `${stickyHeader ? "sticky top-0 z-[1]" : "relative"} ${HEADER_VARIANT_CLASSES[headerVariant]} ${HEADER_DENSITY_CLASSES[density].cell} text-left text-md font-bold ${item.className ?? ""}`,
2498
+ "data-has-filter": canOpenFilter,
2499
+ children: canOpenFilter ? /* @__PURE__ */ jsxs18(
2500
+ "button",
2501
+ {
2502
+ type: "button",
2503
+ "aria-expanded": openFilter === index,
2504
+ "aria-controls": openFilter === index ? `${tableId}-filter-${index}` : void 0,
2505
+ ref: (element) => {
2506
+ filterTriggerRefs.current[index] = element;
2507
+ },
2508
+ "aria-label": `Filtrar ou ordenar por ${item.title}`,
2509
+ className: `flex min-h-11 w-full items-center gap-1.5 rounded-sm text-left focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 ${headerFocusClass} ${item.className?.includes("text-right") ? "justify-end" : ""}`,
2510
+ onClick: () => handleHeaderAction(item, index),
2511
+ children: [
2512
+ /* @__PURE__ */ jsx33("span", { className: "min-w-0 truncate", children: item.title }),
2513
+ headerIcon && /* @__PURE__ */ jsx33("span", { className: "flex-shrink-0", "aria-hidden": "true", children: headerIcon })
2514
+ ]
2515
+ }
2516
+ ) : /* @__PURE__ */ jsx33(
2517
+ "span",
2518
+ {
2519
+ className: `flex items-center gap-1.5 ${item.className?.includes("text-right") ? "justify-end" : ""}`,
2520
+ children: /* @__PURE__ */ jsx33("span", { className: "min-w-0 truncate", children: item.title })
2521
+ }
2522
+ )
2471
2523
  },
2472
- className: `${stickyHeader ? "sticky top-0 z-[1]" : "relative"} ${HEADER_VARIANT_CLASSES[headerVariant]} ${HEADER_DENSITY_CLASSES[density].cell} text-left text-md font-bold ${item.className ?? ""}`,
2473
- "data-has-filter": canOpenFilter,
2474
- children: canOpenFilter ? /* @__PURE__ */ jsxs18(
2475
- "button",
2476
- {
2477
- type: "button",
2478
- "aria-expanded": openFilter === index,
2479
- "aria-controls": openFilter === index ? `${tableId}-filter-${index}` : void 0,
2480
- ref: (element) => {
2481
- filterTriggerRefs.current[index] = element;
2482
- },
2483
- "aria-label": `Filtrar ou ordenar por ${item.title}`,
2484
- className: `flex min-h-11 w-full items-center gap-1.5 rounded-sm text-left focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 ${headerFocusClass} ${item.className?.includes("text-right") ? "justify-end" : ""}`,
2485
- onClick: () => handleHeaderAction(item, index),
2486
- children: [
2487
- /* @__PURE__ */ jsx33("span", { className: "min-w-0 truncate", children: item.title }),
2488
- headerIcon && /* @__PURE__ */ jsx33("span", { className: "flex-shrink-0", "aria-hidden": "true", children: headerIcon })
2489
- ]
2490
- }
2491
- ) : /* @__PURE__ */ jsx33(
2492
- "span",
2493
- {
2494
- className: `flex items-center gap-1.5 ${item.className?.includes("text-right") ? "justify-end" : ""}`,
2495
- children: /* @__PURE__ */ jsx33("span", { className: "min-w-0 truncate", children: item.title })
2496
- }
2497
- )
2498
- },
2499
- index
2500
- );
2501
- }) }) }),
2502
- children ? children : /* @__PURE__ */ jsx33("tbody", { children: /* @__PURE__ */ jsx33("tr", { children: /* @__PURE__ */ jsx33("td", { colSpan: header.length, children: /* @__PURE__ */ jsx33(NotFoundView_default, {}) }) }) })
2503
- ]
2504
- }
2505
- )
2524
+ index
2525
+ );
2526
+ }) }) }),
2527
+ children ? children : /* @__PURE__ */ jsx33("tbody", { children: /* @__PURE__ */ jsx33("tr", { children: /* @__PURE__ */ jsx33("td", { colSpan: header.length, children: /* @__PURE__ */ jsx33(NotFoundView_default, {}) }) }) })
2528
+ ]
2529
+ }
2530
+ ),
2531
+ loading && /* @__PURE__ */ jsx33(
2532
+ "div",
2533
+ {
2534
+ role: "status",
2535
+ "aria-busy": "true",
2536
+ "aria-live": "polite",
2537
+ className: "pointer-events-none absolute inset-x-0 top-0 flex min-h-24 items-center justify-center bg-surface-card/80 p-4 text-sm text-content-secondary",
2538
+ children: loadingMessage
2539
+ }
2540
+ ),
2541
+ !loading && errorMessage && /* @__PURE__ */ jsx33("div", { role: "alert", className: "border-t border-field-border-error bg-feedback-danger-soft p-4 text-sm text-field-assistive-error", children: errorMessage })
2542
+ ]
2506
2543
  }
2507
2544
  ),
2508
2545
  openFilter !== null && filterCoords && header[openFilter]?.filters && /* @__PURE__ */ jsx33("div", { ref: filterRef, className: "absolute z-popover", children: /* @__PURE__ */ jsx33(
@@ -2607,6 +2644,8 @@ function Table(props) {
2607
2644
  itemsPerPage = 10,
2608
2645
  emptyMessage = "Nenhum item encontrado",
2609
2646
  errorMessage,
2647
+ loading = false,
2648
+ loadingMessage = "Carregando dados\u2026",
2610
2649
  totalWidthUnits,
2611
2650
  showRowDivider = false,
2612
2651
  enableRowHover = false,
@@ -2905,6 +2944,9 @@ function Table(props) {
2905
2944
  accessibleName,
2906
2945
  caption,
2907
2946
  onFilterChange,
2947
+ loading,
2948
+ loadingMessage,
2949
+ errorMessage,
2908
2950
  className,
2909
2951
  showPagination: resolvedShowPagination,
2910
2952
  pagination: resolvedPagination ?? void 0,
@@ -2934,6 +2976,9 @@ function MobileCardTable({
2934
2976
  keyExtractor,
2935
2977
  itemsPerPage = 10,
2936
2978
  emptyMessage = "Nenhum item encontrado.",
2979
+ errorMessage,
2980
+ loading = false,
2981
+ loadingMessage = "Carregando dados\u2026",
2937
2982
  wrapperClassName = "",
2938
2983
  headerClassName = "",
2939
2984
  emptyClassName = "",
@@ -3008,7 +3053,7 @@ function MobileCardTable({
3008
3053
  children: headers.map((header) => /* @__PURE__ */ jsx35("span", { className: header.className, children: header.label }, header.label))
3009
3054
  }
3010
3055
  ),
3011
- pagination.totalItems > 0 ? /* @__PURE__ */ jsx35("div", { role: "list", "aria-label": "Itens da lista", children: pagination.pageData.map((item, index) => (() => {
3056
+ loading ? /* @__PURE__ */ jsx35("div", { role: "status", "aria-busy": "true", "aria-live": "polite", className: "p-6 text-center text-sm text-content-secondary", children: loadingMessage }) : errorMessage ? /* @__PURE__ */ jsx35("div", { role: "alert", className: "p-6 text-center text-sm text-field-assistive-error", children: errorMessage }) : pagination.totalItems > 0 ? /* @__PURE__ */ jsx35("div", { role: "list", "aria-label": "Itens da lista", children: pagination.pageData.map((item, index) => (() => {
3012
3057
  const rowId = expandable?.getRowId(item, index);
3013
3058
  const normalizedRowId = rowId !== void 0 ? String(rowId) : void 0;
3014
3059
  const isExpanded = normalizedRowId !== void 0 && expandable?.expandedRowId !== null && expandable?.expandedRowId !== void 0 && String(expandable.expandedRowId) === normalizedRowId;
@@ -3224,4 +3269,4 @@ export {
3224
3269
  resolveContainerBreakpoint,
3225
3270
  useContainerBreakpoint
3226
3271
  };
3227
- //# sourceMappingURL=chunk-JGCZAVYV.js.map
3272
+ //# sourceMappingURL=chunk-EA5F5GSP.js.map