pallote-react 0.16.3 → 0.16.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.
- package/dist/index.js +7 -66
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import classnames from 'classnames';
|
|
|
4
4
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
5
5
|
import { createPortal } from 'react-dom';
|
|
6
6
|
import { useReactTable, getPaginationRowModel, getFilteredRowModel, getSortedRowModel, getCoreRowModel, flexRender } from '@tanstack/react-table';
|
|
7
|
+
import { MagnifyingGlassIcon, CaretDownIcon, CaretUpIcon } from '@phosphor-icons/react';
|
|
7
8
|
import SyntaxHighlighter from 'react-syntax-highlighter';
|
|
8
9
|
|
|
9
10
|
const Color = ({ fill, stroke, customFill, customStroke, className, children, ...props }) => {
|
|
@@ -123,7 +124,7 @@ const Accordion = ({ size = 'md', allowMultiple = false, transparent, className,
|
|
|
123
124
|
}) }) }));
|
|
124
125
|
};
|
|
125
126
|
|
|
126
|
-
const o$
|
|
127
|
+
const o$4 = createContext({
|
|
127
128
|
color: "currentColor",
|
|
128
129
|
size: "1em",
|
|
129
130
|
weight: "regular",
|
|
@@ -147,7 +148,7 @@ const p = e$9.forwardRef(
|
|
|
147
148
|
weight: f = "regular",
|
|
148
149
|
mirrored: g = false,
|
|
149
150
|
...w
|
|
150
|
-
} = e$9.useContext(o$
|
|
151
|
+
} = e$9.useContext(o$4);
|
|
151
152
|
return /* @__PURE__ */ e$9.createElement(
|
|
152
153
|
"svg",
|
|
153
154
|
{
|
|
@@ -235,7 +236,7 @@ const AccordionItem = ({ icon, label, disabled, className, children, isOpen = fa
|
|
|
235
236
|
]), ...props, children: [jsxs("button", { type: "button", id: headerId, className: classnames('accordion_control'), onClick: handleClick, onKeyDown: handleKeyDown, "aria-expanded": isOpen, "aria-controls": panelId, "aria-disabled": disabled ? true : undefined, disabled: disabled, children: [icon ? jsx("span", { className: "accordion_icon", "aria-hidden": "true", children: icon }) : null, jsx(Text, { className: "accordion_header", variant: labelVariant, weight: "bold", children: label }), jsx(e$8, { className: "accordion_icon accordion_icon-arrow", "aria-hidden": "true" })] }), jsx("div", { id: panelId, ref: contentRef, role: "region", "aria-labelledby": headerId, className: classnames('accordion_content'), style: { maxHeight }, hidden: !isOpen, children: children })] }));
|
|
236
237
|
};
|
|
237
238
|
|
|
238
|
-
const a$
|
|
239
|
+
const a$6 = /* @__PURE__ */ new Map([
|
|
239
240
|
[
|
|
240
241
|
"bold",
|
|
241
242
|
/* @__PURE__ */ e$9.createElement(e$9.Fragment, null, /* @__PURE__ */ e$9.createElement("path", { d: "M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z" }))
|
|
@@ -268,7 +269,7 @@ const a$8 = /* @__PURE__ */ new Map([
|
|
|
268
269
|
]
|
|
269
270
|
]);
|
|
270
271
|
|
|
271
|
-
const e$7 = e$9.forwardRef((r, t) => /* @__PURE__ */ e$9.createElement(p, { ref: t, ...r, weights: a$
|
|
272
|
+
const e$7 = e$9.forwardRef((r, t) => /* @__PURE__ */ e$9.createElement(p, { ref: t, ...r, weights: a$6 }));
|
|
272
273
|
e$7.displayName = "XIcon";
|
|
273
274
|
|
|
274
275
|
const Alert = ({ color = 'success', variant = 'toast', title, subtitle, dense, noIcon, show, onClose, className, ...props }) => {
|
|
@@ -463,66 +464,6 @@ const Chip = ({ color = 'default', dense, avatar, disabled, onClose, className,
|
|
|
463
464
|
]), role: "listitem", "aria-disabled": disabled ? true : undefined, ...props, children: [avatar ? (jsx("img", { className: classnames('chip_avatar'), src: avatar, alt: "", "aria-hidden": "true" })) : null, children, onClose ? (jsx("button", { type: "button", className: classnames('chip_close'), onClick: onClose, disabled: disabled, "aria-label": "Remove", children: jsx(e$7, { size: dense ? 16 : 20, "aria-hidden": "true" }) })) : null] }) }));
|
|
464
465
|
};
|
|
465
466
|
|
|
466
|
-
const a$7 = /* @__PURE__ */ new Map([
|
|
467
|
-
[
|
|
468
|
-
"bold",
|
|
469
|
-
/* @__PURE__ */ e$9.createElement(e$9.Fragment, null, /* @__PURE__ */ e$9.createElement("path", { d: "M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z" }))
|
|
470
|
-
],
|
|
471
|
-
[
|
|
472
|
-
"duotone",
|
|
473
|
-
/* @__PURE__ */ e$9.createElement(e$9.Fragment, null, /* @__PURE__ */ e$9.createElement("path", { d: "M208,160H48l80-80Z", opacity: "0.2" }), /* @__PURE__ */ e$9.createElement("path", { d: "M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z" }))
|
|
474
|
-
],
|
|
475
|
-
[
|
|
476
|
-
"fill",
|
|
477
|
-
/* @__PURE__ */ e$9.createElement(e$9.Fragment, null, /* @__PURE__ */ e$9.createElement("path", { d: "M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z" }))
|
|
478
|
-
],
|
|
479
|
-
[
|
|
480
|
-
"light",
|
|
481
|
-
/* @__PURE__ */ e$9.createElement(e$9.Fragment, null, /* @__PURE__ */ e$9.createElement("path", { d: "M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z" }))
|
|
482
|
-
],
|
|
483
|
-
[
|
|
484
|
-
"regular",
|
|
485
|
-
/* @__PURE__ */ e$9.createElement(e$9.Fragment, null, /* @__PURE__ */ e$9.createElement("path", { d: "M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z" }))
|
|
486
|
-
],
|
|
487
|
-
[
|
|
488
|
-
"thin",
|
|
489
|
-
/* @__PURE__ */ e$9.createElement(e$9.Fragment, null, /* @__PURE__ */ e$9.createElement("path", { d: "M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z" }))
|
|
490
|
-
]
|
|
491
|
-
]);
|
|
492
|
-
|
|
493
|
-
const o$5 = e$9.forwardRef((r, t) => /* @__PURE__ */ e$9.createElement(p, { ref: t, ...r, weights: a$7 }));
|
|
494
|
-
o$5.displayName = "CaretUpIcon";
|
|
495
|
-
|
|
496
|
-
const a$6 = /* @__PURE__ */ new Map([
|
|
497
|
-
[
|
|
498
|
-
"bold",
|
|
499
|
-
/* @__PURE__ */ e$9.createElement(e$9.Fragment, null, /* @__PURE__ */ e$9.createElement("path", { d: "M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z" }))
|
|
500
|
-
],
|
|
501
|
-
[
|
|
502
|
-
"duotone",
|
|
503
|
-
/* @__PURE__ */ e$9.createElement(e$9.Fragment, null, /* @__PURE__ */ e$9.createElement("path", { d: "M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z", opacity: "0.2" }), /* @__PURE__ */ e$9.createElement("path", { d: "M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z" }))
|
|
504
|
-
],
|
|
505
|
-
[
|
|
506
|
-
"fill",
|
|
507
|
-
/* @__PURE__ */ e$9.createElement(e$9.Fragment, null, /* @__PURE__ */ e$9.createElement("path", { d: "M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z" }))
|
|
508
|
-
],
|
|
509
|
-
[
|
|
510
|
-
"light",
|
|
511
|
-
/* @__PURE__ */ e$9.createElement(e$9.Fragment, null, /* @__PURE__ */ e$9.createElement("path", { d: "M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z" }))
|
|
512
|
-
],
|
|
513
|
-
[
|
|
514
|
-
"regular",
|
|
515
|
-
/* @__PURE__ */ e$9.createElement(e$9.Fragment, null, /* @__PURE__ */ e$9.createElement("path", { d: "M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z" }))
|
|
516
|
-
],
|
|
517
|
-
[
|
|
518
|
-
"thin",
|
|
519
|
-
/* @__PURE__ */ e$9.createElement(e$9.Fragment, null, /* @__PURE__ */ e$9.createElement("path", { d: "M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z" }))
|
|
520
|
-
]
|
|
521
|
-
]);
|
|
522
|
-
|
|
523
|
-
const o$4 = e$9.forwardRef((s, n) => /* @__PURE__ */ e$9.createElement(p, { ref: n, ...s, weights: a$6 }));
|
|
524
|
-
o$4.displayName = "MagnifyingGlassIcon";
|
|
525
|
-
|
|
526
467
|
const DenseContext = createContext(false);
|
|
527
468
|
const Table = ({ striped, hasHover, dense, border, className, children, ...props }) => {
|
|
528
469
|
return (jsx(DenseContext.Provider, { value: dense ?? false, children: jsx("div", { className: classnames([
|
|
@@ -892,11 +833,11 @@ function DataTable({ data, columns: columnDefs, enableSearch, searchPlaceholder
|
|
|
892
833
|
},
|
|
893
834
|
});
|
|
894
835
|
const hasFilters = columnDefs.some(col => col.enableFiltering === true);
|
|
895
|
-
return (jsxs("div", { className: classnames('datatable', className), ...props, children: [enableSearch && (jsx("div", { className: "datatable_search", children: jsx(Input, { id: "datatable-search", label: "Search", hideLabel: true, placeholder: searchPlaceholder, icon: jsx(
|
|
836
|
+
return (jsxs("div", { className: classnames('datatable', className), ...props, children: [enableSearch && (jsx("div", { className: "datatable_search", children: jsx(Input, { id: "datatable-search", label: "Search", hideLabel: true, placeholder: searchPlaceholder, icon: jsx(MagnifyingGlassIcon, {}), value: globalFilter, onChange: (e) => setGlobalFilter(e.target.value) }) })), jsxs(Table, { striped: striped, hasHover: hasHover, dense: dense, border: border, children: [jsxs(TableHead, { children: [table.getHeaderGroups().map(headerGroup => (jsx(TableRow, { children: headerGroup.headers.map(header => (jsx(TableCell, { className: classnames({
|
|
896
837
|
'datatable_sortable': header.column.getCanSort()
|
|
897
838
|
}), onClick: header.column.getToggleSortingHandler(), "aria-sort": header.column.getIsSorted() === 'asc' ? 'ascending'
|
|
898
839
|
: header.column.getIsSorted() === 'desc' ? 'descending'
|
|
899
|
-
: undefined, children: jsxs("span", { className: "datatable_headerContent", children: [flexRender(header.column.columnDef.header, header.getContext()), header.column.getCanSort() && (jsx("span", { className: "datatable_sortIcon", "aria-hidden": "true", children: header.column.getIsSorted() === 'asc' ? (jsx(
|
|
840
|
+
: undefined, children: jsxs("span", { className: "datatable_headerContent", children: [flexRender(header.column.columnDef.header, header.getContext()), header.column.getCanSort() && (jsx("span", { className: "datatable_sortIcon", "aria-hidden": "true", children: header.column.getIsSorted() === 'asc' ? (jsx(CaretDownIcon, { size: 12 })) : header.column.getIsSorted() === 'desc' ? (jsx(CaretUpIcon, { size: 12 })) : (jsx(CaretDownIcon, { size: 12, className: "datatable_sortIcon-inactive" })) }))] }) }, header.id))) }, headerGroup.id))), hasFilters && (jsx(TableRow, { className: "datatable_filterRow", children: table.getHeaderGroups()[0].headers.map(header => (jsx(TableCell, { children: header.column.getCanFilter() ? (jsx(ColumnFilter, { header: header })) : null }, `filter-${header.id}`))) }))] }), jsx(TableBody, { children: table.getRowModel().rows.length === 0 ? (jsx(TableRow, { children: jsx(TableCell, { colSpan: columnDefs.length, className: "datatable_empty", children: "No results found" }) })) : (table.getRowModel().rows.map(row => (jsx(TableRow, { children: row.getVisibleCells().map(cell => (jsx(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }, row.id)))) })] }), jsx(TablePagination, { pageIndex: table.getState().pagination.pageIndex, pageCount: table.getPageCount(), pageSize: table.getState().pagination.pageSize, pageSizeOptions: pageSizeOptions, totalRows: table.getFilteredRowModel().rows.length, onPageChange: (page) => table.setPageIndex(page), onPageSizeChange: (size) => table.setPageSize(size) })] }));
|
|
900
841
|
}
|
|
901
842
|
|
|
902
843
|
const Divider = ({ direction = 'landscape', padding = 'md', className, ...props }) => {
|
package/dist/package.json
CHANGED