@alexandregme/zljs 2.0.1 → 2.1.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/CHANGELOG.md +36 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +175 -177
- package/dist/styles/ag-grid.css +12 -31
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,40 @@ A change that needs action in an app has a **Migration** note. When updating, re
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [2.1.0] - 2026-11-03
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- `aria-label` on `DataGrid`, to name the grid for screen readers. It defaults to `Tabela de dados`
|
|
16
|
+
- `@ag-grid-community/locale` as a dependency, for the AG Grid texts
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- AG Grid moved from 35 to 36 (`ag-grid-community`, `ag-grid-react` and `@ag-grid-community/locale` 36.2.0). In Chrome, 35 rendered a `DataGrid` blank (header collapsed, rows at 0px until a window resize) when a grid was destroyed and another created in the same task, such as a route change between two pages with a grid or a Storybook story switch; 36 fixes it. AG Grid 36 also renamed its DOM classes: `ag-body-viewport` is now `ag-grid-scrolling-container`, and `ag-pinned-left-header` is now `.ag-header .ag-grid-pinned-left-cells`
|
|
21
|
+
- `DataGrid` has a minimum height of 320px, so its rows show in a parent with no height. A parent with a height smaller than that now overflows
|
|
22
|
+
- The AG Grid texts in `DataGrid` are in Brazilian Portuguese, such as `Aplicar` and `Sem linhas para mostrar`
|
|
23
|
+
- The accent color of `DataGrid` follows `--color-zl-primary`
|
|
24
|
+
- `Limpar todos` in `DataGrid` also clears the search
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- The status bar of `DataGrid` holds 4.5:1 on its text, and its filters are separated from the count by a border instead of a `|` that screen readers read out
|
|
29
|
+
- The row count of `DataGrid` is a `role="status"` with a name, so it is announced when it changes, and it no longer shows `0 / N` before the grid is ready
|
|
30
|
+
- Each remove button of an active filter in `DataGrid` is named after its column, such as `Remover filtro Nome`. They all had the same name
|
|
31
|
+
- The buttons of the column filter in `DataGrid` hold 4.5:1, and its controls and the column headers draw a real focus outline, which also shows in forced colors mode
|
|
32
|
+
- `width` on a `DataGrid` column is respected. Fitting the columns to their content replaced it
|
|
33
|
+
- A filter tag in `DataGrid` shows its value for a number of 0, a range, a date, a filter with no value and combined conditions. These showed raw JSON
|
|
34
|
+
|
|
35
|
+
### Removed
|
|
36
|
+
|
|
37
|
+
- The `.ag-theme-alpine` rules in `styles.css`. `DataGrid` never rendered that class, so they had no effect on it
|
|
38
|
+
|
|
39
|
+
#### Migration
|
|
40
|
+
|
|
41
|
+
Only for an app that renders its own AG Grid with the `ag-theme-alpine` class and relied on these rules: search for `ag-theme-alpine`, and copy the rules it needs. `DataGrid` needs nothing.
|
|
42
|
+
|
|
43
|
+
An app that lists `ag-grid-community` or `ag-grid-react` in its own `package.json` must move them to `^36.2.0` too, so a single copy of AG Grid is installed: two copies register their modules twice and warn. Search for `ag-grid` in `package.json`. An app with its own CSS or tests on the AG Grid DOM (`ag-body-viewport`, `ag-center-cols-container`, `ag-pinned-left-header`) must follow the [AG Grid 36 upgrade guide](https://www.ag-grid.com/react-data-grid/upgrading-to-ag-grid-36/). An app that uses only `DataGrid` changes nothing.
|
|
44
|
+
|
|
11
45
|
## [2.0.1] - 2026-11-03
|
|
12
46
|
|
|
13
47
|
### Changed
|
|
@@ -335,7 +369,8 @@ Replace the shade with the class of the `color` being tested, for example `/(^|\
|
|
|
335
369
|
|
|
336
370
|
The message of `Error` is `text-zl-danger`. `none` and `ghost` didn't change.
|
|
337
371
|
|
|
338
|
-
[Unreleased]: https://github.com/alexandregme/zljs/compare/v2.0
|
|
372
|
+
[Unreleased]: https://github.com/alexandregme/zljs/compare/v2.1.0...HEAD
|
|
373
|
+
[2.1.0]: https://github.com/alexandregme/zljs/compare/v2.0.1...v2.1.0
|
|
339
374
|
[2.0.1]: https://github.com/alexandregme/zljs/compare/v2.0.0...v2.0.1
|
|
340
375
|
[2.0.0]: https://github.com/alexandregme/zljs/compare/v1.19.1...v2.0.0
|
|
341
376
|
[1.19.1]: https://github.com/alexandregme/zljs/compare/v1.19.0...v1.19.1
|
package/dist/index.d.ts
CHANGED
|
@@ -58,9 +58,10 @@ interface DataGridProps<T extends Record<string, unknown> = Record<string, unkno
|
|
|
58
58
|
columns: DataGridColumn<T>[];
|
|
59
59
|
data: T[];
|
|
60
60
|
showSearch?: boolean;
|
|
61
|
+
"aria-label"?: string;
|
|
61
62
|
}
|
|
62
63
|
|
|
63
|
-
declare const DataGrid: <T extends Record<string, unknown> = Record<string, unknown>>({ columns, data, showSearch, }: DataGridProps<T>) => react.JSX.Element;
|
|
64
|
+
declare const DataGrid: <T extends Record<string, unknown> = Record<string, unknown>>({ columns, data, showSearch, "aria-label": ariaLabel, }: DataGridProps<T>) => react.JSX.Element;
|
|
64
65
|
|
|
65
66
|
type CheckboxVariant = "default" | "card";
|
|
66
67
|
interface CheckboxProps {
|
package/dist/index.js
CHANGED
|
@@ -176,15 +176,9 @@ var Button = ({
|
|
|
176
176
|
};
|
|
177
177
|
|
|
178
178
|
// core/data-grid/data-grid.tsx
|
|
179
|
-
import {
|
|
180
|
-
|
|
181
|
-
ModuleRegistry,
|
|
182
|
-
themeAlpine
|
|
183
|
-
} from "ag-grid-community";
|
|
179
|
+
import { AG_GRID_LOCALE_BR } from "@ag-grid-community/locale";
|
|
180
|
+
import { AllCommunityModule, ModuleRegistry } from "ag-grid-community";
|
|
184
181
|
import { AgGridReact } from "ag-grid-react";
|
|
185
|
-
import { useState as useState2, useCallback } from "react";
|
|
186
|
-
|
|
187
|
-
// core/data-grid/data-grid-toolbar.tsx
|
|
188
182
|
import { useState } from "react";
|
|
189
183
|
|
|
190
184
|
// core/forms/checkbox/checkbox.tsx
|
|
@@ -459,18 +453,15 @@ var TextArea = ({
|
|
|
459
453
|
|
|
460
454
|
// core/data-grid/data-grid-toolbar.tsx
|
|
461
455
|
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
462
|
-
var DataGridToolbar = ({
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
setSearchTerm("");
|
|
469
|
-
gridApi?.setGridOption("quickFilterText", "");
|
|
470
|
-
};
|
|
456
|
+
var DataGridToolbar = ({
|
|
457
|
+
searchTerm,
|
|
458
|
+
onSearchTermChange,
|
|
459
|
+
onSearch,
|
|
460
|
+
onClear
|
|
461
|
+
}) => {
|
|
471
462
|
const handleKeyDown = (e) => {
|
|
472
463
|
if (e.key === "Enter") {
|
|
473
|
-
|
|
464
|
+
onSearch();
|
|
474
465
|
}
|
|
475
466
|
};
|
|
476
467
|
return /* @__PURE__ */ jsxs6(
|
|
@@ -485,12 +476,12 @@ var DataGridToolbar = ({ gridApi }) => {
|
|
|
485
476
|
"aria-label": "Buscar na tabela",
|
|
486
477
|
placeholder: "Buscar...",
|
|
487
478
|
value: searchTerm,
|
|
488
|
-
onChange: (e) =>
|
|
479
|
+
onChange: (e) => onSearchTermChange(e.target.value),
|
|
489
480
|
onKeyDown: handleKeyDown
|
|
490
481
|
}
|
|
491
482
|
),
|
|
492
|
-
/* @__PURE__ */ jsx7(Button, { icon: "Search", color: "primary", onClick:
|
|
493
|
-
/* @__PURE__ */ jsx7(Button, { icon: "X", color: "danger", onClick:
|
|
483
|
+
/* @__PURE__ */ jsx7(Button, { icon: "Search", color: "primary", onClick: onSearch, children: "Buscar" }),
|
|
484
|
+
/* @__PURE__ */ jsx7(Button, { icon: "X", color: "danger", onClick: onClear, children: "Limpar" })
|
|
494
485
|
]
|
|
495
486
|
}
|
|
496
487
|
);
|
|
@@ -547,175 +538,182 @@ var DataGridStatusBar = ({
|
|
|
547
538
|
totalRows,
|
|
548
539
|
displayedRows,
|
|
549
540
|
activeFilters,
|
|
550
|
-
|
|
541
|
+
onClearFilter,
|
|
542
|
+
onClearAll
|
|
551
543
|
}) => {
|
|
552
544
|
const isFiltered = displayedRows !== totalRows || activeFilters.length > 0;
|
|
553
|
-
const
|
|
554
|
-
if (!gridApi) return;
|
|
555
|
-
const filterInstance = gridApi.getColumnFilterInstance(column);
|
|
556
|
-
if (filterInstance) {
|
|
557
|
-
filterInstance.then((filter) => {
|
|
558
|
-
filter?.setModel(null);
|
|
559
|
-
gridApi.onFilterChanged();
|
|
560
|
-
});
|
|
561
|
-
}
|
|
562
|
-
};
|
|
563
|
-
const handleClearAllFilters = () => {
|
|
564
|
-
if (!gridApi) return;
|
|
565
|
-
gridApi.setFilterModel(null);
|
|
566
|
-
};
|
|
545
|
+
const count = isFiltered ? `${displayedRows} / ${totalRows} registros` : `${totalRows} registros`;
|
|
567
546
|
return /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-3 px-2 py-1.5 bg-slate-100 border border-slate-200 rounded text-sm text-slate-600 mb-2", children: [
|
|
568
|
-
/* @__PURE__ */
|
|
569
|
-
/* @__PURE__ */
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
/* @__PURE__ */ jsx9(
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
},
|
|
593
|
-
filter.column
|
|
594
|
-
)),
|
|
595
|
-
/* @__PURE__ */ jsx9(Button, { variant: "link", color: "none", onClick: handleClearAllFilters, children: "Limpar todos" })
|
|
596
|
-
] })
|
|
597
|
-
] })
|
|
547
|
+
/* @__PURE__ */ jsxs8("span", { role: "status", "aria-label": count, className: "font-medium", children: [
|
|
548
|
+
isFiltered && /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
549
|
+
/* @__PURE__ */ jsx9(Text, { as: "span", variant: "caption", color: "primary", children: displayedRows }),
|
|
550
|
+
" ",
|
|
551
|
+
/* @__PURE__ */ jsx9(Text, { as: "span", variant: "caption", children: "/" }),
|
|
552
|
+
" "
|
|
553
|
+
] }),
|
|
554
|
+
/* @__PURE__ */ jsx9(Text, { as: "span", variant: "caption", children: totalRows }),
|
|
555
|
+
" ",
|
|
556
|
+
/* @__PURE__ */ jsx9(Text, { as: "span", variant: "caption", children: "registros" })
|
|
557
|
+
] }),
|
|
558
|
+
activeFilters.length > 0 && /* @__PURE__ */ jsx9(Fragment2, { children: /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2 flex-wrap border-l border-slate-300 pl-3", children: [
|
|
559
|
+
/* @__PURE__ */ jsx9(Text, { as: "span", variant: "caption", children: "Filtros:" }),
|
|
560
|
+
activeFilters.map((filter) => /* @__PURE__ */ jsx9(
|
|
561
|
+
Tag,
|
|
562
|
+
{
|
|
563
|
+
onRemove: () => onClearFilter(filter.column),
|
|
564
|
+
removeLabel: `Remover filtro ${filter.headerName}`,
|
|
565
|
+
children: `${filter.headerName}: ${filter.value}`
|
|
566
|
+
},
|
|
567
|
+
filter.column
|
|
568
|
+
)),
|
|
569
|
+
/* @__PURE__ */ jsx9(Button, { variant: "link", color: "none", onClick: onClearAll, children: "Limpar todos" })
|
|
570
|
+
] }) })
|
|
598
571
|
] });
|
|
599
572
|
};
|
|
600
573
|
|
|
601
|
-
// core/data-grid/data-grid.
|
|
602
|
-
import {
|
|
603
|
-
|
|
604
|
-
var tailwind = {
|
|
574
|
+
// core/data-grid/data-grid.const.ts
|
|
575
|
+
import { themeAlpine } from "ag-grid-community";
|
|
576
|
+
var dataGridPalette = {
|
|
605
577
|
slate: {
|
|
606
578
|
50: "#f8fafc",
|
|
607
|
-
100: "#f1f5f9",
|
|
608
579
|
200: "#e2e8f0",
|
|
609
580
|
600: "#475569",
|
|
610
|
-
700: "#334155"
|
|
611
|
-
800: "#1e293b"
|
|
581
|
+
700: "#334155"
|
|
612
582
|
},
|
|
613
583
|
sky: {
|
|
614
|
-
50: "#f0f9ff",
|
|
615
584
|
100: "#e0f2fe"
|
|
616
585
|
},
|
|
617
586
|
blue: {
|
|
618
587
|
100: "#dbeafe"
|
|
619
588
|
}
|
|
620
589
|
};
|
|
621
|
-
var
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
590
|
+
var dataGridTheme = themeAlpine.withParams({
|
|
591
|
+
accentColor: "var(--color-zl-primary)",
|
|
592
|
+
headerBackgroundColor: dataGridPalette.slate[700],
|
|
593
|
+
headerTextColor: dataGridPalette.slate[50],
|
|
594
|
+
oddRowBackgroundColor: dataGridPalette.slate[50],
|
|
595
|
+
rowHoverColor: dataGridPalette.sky[100],
|
|
596
|
+
selectedRowBackgroundColor: dataGridPalette.blue[100],
|
|
597
|
+
borderColor: dataGridPalette.slate[200],
|
|
598
|
+
headerColumnBorder: dataGridPalette.slate[600],
|
|
629
599
|
fontSize: 13,
|
|
630
600
|
headerHeight: 36,
|
|
631
601
|
rowHeight: 32,
|
|
632
602
|
cellHorizontalPadding: 8
|
|
633
603
|
});
|
|
604
|
+
|
|
605
|
+
// core/data-grid/data-grid.styles.ts
|
|
606
|
+
import { tv as tv8 } from "tailwind-variants";
|
|
607
|
+
var dataGrid = tv8({
|
|
608
|
+
slots: {
|
|
609
|
+
base: "grid grid-rows-[auto_auto_1fr] grid-cols-1 h-full w-full",
|
|
610
|
+
table: "ag-grid h-full min-h-80 w-full z-0"
|
|
611
|
+
}
|
|
612
|
+
});
|
|
613
|
+
|
|
614
|
+
// core/data-grid/data-grid.tsx
|
|
615
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
616
|
+
ModuleRegistry.registerModules([AllCommunityModule]);
|
|
634
617
|
var DataGrid = ({
|
|
635
618
|
columns,
|
|
636
619
|
data,
|
|
637
|
-
showSearch = true
|
|
620
|
+
showSearch = true,
|
|
621
|
+
"aria-label": ariaLabel = "Tabela de dados"
|
|
638
622
|
}) => {
|
|
639
|
-
const [gridApi, setGridApi] =
|
|
640
|
-
const [
|
|
641
|
-
const [
|
|
642
|
-
const
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
const headerName = colDef?.headerName || colId;
|
|
651
|
-
const filterValue = model?.filter || model?.values?.join(", ") || JSON.stringify(model);
|
|
652
|
-
filters.push({
|
|
653
|
-
column: colId,
|
|
654
|
-
headerName,
|
|
655
|
-
value: filterValue
|
|
656
|
-
});
|
|
657
|
-
});
|
|
658
|
-
}
|
|
659
|
-
setActiveFilters(filters);
|
|
660
|
-
},
|
|
661
|
-
[columns]
|
|
662
|
-
);
|
|
663
|
-
const handleGridReady = (params) => {
|
|
664
|
-
setGridApi(params.api);
|
|
665
|
-
setDisplayedRows(params.api.getDisplayedRowCount());
|
|
623
|
+
const [gridApi, setGridApi] = useState(null);
|
|
624
|
+
const [searchTerm, setSearchTerm] = useState("");
|
|
625
|
+
const [displayedRows, setDisplayedRows] = useState(data.length);
|
|
626
|
+
const [activeFilters, setActiveFilters] = useState([]);
|
|
627
|
+
const columnDefs = columns.map((column) => ({
|
|
628
|
+
...column,
|
|
629
|
+
suppressAutoSize: column.width !== void 0
|
|
630
|
+
}));
|
|
631
|
+
const handleGridReady = ({ api }) => {
|
|
632
|
+
api.setGridAriaProperty("label", ariaLabel);
|
|
633
|
+
setGridApi(api);
|
|
666
634
|
};
|
|
667
|
-
const handleFilterChanged =
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
635
|
+
const handleFilterChanged = async ({ api }) => {
|
|
636
|
+
const filters = await Promise.all(
|
|
637
|
+
Object.entries(api.getFilterModel()).map(
|
|
638
|
+
async ([column, model]) => ({
|
|
639
|
+
column,
|
|
640
|
+
headerName: api.getDisplayNameForColumn(
|
|
641
|
+
api.getColumn(column),
|
|
642
|
+
"header"
|
|
643
|
+
),
|
|
644
|
+
value: (await api.getColumnFilterInstance(column)).getModelAsString(
|
|
645
|
+
model
|
|
646
|
+
)
|
|
647
|
+
})
|
|
648
|
+
)
|
|
649
|
+
);
|
|
650
|
+
setActiveFilters(filters);
|
|
651
|
+
};
|
|
652
|
+
const handleModelUpdated = ({ api }) => {
|
|
653
|
+
setDisplayedRows(api.getDisplayedRowCount());
|
|
654
|
+
};
|
|
655
|
+
const handleSearch = () => {
|
|
656
|
+
gridApi?.setGridOption("quickFilterText", searchTerm);
|
|
657
|
+
};
|
|
658
|
+
const handleClearSearch = () => {
|
|
659
|
+
setSearchTerm("");
|
|
660
|
+
gridApi?.setGridOption("quickFilterText", "");
|
|
661
|
+
};
|
|
662
|
+
const handleClearFilter = (column) => {
|
|
663
|
+
gridApi?.setColumnFilterModel(column, null).then(() => {
|
|
664
|
+
gridApi.onFilterChanged();
|
|
665
|
+
});
|
|
666
|
+
};
|
|
667
|
+
const handleClearAll = () => {
|
|
668
|
+
handleClearSearch();
|
|
669
|
+
gridApi?.setFilterModel(null);
|
|
670
|
+
};
|
|
671
|
+
const { base, table } = dataGrid();
|
|
672
|
+
return /* @__PURE__ */ jsxs9("div", { "data-testid": "data-grid", className: base(), children: [
|
|
673
|
+
showSearch && /* @__PURE__ */ jsx10(
|
|
674
|
+
DataGridToolbar,
|
|
675
|
+
{
|
|
676
|
+
searchTerm,
|
|
677
|
+
onSearchTermChange: setSearchTerm,
|
|
678
|
+
onSearch: handleSearch,
|
|
679
|
+
onClear: handleClearSearch
|
|
680
|
+
}
|
|
681
|
+
),
|
|
682
|
+
/* @__PURE__ */ jsx10(
|
|
683
|
+
DataGridStatusBar,
|
|
684
|
+
{
|
|
685
|
+
totalRows: data.length,
|
|
686
|
+
displayedRows,
|
|
687
|
+
activeFilters,
|
|
688
|
+
onClearFilter: handleClearFilter,
|
|
689
|
+
onClearAll: handleClearAll
|
|
690
|
+
}
|
|
691
|
+
),
|
|
692
|
+
/* @__PURE__ */ jsx10("div", { className: table(), children: /* @__PURE__ */ jsx10(
|
|
693
|
+
AgGridReact,
|
|
694
|
+
{
|
|
695
|
+
theme: dataGridTheme,
|
|
696
|
+
columnDefs,
|
|
697
|
+
rowData: data,
|
|
698
|
+
domLayout: "normal",
|
|
699
|
+
autoSizeStrategy: { type: "fitCellContents" },
|
|
700
|
+
localeText: AG_GRID_LOCALE_BR,
|
|
701
|
+
onGridReady: handleGridReady,
|
|
702
|
+
onFilterChanged: handleFilterChanged,
|
|
703
|
+
onModelUpdated: handleModelUpdated,
|
|
704
|
+
defaultColDef: {
|
|
705
|
+
filterParams: {
|
|
706
|
+
buttons: ["reset", "apply"]
|
|
709
707
|
}
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
}
|
|
713
|
-
);
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
) })
|
|
711
|
+
] });
|
|
714
712
|
};
|
|
715
713
|
|
|
716
714
|
// core/stats-card/stats-card.styles.ts
|
|
717
|
-
import { tv as
|
|
718
|
-
var statsCard =
|
|
715
|
+
import { tv as tv9 } from "tailwind-variants";
|
|
716
|
+
var statsCard = tv9({
|
|
719
717
|
base: "p-4 rounded-lg",
|
|
720
718
|
variants: {
|
|
721
719
|
color: {
|
|
@@ -742,11 +740,11 @@ var StatsCard = ({ label: label5, value, color }) => {
|
|
|
742
740
|
import * as Dialog from "@radix-ui/react-dialog";
|
|
743
741
|
|
|
744
742
|
// core/modal/modal.styles.ts
|
|
745
|
-
import { tv as
|
|
746
|
-
var overlay =
|
|
743
|
+
import { tv as tv10 } from "tailwind-variants";
|
|
744
|
+
var overlay = tv10({
|
|
747
745
|
base: "fixed inset-0 bg-black/50"
|
|
748
746
|
});
|
|
749
|
-
var content =
|
|
747
|
+
var content = tv10({
|
|
750
748
|
base: "fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-white rounded-lg shadow-lg p-6 w-full focus:outline-none max-h-[90vh] overflow-y-auto",
|
|
751
749
|
variants: {
|
|
752
750
|
size: {
|
|
@@ -761,16 +759,16 @@ var content = tv9({
|
|
|
761
759
|
size: "md"
|
|
762
760
|
}
|
|
763
761
|
});
|
|
764
|
-
var header =
|
|
762
|
+
var header = tv10({
|
|
765
763
|
base: "flex items-start justify-between"
|
|
766
764
|
});
|
|
767
|
-
var title =
|
|
765
|
+
var title = tv10({
|
|
768
766
|
base: "text-lg font-semibold text-gray-900 m-0"
|
|
769
767
|
});
|
|
770
|
-
var description =
|
|
768
|
+
var description = tv10({
|
|
771
769
|
base: "text-sm text-gray-600 mt-2"
|
|
772
770
|
});
|
|
773
|
-
var body =
|
|
771
|
+
var body = tv10({
|
|
774
772
|
base: "mt-4"
|
|
775
773
|
});
|
|
776
774
|
|
|
@@ -839,12 +837,12 @@ var WhatsAppButton = ({
|
|
|
839
837
|
};
|
|
840
838
|
|
|
841
839
|
// core/sidebar/sidebar.tsx
|
|
842
|
-
import { useState as
|
|
840
|
+
import { useState as useState2 } from "react";
|
|
843
841
|
import Link from "next/link.js";
|
|
844
842
|
|
|
845
843
|
// core/sidebar/sidebar.styles.ts
|
|
846
|
-
import { tv as
|
|
847
|
-
var sidebar =
|
|
844
|
+
import { tv as tv11 } from "tailwind-variants";
|
|
845
|
+
var sidebar = tv11({
|
|
848
846
|
base: "h-screen bg-neutral-800 text-neutral-300 flex flex-col overflow-hidden transition-all duration-200 divide-y divide-neutral-600/50",
|
|
849
847
|
variants: {
|
|
850
848
|
collapsed: {
|
|
@@ -856,16 +854,16 @@ var sidebar = tv10({
|
|
|
856
854
|
collapsed: false
|
|
857
855
|
}
|
|
858
856
|
});
|
|
859
|
-
var nav =
|
|
857
|
+
var nav = tv11({
|
|
860
858
|
base: "flex-1 min-h-0 overflow-y-auto overflow-x-hidden divide-y divide-neutral-600/50"
|
|
861
859
|
});
|
|
862
|
-
var header2 =
|
|
860
|
+
var header2 = tv11({
|
|
863
861
|
base: "shrink-0 p-2"
|
|
864
862
|
});
|
|
865
|
-
var section =
|
|
863
|
+
var section = tv11({
|
|
866
864
|
base: "grid gap-1 p-2"
|
|
867
865
|
});
|
|
868
|
-
var item =
|
|
866
|
+
var item = tv11({
|
|
869
867
|
// [&>*+*] is the label: Text takes no className, and the icon comes first, so a link with no label has nothing to hide.
|
|
870
868
|
base: "flex items-center rounded-md transition-colors h-10 px-3 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-current [&>*+*]:truncate [&>*+*]:transition-all [&>*+*]:duration-200",
|
|
871
869
|
variants: {
|
|
@@ -883,7 +881,7 @@ var item = tv10({
|
|
|
883
881
|
collapsed: false
|
|
884
882
|
}
|
|
885
883
|
});
|
|
886
|
-
var footer =
|
|
884
|
+
var footer = tv11({
|
|
887
885
|
base: "shrink-0 h-16 p-3 flex items-center gap-3",
|
|
888
886
|
variants: {
|
|
889
887
|
collapsed: {
|
|
@@ -891,13 +889,13 @@ var footer = tv10({
|
|
|
891
889
|
}
|
|
892
890
|
}
|
|
893
891
|
});
|
|
894
|
-
var avatar =
|
|
892
|
+
var avatar = tv11({
|
|
895
893
|
base: "shrink-0 size-8 rounded-full bg-neutral-600 text-white text-xs font-medium flex items-center justify-center"
|
|
896
894
|
});
|
|
897
|
-
var userInfo =
|
|
895
|
+
var userInfo = tv11({
|
|
898
896
|
base: "flex flex-col min-w-0 text-white [&>*]:truncate [&>*:last-child]:text-xs [&>*:last-child]:text-neutral-400"
|
|
899
897
|
});
|
|
900
|
-
var toggleButton =
|
|
898
|
+
var toggleButton = tv11({
|
|
901
899
|
base: "shrink-0 h-14 grid p-2 [&>button]:justify-start [&>button]:px-3 [&>button]:overflow-hidden [&>button]:whitespace-nowrap"
|
|
902
900
|
});
|
|
903
901
|
|
|
@@ -920,7 +918,7 @@ var Sidebar = ({
|
|
|
920
918
|
homeLabel,
|
|
921
919
|
onLogout
|
|
922
920
|
}) => {
|
|
923
|
-
const [collapsed, setCollapsed] =
|
|
921
|
+
const [collapsed, setCollapsed] = useState2(defaultCollapsed);
|
|
924
922
|
const initials = getInitials(user.name);
|
|
925
923
|
return /* @__PURE__ */ jsxs12("aside", { className: sidebar({ collapsed }), children: [
|
|
926
924
|
homeHref && /* @__PURE__ */ jsx14("div", { className: header2(), children: /* @__PURE__ */ jsxs12(
|
package/dist/styles/ag-grid.css
CHANGED
|
@@ -1,32 +1,13 @@
|
|
|
1
|
-
/* AG Grid
|
|
2
|
-
.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
--
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
.ag-theme-alpine .ag-header-cell {
|
|
15
|
-
font-weight: 600;
|
|
16
|
-
text-transform: uppercase;
|
|
17
|
-
font-size: 12px;
|
|
18
|
-
letter-spacing: 0.05em;
|
|
19
|
-
border-right: 1px solid #475569;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.ag-theme-alpine .ag-header-cell:last-child {
|
|
23
|
-
border-right: none;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.ag-theme-alpine .ag-row {
|
|
27
|
-
border-bottom: 1px solid #f1f5f9;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.ag-theme-alpine .ag-row:hover {
|
|
31
|
-
background-color: var(--ag-row-hover-color);
|
|
1
|
+
/* AG Grid draws focus with a box-shadow, which forced colors mode drops. The
|
|
2
|
+
header is dark, so its outline follows its text. */
|
|
3
|
+
.ag-grid .ag-header-cell:focus-visible {
|
|
4
|
+
outline: 2px solid currentColor;
|
|
5
|
+
outline-offset: -2px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.ag-grid .ag-standard-button:focus-visible,
|
|
9
|
+
.ag-grid .ag-picker-field-wrapper:focus-visible,
|
|
10
|
+
.ag-grid .ag-input-field-input:focus-visible {
|
|
11
|
+
outline: 2px solid var(--color-zl-primary);
|
|
12
|
+
outline-offset: 2px;
|
|
32
13
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alexandregme/zljs",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Opinionated, accessible React component library for enterprise apps (Next.js, Tailwind CSS v4).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -72,10 +72,11 @@
|
|
|
72
72
|
"prepublishOnly": "pnpm build:lib"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
+
"@ag-grid-community/locale": "^36.2.0",
|
|
75
76
|
"@hookform/resolvers": "^5.2.2",
|
|
76
77
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
77
|
-
"ag-grid-community": "^
|
|
78
|
-
"ag-grid-react": "^
|
|
78
|
+
"ag-grid-community": "^36.2.0",
|
|
79
|
+
"ag-grid-react": "^36.2.0",
|
|
79
80
|
"axios": "^1.13.5",
|
|
80
81
|
"lucide-react": "^0.563.0",
|
|
81
82
|
"react-hook-form": "^7.70.0",
|