@proounce/shared-common 0.0.0-stage → 0.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.
@@ -0,0 +1,45 @@
1
+ import * as react from 'react';
2
+ import { CSSProperties, ReactNode } from 'react';
3
+ import { ColDef, GetRowIdParams, Module, IHeaderParams } from 'ag-grid-community';
4
+ export { ColDef, ColGroupDef, GridApi, GridOptions, ICellRendererParams, IHeaderParams, RowSelectionOptions } from 'ag-grid-community';
5
+ import { AgGridReactProps } from 'ag-grid-react';
6
+ import { BoxProps } from '@mui/material/Box';
7
+
8
+ interface CustomGridTableProps<Row extends object> extends Omit<AgGridReactProps<Row>, "columnDefs" | "rowData" | "pinnedBottomRowData" | "defaultColDef" | "onSelectionChanged" | "pagination" | "paginationPageSize" | "paginationPageSizeSelector" | "rowSelection" | "modules" | "getRowId"> {
9
+ columns?: readonly ColDef<Row>[];
10
+ data?: readonly Row[];
11
+ totals?: readonly Row[];
12
+ loading?: boolean;
13
+ enableSelection?: boolean;
14
+ onSelect?: (rows: Row[]) => void;
15
+ height?: CSSProperties["height"];
16
+ minHeight?: CSSProperties["minHeight"];
17
+ defaultColDef?: ColDef<Row>;
18
+ pagination?: boolean;
19
+ paginationPageSize?: number;
20
+ paginationPageSizeSelector?: readonly number[];
21
+ getRowId?: (params: GetRowIdParams<Row>) => string;
22
+ modules?: Module[];
23
+ ariaLabel?: string;
24
+ }
25
+ /**
26
+ * Optional AG Grid Community wrapper. Import only from the ag-grid subpath so
27
+ * regular shared-component consumers do not load AG Grid.
28
+ */
29
+ declare function CustomGridTableComponent<Row extends object>({ columns, data, totals, loading, enableSelection, onSelect, height, minHeight, defaultColDef, pagination, paginationPageSize, paginationPageSizeSelector, getRowId, modules, ariaLabel, ...gridProps }: CustomGridTableProps<Row>): react.JSX.Element;
30
+ declare const CustomGridTable: typeof CustomGridTableComponent;
31
+ declare const AgGridTable: typeof CustomGridTableComponent;
32
+
33
+ interface CustomGridHeaderCellWithInfoProps<Row = unknown> extends IHeaderParams<Row> {
34
+ title?: ReactNode;
35
+ info?: ReactNode;
36
+ infoLabel?: string;
37
+ formula?: ReactNode;
38
+ formulaLabel?: string;
39
+ }
40
+ /** Accessible sortable AG Grid header with optional information and formula help. */
41
+ declare function CustomGridHeaderCellWithInfo<Row = unknown>({ displayName, title, info, infoLabel, formula, formulaLabel, column, enableSorting, progressSort, }: CustomGridHeaderCellWithInfoProps<Row>): react.JSX.Element;
42
+
43
+ declare function CustomGridTableWrapper({ children, sx, ...props }: BoxProps): react.JSX.Element;
44
+
45
+ export { AgGridTable, CustomGridHeaderCellWithInfo, type CustomGridHeaderCellWithInfoProps, CustomGridTable, CustomGridTableComponent, type CustomGridTableProps, CustomGridTableWrapper };
@@ -0,0 +1,45 @@
1
+ import * as react from 'react';
2
+ import { CSSProperties, ReactNode } from 'react';
3
+ import { ColDef, GetRowIdParams, Module, IHeaderParams } from 'ag-grid-community';
4
+ export { ColDef, ColGroupDef, GridApi, GridOptions, ICellRendererParams, IHeaderParams, RowSelectionOptions } from 'ag-grid-community';
5
+ import { AgGridReactProps } from 'ag-grid-react';
6
+ import { BoxProps } from '@mui/material/Box';
7
+
8
+ interface CustomGridTableProps<Row extends object> extends Omit<AgGridReactProps<Row>, "columnDefs" | "rowData" | "pinnedBottomRowData" | "defaultColDef" | "onSelectionChanged" | "pagination" | "paginationPageSize" | "paginationPageSizeSelector" | "rowSelection" | "modules" | "getRowId"> {
9
+ columns?: readonly ColDef<Row>[];
10
+ data?: readonly Row[];
11
+ totals?: readonly Row[];
12
+ loading?: boolean;
13
+ enableSelection?: boolean;
14
+ onSelect?: (rows: Row[]) => void;
15
+ height?: CSSProperties["height"];
16
+ minHeight?: CSSProperties["minHeight"];
17
+ defaultColDef?: ColDef<Row>;
18
+ pagination?: boolean;
19
+ paginationPageSize?: number;
20
+ paginationPageSizeSelector?: readonly number[];
21
+ getRowId?: (params: GetRowIdParams<Row>) => string;
22
+ modules?: Module[];
23
+ ariaLabel?: string;
24
+ }
25
+ /**
26
+ * Optional AG Grid Community wrapper. Import only from the ag-grid subpath so
27
+ * regular shared-component consumers do not load AG Grid.
28
+ */
29
+ declare function CustomGridTableComponent<Row extends object>({ columns, data, totals, loading, enableSelection, onSelect, height, minHeight, defaultColDef, pagination, paginationPageSize, paginationPageSizeSelector, getRowId, modules, ariaLabel, ...gridProps }: CustomGridTableProps<Row>): react.JSX.Element;
30
+ declare const CustomGridTable: typeof CustomGridTableComponent;
31
+ declare const AgGridTable: typeof CustomGridTableComponent;
32
+
33
+ interface CustomGridHeaderCellWithInfoProps<Row = unknown> extends IHeaderParams<Row> {
34
+ title?: ReactNode;
35
+ info?: ReactNode;
36
+ infoLabel?: string;
37
+ formula?: ReactNode;
38
+ formulaLabel?: string;
39
+ }
40
+ /** Accessible sortable AG Grid header with optional information and formula help. */
41
+ declare function CustomGridHeaderCellWithInfo<Row = unknown>({ displayName, title, info, infoLabel, formula, formulaLabel, column, enableSorting, progressSort, }: CustomGridHeaderCellWithInfoProps<Row>): react.JSX.Element;
42
+
43
+ declare function CustomGridTableWrapper({ children, sx, ...props }: BoxProps): react.JSX.Element;
44
+
45
+ export { AgGridTable, CustomGridHeaderCellWithInfo, type CustomGridHeaderCellWithInfoProps, CustomGridTable, CustomGridTableComponent, type CustomGridTableProps, CustomGridTableWrapper };
@@ -0,0 +1,152 @@
1
+ import { AllCommunityModule } from 'ag-grid-community';
2
+ import { AgGridReact } from 'ag-grid-react';
3
+ import { memo, useMemo, useCallback } from 'react';
4
+ import { jsx, jsxs } from 'react/jsx-runtime';
5
+ import FunctionsIcon from '@mui/icons-material/Functions';
6
+ import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
7
+ import Stack from '@mui/material/Stack';
8
+ import Tooltip from '@mui/material/Tooltip';
9
+ import IconButton from '@mui/material/IconButton';
10
+ import Box from '@mui/material/Box';
11
+
12
+ // src/grids/ag-grid/CustomAgGrid.tsx
13
+ var DEFAULT_AG_GRID_MODULES = [AllCommunityModule];
14
+ function CustomGridTableComponent({
15
+ columns = [],
16
+ data = [],
17
+ totals = [],
18
+ loading = false,
19
+ enableSelection = false,
20
+ onSelect,
21
+ height = 500,
22
+ minHeight = 240,
23
+ defaultColDef,
24
+ pagination,
25
+ paginationPageSize = 25,
26
+ paginationPageSizeSelector = [5, 10, 25, 50, 75, 100],
27
+ getRowId,
28
+ modules = DEFAULT_AG_GRID_MODULES,
29
+ ariaLabel = "Data grid",
30
+ ...gridProps
31
+ }) {
32
+ const resolvedDefaultColDef = useMemo(
33
+ () => ({
34
+ flex: 1,
35
+ minWidth: 160,
36
+ resizable: true,
37
+ sortable: true,
38
+ wrapText: true,
39
+ autoHeight: true,
40
+ ...defaultColDef
41
+ }),
42
+ [defaultColDef]
43
+ );
44
+ const rowSelection = useMemo(
45
+ () => enableSelection ? {
46
+ mode: "multiRow",
47
+ checkboxes: true,
48
+ headerCheckbox: true,
49
+ enableClickSelection: false,
50
+ selectAll: "filtered"
51
+ } : void 0,
52
+ [enableSelection]
53
+ );
54
+ const enablePagination = pagination ?? data.length > 50;
55
+ const handleSelection = useCallback(
56
+ (event) => onSelect?.(event.api.getSelectedRows()),
57
+ [onSelect]
58
+ );
59
+ return /* @__PURE__ */ jsx(
60
+ "div",
61
+ {
62
+ "aria-label": ariaLabel,
63
+ role: "region",
64
+ style: { width: "100%", height, minHeight },
65
+ children: /* @__PURE__ */ jsx(
66
+ AgGridReact,
67
+ {
68
+ modules,
69
+ rowData: [...data],
70
+ columnDefs: [...columns],
71
+ pinnedBottomRowData: [...totals],
72
+ defaultColDef: resolvedDefaultColDef,
73
+ loading,
74
+ pagination: enablePagination,
75
+ paginationPageSize,
76
+ paginationPageSizeSelector: [...paginationPageSizeSelector],
77
+ ...rowSelection ? { rowSelection } : {},
78
+ onSelectionChanged: handleSelection,
79
+ animateRows: false,
80
+ suppressDragLeaveHidesColumns: true,
81
+ ...getRowId ? { getRowId } : {},
82
+ ...gridProps
83
+ }
84
+ )
85
+ }
86
+ );
87
+ }
88
+ var CustomGridTable = memo(
89
+ CustomGridTableComponent
90
+ );
91
+ var AgGridTable = CustomGridTable;
92
+ function SharedIconButton({ sx, ...props }) {
93
+ return /* @__PURE__ */ jsx(
94
+ IconButton,
95
+ {
96
+ sx: { width: 40, height: 40, borderRadius: 1, ...sx },
97
+ ...props
98
+ }
99
+ );
100
+ }
101
+ function CustomGridHeaderCellWithInfo({
102
+ displayName,
103
+ title,
104
+ info,
105
+ infoLabel = "Column information",
106
+ formula,
107
+ formulaLabel = "Column formula",
108
+ column,
109
+ enableSorting,
110
+ progressSort
111
+ }) {
112
+ const sort = column.getSort();
113
+ const headerTitle = title ?? displayName;
114
+ const sortLabel = sort ? `${String(headerTitle)}, sorted ${sort === "asc" ? "ascending" : "descending"}` : `${String(headerTitle)}, not sorted`;
115
+ const requestSort = (event) => {
116
+ if (enableSorting) progressSort(event.shiftKey);
117
+ };
118
+ return /* @__PURE__ */ jsxs(Stack, { direction: "row", alignItems: "center", spacing: 0.5, width: "100%", children: [
119
+ /* @__PURE__ */ jsxs(
120
+ "button",
121
+ {
122
+ type: "button",
123
+ disabled: !enableSorting,
124
+ "aria-label": sortLabel,
125
+ onClick: requestSort,
126
+ style: {
127
+ appearance: "none",
128
+ border: 0,
129
+ background: "transparent",
130
+ color: "inherit",
131
+ font: "inherit",
132
+ fontWeight: 600,
133
+ cursor: enableSorting ? "pointer" : "default",
134
+ padding: 4
135
+ },
136
+ children: [
137
+ headerTitle,
138
+ sort === "asc" ? " \u25B2" : sort === "desc" ? " \u25BC" : ""
139
+ ]
140
+ }
141
+ ),
142
+ info ? /* @__PURE__ */ jsx(Tooltip, { title: info, arrow: true, children: /* @__PURE__ */ jsx(SharedIconButton, { "aria-label": infoLabel, size: "small", children: /* @__PURE__ */ jsx(InfoOutlinedIcon, { fontSize: "small" }) }) }) : null,
143
+ formula ? /* @__PURE__ */ jsx(Tooltip, { title: formula, arrow: true, children: /* @__PURE__ */ jsx(SharedIconButton, { "aria-label": formulaLabel, size: "small", children: /* @__PURE__ */ jsx(FunctionsIcon, { fontSize: "small" }) }) }) : null
144
+ ] });
145
+ }
146
+ function CustomGridTableWrapper({ children, sx, ...props }) {
147
+ return /* @__PURE__ */ jsx(Box, { width: "100%", p: 1.5, mb: 0.5, sx, ...props, children });
148
+ }
149
+
150
+ export { AgGridTable, CustomGridHeaderCellWithInfo, CustomGridTable, CustomGridTableComponent, CustomGridTableWrapper };
151
+ //# sourceMappingURL=ag-grid.js.map
152
+ //# sourceMappingURL=ag-grid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/grids/ag-grid/CustomAgGrid.tsx","../../src/buttons/SharedIconButton.tsx","../../src/grids/ag-grid/CustomGridHeaderCellWithInfo.tsx","../../src/grids/ag-grid/CustomGridTableWrapper.tsx"],"names":["jsx"],"mappings":";;;;;;;;;;;;AAcA,IAAM,uBAAA,GAAoC,CAAC,kBAAkB,CAAA;AAsCtD,SAAS,wBAAA,CAA6C;AAAA,EAC3D,UAAU,EAAC;AAAA,EACX,OAAO,EAAC;AAAA,EACR,SAAS,EAAC;AAAA,EACV,OAAA,GAAU,KAAA;AAAA,EACV,eAAA,GAAkB,KAAA;AAAA,EAClB,QAAA;AAAA,EACA,MAAA,GAAS,GAAA;AAAA,EACT,SAAA,GAAY,GAAA;AAAA,EACZ,aAAA;AAAA,EACA,UAAA;AAAA,EACA,kBAAA,GAAqB,EAAA;AAAA,EACrB,6BAA6B,CAAC,CAAA,EAAG,IAAI,EAAA,EAAI,EAAA,EAAI,IAAI,GAAG,CAAA;AAAA,EACpD,QAAA;AAAA,EACA,OAAA,GAAU,uBAAA;AAAA,EACV,SAAA,GAAY,WAAA;AAAA,EACZ,GAAG;AACL,CAAA,EAA8B;AAC5B,EAAA,MAAM,qBAAA,GAAwB,OAAA;AAAA,IAC5B,OAAO;AAAA,MACL,IAAA,EAAM,CAAA;AAAA,MACN,QAAA,EAAU,GAAA;AAAA,MACV,SAAA,EAAW,IAAA;A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A,GAAAA,CAAC,iBAAc,QAAA,EAAS,OAAA,EAAQ,CAAA,EAClC,CAAA,EACF,CAAA,GACE;AAAA,GAAA,EACN,CAAA;AAEJ;ACzEO,SAAS,uBAAuB,EAAE,QAAA,EAAU,EAAA,EAAI,GAAG,OAAM,EAAa;AAC3E,EAAA,uBACEA,GAAAA,CAAC,GAAA,EAAA,EAAI,KAAA,EAAM,MAAA,EAAO,CAAA,EAAG,GAAA,EAAK,EAAA,EAAI,GAAA,EAAK,EAAA,EAAS,GAAG,KAAA,EAC5C,QAAA,EACH,CAAA;AAEJ","file":"ag-grid.js","sourcesContent":["import type {\n ColDef,\n GetRowIdParams,\n Module,\n RowSelectionOptions,\n SelectionChangedEvent,\n} from \"ag-grid-community\";\nimport { AllCommunityModule } from \"ag-grid-community\";\nimport {\n AgGridReact,\n type AgGridReactProps,\n} from \"ag-grid-react\";\nimport { memo, useCallback, useMemo, type CSSProperties } from \"react\";\n\nconst DEFAULT_AG_GRID_MODULES: Module[] = [AllCommunityModule];\n\nexport interface CustomGridTableProps<Row extends object>\n extends Omit<\n AgGridReactProps<Row>,\n | \"columnDefs\"\n | \"rowData\"\n | \"pinnedBottomRowData\"\n | \"defaultColDef\"\n | \"onSelectionChanged\"\n | \"pagination\"\n | \"paginationPageSize\"\n | \"paginationPageSizeSelector\"\n | \"rowSelection\"\n | \"modules\"\n | \"getRowId\"\n > {\n columns?: readonly ColDef<Row>[];\n data?: readonly Row[];\n totals?: readonly Row[];\n loading?: boolean;\n enableSelection?: boolean;\n onSelect?: (rows: Row[]) => void;\n height?: CSSProperties[\"height\"];\n minHeight?: CSSProperties[\"minHeight\"];\n defaultColDef?: ColDef<Row>;\n pagination?: boolean;\n paginationPageSize?: number;\n paginationPageSizeSelector?: readonly number[];\n getRowId?: (params: GetRowIdParams<Row>) => string;\n modules?: Module[];\n ariaLabel?: string;\n}\n\n/**\n * Optional AG Grid Community wrapper. Import only from the ag-grid subpath so\n * regular shared-component consumers do not load AG Grid.\n */\nexport function CustomGridTableComponent<Row extends object>({\n columns = [],\n data = [],\n totals = [],\n loading = false,\n enableSelection = false,\n onSelect,\n height = 500,\n minHeight = 240,\n defaultColDef,\n pagination,\n paginationPageSize = 25,\n paginationPageSizeSelector = [5, 10, 25, 50, 75, 100],\n getRowId,\n modules = DEFAULT_AG_GRID_MODULES,\n ariaLabel = \"Data grid\",\n ...gridProps\n}: CustomGridTableProps<Row>) {\n const resolvedDefaultColDef = useMemo<ColDef<Row>>(\n () => ({\n flex: 1,\n minWidth: 160,\n resizable: true,\n sortable: true,\n wrapText: true,\n autoHeight: true,\n ...defaultColDef,\n }),\n [defaultColDef],\n );\n const rowSelection = useMemo<RowSelectionOptions<Row> | undefined>(\n () =>\n enableSelection\n ? {\n mode: \"multiRow\",\n checkboxes: true,\n headerCheckbox: true,\n enableClickSelection: false,\n selectAll: \"filtered\",\n }\n : undefined,\n [enableSelection],\n );\n const enablePagination = pagination ?? data.length > 50;\n const handleSelection = useCallback(\n (event: SelectionChangedEvent<Row>) => onSelect?.(event.api.getSelectedRows()),\n [onSelect],\n );\n\n return (\n <div\n aria-label={ariaLabel}\n role=\"region\"\n style={{ width: \"100%\", height, minHeight }}\n >\n <AgGridReact<Row>\n modules={modules}\n rowData={[...data]}\n columnDefs={[...columns]}\n pinnedBottomRowData={[...totals]}\n defaultColDef={resolvedDefaultColDef}\n loading={loading}\n pagination={enablePagination}\n paginationPageSize={paginationPageSize}\n paginationPageSizeSelector={[...paginationPageSizeSelector]}\n {...(rowSelection ? { rowSelection } : {})}\n onSelectionChanged={handleSelection}\n animateRows={false}\n suppressDragLeaveHidesColumns\n {...(getRowId ? { getRowId } : {})}\n {...gridProps}\n />\n </div>\n );\n}\n\nexport const CustomGridTable = memo(\n CustomGridTableComponent,\n) as typeof CustomGridTableComponent;\n\nexport const AgGridTable = CustomGridTable;\nexport default CustomGridTable;\n","import IconButton, { type IconButtonProps } from \"@mui/material/IconButton\";\n\nexport interface SharedIconButtonProps extends IconButtonProps {\n \"aria-label\": string;\n}\n\n/** An icon-only button that requires an accessible label. */\nexport function SharedIconButton({ sx, ...props }: SharedIconButtonProps) {\n return (\n <IconButton\n sx={{ width: 40, height: 40, borderRadius: 1, ...sx }}\n {...props}\n />\n );\n}\n\nexport default SharedIconButton;\n","import FunctionsIcon from \"@mui/icons-material/Functions\";\nimport InfoOutlinedIcon from \"@mui/icons-material/InfoOutlined\";\nimport Stack from \"@mui/material/Stack\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport type { IHeaderParams } from \"ag-grid-community\";\nimport type { KeyboardEvent, MouseEvent, ReactNode } from \"react\";\nimport { SharedIconButton } from \"../../buttons/SharedIconButton\";\n\nexport interface CustomGridHeaderCellWithInfoProps<Row = unknown>\n extends IHeaderParams<Row> {\n title?: ReactNode;\n info?: ReactNode;\n infoLabel?: string;\n formula?: ReactNode;\n formulaLabel?: string;\n}\n\n/** Accessible sortable AG Grid header with optional information and formula help. */\nexport function CustomGridHeaderCellWithInfo<Row = unknown>({\n displayName,\n title,\n info,\n infoLabel = \"Column information\",\n formula,\n formulaLabel = \"Column formula\",\n column,\n enableSorting,\n progressSort,\n}: CustomGridHeaderCellWithInfoProps<Row>) {\n const sort = column.getSort();\n const headerTitle = title ?? displayName;\n const sortLabel = sort\n ? `${String(headerTitle)}, sorted ${sort === \"asc\" ? \"ascending\" : \"descending\"}`\n : `${String(headerTitle)}, not sorted`;\n const requestSort = (event: MouseEvent | KeyboardEvent) => {\n if (enableSorting) progressSort(event.shiftKey);\n };\n\n return (\n <Stack direction=\"row\" alignItems=\"center\" spacing={0.5} width=\"100%\">\n <button\n type=\"button\"\n disabled={!enableSorting}\n aria-label={sortLabel}\n onClick={requestSort}\n style={{\n appearance: \"none\",\n border: 0,\n background: \"transparent\",\n color: \"inherit\",\n font: \"inherit\",\n fontWeight: 600,\n cursor: enableSorting ? \"pointer\" : \"default\",\n padding: 4,\n }}\n >\n {headerTitle}\n {sort === \"asc\" ? \" ▲\" : sort === \"desc\" ? \" ▼\" : \"\"}\n </button>\n {info ? (\n <Tooltip title={info} arrow>\n <SharedIconButton aria-label={infoLabel} size=\"small\">\n <InfoOutlinedIcon fontSize=\"small\" />\n </SharedIconButton>\n </Tooltip>\n ) : null}\n {formula ? (\n <Tooltip title={formula} arrow>\n <SharedIconButton aria-label={formulaLabel} size=\"small\">\n <FunctionsIcon fontSize=\"small\" />\n </SharedIconButton>\n </Tooltip>\n ) : null}\n </Stack>\n );\n}\n\nexport default CustomGridHeaderCellWithInfo;\n","import Box, { type BoxProps } from \"@mui/material/Box\";\n\nexport function CustomGridTableWrapper({ children, sx, ...props }: BoxProps) {\n return (\n <Box width=\"100%\" p={1.5} mb={0.5} sx={sx} {...props}>\n {children}\n </Box>\n );\n}\n\nexport default CustomGridTableWrapper;\n"]}
@@ -0,0 +1,104 @@
1
+ 'use strict';
2
+
3
+ var lucideReact = require('lucide-react');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "Check", {
8
+ enumerable: true,
9
+ get: function () { return lucideReact.Check; }
10
+ });
11
+ Object.defineProperty(exports, "ChevronDown", {
12
+ enumerable: true,
13
+ get: function () { return lucideReact.ChevronDown; }
14
+ });
15
+ Object.defineProperty(exports, "ChevronLeft", {
16
+ enumerable: true,
17
+ get: function () { return lucideReact.ChevronLeft; }
18
+ });
19
+ Object.defineProperty(exports, "ChevronRight", {
20
+ enumerable: true,
21
+ get: function () { return lucideReact.ChevronRight; }
22
+ });
23
+ Object.defineProperty(exports, "ChevronUp", {
24
+ enumerable: true,
25
+ get: function () { return lucideReact.ChevronUp; }
26
+ });
27
+ Object.defineProperty(exports, "CircleAlert", {
28
+ enumerable: true,
29
+ get: function () { return lucideReact.CircleAlert; }
30
+ });
31
+ Object.defineProperty(exports, "CircleHelp", {
32
+ enumerable: true,
33
+ get: function () { return lucideReact.CircleHelp; }
34
+ });
35
+ Object.defineProperty(exports, "Copy", {
36
+ enumerable: true,
37
+ get: function () { return lucideReact.Copy; }
38
+ });
39
+ Object.defineProperty(exports, "Download", {
40
+ enumerable: true,
41
+ get: function () { return lucideReact.Download; }
42
+ });
43
+ Object.defineProperty(exports, "Edit", {
44
+ enumerable: true,
45
+ get: function () { return lucideReact.Edit; }
46
+ });
47
+ Object.defineProperty(exports, "Eye", {
48
+ enumerable: true,
49
+ get: function () { return lucideReact.Eye; }
50
+ });
51
+ Object.defineProperty(exports, "EyeOff", {
52
+ enumerable: true,
53
+ get: function () { return lucideReact.EyeOff; }
54
+ });
55
+ Object.defineProperty(exports, "Filter", {
56
+ enumerable: true,
57
+ get: function () { return lucideReact.Filter; }
58
+ });
59
+ Object.defineProperty(exports, "Info", {
60
+ enumerable: true,
61
+ get: function () { return lucideReact.Info; }
62
+ });
63
+ Object.defineProperty(exports, "LoaderCircle", {
64
+ enumerable: true,
65
+ get: function () { return lucideReact.LoaderCircle; }
66
+ });
67
+ Object.defineProperty(exports, "Menu", {
68
+ enumerable: true,
69
+ get: function () { return lucideReact.Menu; }
70
+ });
71
+ Object.defineProperty(exports, "MoreVertical", {
72
+ enumerable: true,
73
+ get: function () { return lucideReact.MoreVertical; }
74
+ });
75
+ Object.defineProperty(exports, "Plus", {
76
+ enumerable: true,
77
+ get: function () { return lucideReact.Plus; }
78
+ });
79
+ Object.defineProperty(exports, "RefreshCw", {
80
+ enumerable: true,
81
+ get: function () { return lucideReact.RefreshCw; }
82
+ });
83
+ Object.defineProperty(exports, "Save", {
84
+ enumerable: true,
85
+ get: function () { return lucideReact.Save; }
86
+ });
87
+ Object.defineProperty(exports, "Search", {
88
+ enumerable: true,
89
+ get: function () { return lucideReact.Search; }
90
+ });
91
+ Object.defineProperty(exports, "Trash2", {
92
+ enumerable: true,
93
+ get: function () { return lucideReact.Trash2; }
94
+ });
95
+ Object.defineProperty(exports, "Upload", {
96
+ enumerable: true,
97
+ get: function () { return lucideReact.Upload; }
98
+ });
99
+ Object.defineProperty(exports, "X", {
100
+ enumerable: true,
101
+ get: function () { return lucideReact.X; }
102
+ });
103
+ //# sourceMappingURL=lucide.cjs.map
104
+ //# sourceMappingURL=lucide.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"lucide.cjs","sourcesContent":[]}
@@ -0,0 +1 @@
1
+ export { Check, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, CircleAlert, CircleHelp, Copy, Download, Edit, Eye, EyeOff, Filter, Info, LoaderCircle, Menu, MoreVertical, Plus, RefreshCw, Save, Search, Trash2, Upload, X } from 'lucide-react';
@@ -0,0 +1 @@
1
+ export { Check, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, CircleAlert, CircleHelp, Copy, Download, Edit, Eye, EyeOff, Filter, Info, LoaderCircle, Menu, MoreVertical, Plus, RefreshCw, Save, Search, Trash2, Upload, X } from 'lucide-react';
@@ -0,0 +1,3 @@
1
+ export { Check, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, CircleAlert, CircleHelp, Copy, Download, Edit, Eye, EyeOff, Filter, Info, LoaderCircle, Menu, MoreVertical, Plus, RefreshCw, Save, Search, Trash2, Upload, X } from 'lucide-react';
2
+ //# sourceMappingURL=lucide.js.map
3
+ //# sourceMappingURL=lucide.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"lucide.js","sourcesContent":[]}