pallote-react 0.16.4 → 0.16.6

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 CHANGED
@@ -4,7 +4,6 @@ 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';
8
7
  import SyntaxHighlighter from 'react-syntax-highlighter';
9
8
 
10
9
  const Color = ({ fill, stroke, customFill, customStroke, className, children, ...props }) => {
@@ -124,7 +123,7 @@ const Accordion = ({ size = 'md', allowMultiple = false, transparent, className,
124
123
  }) }) }));
125
124
  };
126
125
 
127
- const o$4 = createContext({
126
+ const o$6 = createContext({
128
127
  color: "currentColor",
129
128
  size: "1em",
130
129
  weight: "regular",
@@ -148,7 +147,7 @@ const p = e$9.forwardRef(
148
147
  weight: f = "regular",
149
148
  mirrored: g = false,
150
149
  ...w
151
- } = e$9.useContext(o$4);
150
+ } = e$9.useContext(o$6);
152
151
  return /* @__PURE__ */ e$9.createElement(
153
152
  "svg",
154
153
  {
@@ -236,7 +235,7 @@ const AccordionItem = ({ icon, label, disabled, className, children, isOpen = fa
236
235
  ]), ...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 })] }));
237
236
  };
238
237
 
239
- const a$6 = /* @__PURE__ */ new Map([
238
+ const a$8 = /* @__PURE__ */ new Map([
240
239
  [
241
240
  "bold",
242
241
  /* @__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" }))
@@ -269,7 +268,7 @@ const a$6 = /* @__PURE__ */ new Map([
269
268
  ]
270
269
  ]);
271
270
 
272
- const e$7 = e$9.forwardRef((r, t) => /* @__PURE__ */ e$9.createElement(p, { ref: t, ...r, weights: a$6 }));
271
+ const e$7 = e$9.forwardRef((r, t) => /* @__PURE__ */ e$9.createElement(p, { ref: t, ...r, weights: a$8 }));
273
272
  e$7.displayName = "XIcon";
274
273
 
275
274
  const Alert = ({ color = 'success', variant = 'toast', title, subtitle, dense, noIcon, show, onClose, className, ...props }) => {
@@ -464,6 +463,66 @@ const Chip = ({ color = 'default', dense, avatar, disabled, onClose, className,
464
463
  ]), 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] }) }));
465
464
  };
466
465
 
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
+
467
526
  const DenseContext = createContext(false);
468
527
  const Table = ({ striped, hasHover, dense, border, className, children, ...props }) => {
469
528
  return (jsx(DenseContext.Provider, { value: dense ?? false, children: jsx("div", { className: classnames([
@@ -833,11 +892,11 @@ function DataTable({ data, columns: columnDefs, enableSearch, searchPlaceholder
833
892
  },
834
893
  });
835
894
  const hasFilters = columnDefs.some(col => col.enableFiltering === true);
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({
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(o$4, {}), 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({
837
896
  'datatable_sortable': header.column.getCanSort()
838
897
  }), onClick: header.column.getToggleSortingHandler(), "aria-sort": header.column.getIsSorted() === 'asc' ? 'ascending'
839
898
  : header.column.getIsSorted() === 'desc' ? 'descending'
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) })] }));
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(e$8, { size: 12 })) : header.column.getIsSorted() === 'desc' ? (jsx(o$5, { size: 12 })) : (jsx(e$8, { 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) })] }));
841
900
  }
842
901
 
843
902
  const Divider = ({ direction = 'landscape', padding = 'md', className, ...props }) => {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pallote-react",
3
- "version": "0.16.4",
3
+ "version": "0.16.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pallote-react",
3
- "version": "0.16.4",
3
+ "version": "0.16.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",