@overmap-ai/blocks 1.0.25-table-row-loading.0 → 1.0.25-try-to-fix-react-table-library-imports.2

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.
Files changed (39) hide show
  1. package/dist/Badge/Badge.d.ts +1 -1
  2. package/dist/Badge/typings.d.ts +1 -1
  3. package/dist/BaseMenuGroups/utils.d.ts +1 -1
  4. package/dist/Breadcrumb/Breadcrumb.d.ts +1 -1
  5. package/dist/ButtonGroup/ButtonGroup.d.ts +1 -1
  6. package/dist/ButtonGroup/typings.d.ts +1 -1
  7. package/dist/Buttons/Button.d.ts +1 -1
  8. package/dist/Buttons/IconButton.d.ts +1 -1
  9. package/dist/Buttons/constants.d.ts +1 -1
  10. package/dist/Buttons/typings.d.ts +1 -1
  11. package/dist/ContextMenu/index.d.ts +5 -5
  12. package/dist/DropdownItemMenu/DropdownItemMenu.d.ts +1 -1
  13. package/dist/DropdownMenu/DropdownMenu.d.ts +2 -2
  14. package/dist/DropdownMultiSelect/DropdownMultiSelect.d.ts +1 -1
  15. package/dist/DropdownSelect/DropdownSelect.d.ts +1 -1
  16. package/dist/IconColorUtility/IconColorUtility.d.ts +1 -1
  17. package/dist/Input/Input.d.ts +1 -1
  18. package/dist/Input/typings.d.ts +1 -1
  19. package/dist/Layout/Root.d.ts +1 -13
  20. package/dist/Layout/SlideOutOverlay.d.ts +1 -1
  21. package/dist/Layout/context.d.ts +14 -0
  22. package/dist/Layout/index.d.ts +1 -1
  23. package/dist/Popover/Popover.d.ts +1 -1
  24. package/dist/Separator/Separator.d.ts +1 -1
  25. package/dist/Separator/typings.d.ts +1 -1
  26. package/dist/SlideOut/SlideOutV2.d.ts +1 -1
  27. package/dist/Switch/Switch.d.ts +1 -1
  28. package/dist/Switch/typings.d.ts +1 -1
  29. package/dist/Table/typings.d.ts +2 -1
  30. package/dist/TextArea/TextArea.d.ts +1 -1
  31. package/dist/TextArea/typings.d.ts +1 -1
  32. package/dist/Toast/typings.d.ts +1 -1
  33. package/dist/ToggleGroup/ToggleGroup.d.ts +1 -1
  34. package/dist/blocks.js +40 -34
  35. package/dist/blocks.js.map +1 -1
  36. package/dist/blocks.umd.cjs +55 -44
  37. package/dist/blocks.umd.cjs.map +1 -1
  38. package/dist/constants.d.ts +1 -1
  39. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  (function(global, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react/jsx-runtime"), require("@radix-ui/themes"), require("react"), require("react-responsive"), require("@radix-ui/react-icons"), require("@radix-ui/react-context-menu"), require("@radix-ui/react-dropdown-menu"), require("react-device-detect"), require("@radix-ui/react-dialog"), require("re-resizable"), require("react-transition-group"), require("react-dom"), require("@radix-ui/react-slot"), require("@radix-ui/react-dismissable-layer"), require("@radix-ui/react-toggle-group"), require("@radix-ui/react-toolbar"), require("@radix-ui/react-toast"), require("react-error-boundary"), require("feather-icons-react"), require("@table-library/react-table-library/table.js"), require("@table-library/react-table-library/theme.js"), require("@table-library/react-table-library/sort.js"), require("@table-library/react-table-library/select.js"), require("@table-library/react-table-library/pagination.js")) : typeof define === "function" && define.amd ? define(["exports", "react/jsx-runtime", "@radix-ui/themes", "react", "react-responsive", "@radix-ui/react-icons", "@radix-ui/react-context-menu", "@radix-ui/react-dropdown-menu", "react-device-detect", "@radix-ui/react-dialog", "re-resizable", "react-transition-group", "react-dom", "@radix-ui/react-slot", "@radix-ui/react-dismissable-layer", "@radix-ui/react-toggle-group", "@radix-ui/react-toolbar", "@radix-ui/react-toast", "react-error-boundary", "feather-icons-react", "@table-library/react-table-library/table.js", "@table-library/react-table-library/theme.js", "@table-library/react-table-library/sort.js", "@table-library/react-table-library/select.js", "@table-library/react-table-library/pagination.js"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.blocks = {}, global.jsxRuntime, global.themes, global.React, global.reactResponsive, global.reactIcons, global.RadixContextMenu, global.RadixDropdownMenu, global.reactDeviceDetect, global.RadixDialogPrimitive, global.reResizable, global.reactTransitionGroup, global.ReactDOM, global.reactSlot, global.reactDismissableLayer, global.reactToggleGroup, global.reactToolbar, global.RadixToast, global.reactErrorBoundary, global.FeatherIcon, global.table_js, global.theme_js, global.sort_js, global.select_js, global.pagination_js));
3
- })(this, function(exports2, jsxRuntime, themes, React, reactResponsive, reactIcons, RadixContextMenu, RadixDropdownMenu, reactDeviceDetect, RadixDialogPrimitive, reResizable, reactTransitionGroup, ReactDOM, reactSlot, reactDismissableLayer, reactToggleGroup, reactToolbar, RadixToast, reactErrorBoundary, FeatherIcon, table_js, theme_js, sort_js, select_js, pagination_js) {
2
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react/jsx-runtime"), require("@radix-ui/themes"), require("react"), require("react-responsive"), require("@radix-ui/react-icons"), require("@radix-ui/react-context-menu"), require("@radix-ui/react-dropdown-menu"), require("react-device-detect"), require("@radix-ui/react-dialog"), require("re-resizable"), require("react-transition-group"), require("react-dom"), require("@radix-ui/react-slot"), require("@radix-ui/react-dismissable-layer"), require("@radix-ui/react-toggle-group"), require("@radix-ui/react-toolbar"), require("@radix-ui/react-toast"), require("react-error-boundary"), require("feather-icons-react")) : typeof define === "function" && define.amd ? define(["exports", "react/jsx-runtime", "@radix-ui/themes", "react", "react-responsive", "@radix-ui/react-icons", "@radix-ui/react-context-menu", "@radix-ui/react-dropdown-menu", "react-device-detect", "@radix-ui/react-dialog", "re-resizable", "react-transition-group", "react-dom", "@radix-ui/react-slot", "@radix-ui/react-dismissable-layer", "@radix-ui/react-toggle-group", "@radix-ui/react-toolbar", "@radix-ui/react-toast", "react-error-boundary", "feather-icons-react"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.blocks = {}, global.jsxRuntime, global.themes, global.React, global.reactResponsive, global.reactIcons, global.RadixContextMenu, global.RadixDropdownMenu, global.reactDeviceDetect, global.RadixDialogPrimitive, global.reResizable, global.reactTransitionGroup, global.ReactDOM, global.reactSlot, global.reactDismissableLayer, global.reactToggleGroup, global.reactToolbar, global.RadixToast, global.reactErrorBoundary, global.FeatherIcon));
3
+ })(this, function(exports2, jsxRuntime, themes, React, reactResponsive, reactIcons, RadixContextMenu, RadixDropdownMenu, reactDeviceDetect, RadixDialogPrimitive, reResizable, reactTransitionGroup, ReactDOM, reactSlot, reactDismissableLayer, reactToggleGroup, reactToolbar, RadixToast, reactErrorBoundary, FeatherIcon) {
4
4
  "use strict";
5
5
  function _interopNamespaceDefault(e) {
6
6
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -95,11 +95,11 @@
95
95
  info: "gray"
96
96
  };
97
97
  const useSeverityColor = (severity) => {
98
- const theme = themes.useThemeContext();
98
+ const theme2 = themes.useThemeContext();
99
99
  if (!severity)
100
100
  return void 0;
101
101
  if (severity === "primary")
102
- return theme.accentColor;
102
+ return theme2.accentColor;
103
103
  return nonThemeSeverityMapping[severity];
104
104
  };
105
105
  const useViewportSize = () => {
@@ -1493,6 +1493,7 @@
1493
1493
  });
1494
1494
  const Sidebar = React.memo(_Sidebar);
1495
1495
  const LayoutContext = React.createContext({});
1496
+ const useLayoutContext = () => React.useContext(LayoutContext);
1496
1497
  const Root$1 = React.memo((props) => {
1497
1498
  const { children, small = false, hideLayout = false } = props;
1498
1499
  const [showLeftSlideOut, setShowLeftSlideOut] = React.useState(false);
@@ -1511,7 +1512,6 @@
1511
1512
  return /* @__PURE__ */ jsxRuntime.jsx(LayoutContext.Provider, { value: contextValue, children });
1512
1513
  });
1513
1514
  Root$1.displayName = "Layout.Root";
1514
- const useLayoutContext = () => React.useContext(LayoutContext);
1515
1515
  const Container = React.memo(
1516
1516
  React.forwardRef((props, ref) => {
1517
1517
  const { children, style, grow = "1", height = "100%", position, ...rest } = props;
@@ -3553,7 +3553,7 @@
3553
3553
  const tableContainer = "_tableContainer_5i91d_25";
3554
3554
  const searchContainer = "_searchContainer_5i91d_30";
3555
3555
  const columnFilterSelect = "_columnFilterSelect_5i91d_40";
3556
- const table = "_table_5i91d_21";
3556
+ const table$1 = "_table_5i91d_21";
3557
3557
  const tableHeaderCell = "_tableHeaderCell_5i91d_58";
3558
3558
  const showSortIcon = "_showSortIcon_5i91d_74";
3559
3559
  const tableRow = "_tableRow_5i91d_78";
@@ -3572,7 +3572,7 @@
3572
3572
  tableContainer,
3573
3573
  searchContainer,
3574
3574
  columnFilterSelect,
3575
- table,
3575
+ table: table$1,
3576
3576
  tableHeaderCell,
3577
3577
  showSortIcon,
3578
3578
  tableRow,
@@ -3584,6 +3584,16 @@
3584
3584
  pageText,
3585
3585
  descriptionSecondLine
3586
3586
  };
3587
+ const table = import("@overmap-ai/react-table-library/table.js");
3588
+ const { Body, Cell, Header, HeaderCell, HeaderRow, Row, Table: ReactLibraryTable } = table;
3589
+ const theme = import("@overmap-ai/react-table-library/theme.js");
3590
+ const { useTheme } = theme;
3591
+ const sort = import("@overmap-ai/react-table-library/sort.js");
3592
+ const { HeaderCellSort, useSort } = sort;
3593
+ const select = import("@overmap-ai/react-table-library/select.js");
3594
+ const { CellSelect, HeaderCellSelect, SelectClickTypes, SelectTypes, useRowSelect } = select;
3595
+ const pagination = import("@overmap-ai/react-table-library/pagination.js");
3596
+ const { usePagination } = pagination;
3587
3597
  const _Table = React.forwardRef(function Table2(props, ref) {
3588
3598
  var _a;
3589
3599
  const {
@@ -3732,7 +3742,7 @@
3732
3742
  setSearch(e.target.value);
3733
3743
  }, []);
3734
3744
  const tableData = { nodes: rows };
3735
- const tableSelect = select_js.useRowSelect(
3745
+ const tableSelect = useRowSelect(
3736
3746
  tableData,
3737
3747
  {
3738
3748
  onChange: (_action, state) => {
@@ -3740,13 +3750,13 @@
3740
3750
  }
3741
3751
  },
3742
3752
  {
3743
- rowSelect: select_js.SelectTypes.MultiSelect,
3744
- buttonSelect: select_js.SelectTypes.MultiSelect,
3745
- clickType: select_js.SelectClickTypes.ButtonClick,
3753
+ rowSelect: SelectTypes.MultiSelect,
3754
+ buttonSelect: SelectTypes.MultiSelect,
3755
+ clickType: SelectClickTypes.ButtonClick,
3746
3756
  isCarryForward: false
3747
3757
  }
3748
3758
  );
3749
- const pagination = pagination_js.usePagination(
3759
+ const pagination2 = usePagination(
3750
3760
  tableData,
3751
3761
  {
3752
3762
  state: {
@@ -3758,7 +3768,7 @@
3758
3768
  isServer: false
3759
3769
  }
3760
3770
  );
3761
- const sort = sort_js.useSort(
3771
+ const sort2 = useSort(
3762
3772
  tableData,
3763
3773
  {
3764
3774
  onChange: (_action, state) => {
@@ -3843,7 +3853,7 @@
3843
3853
  [columnFilterValues, columns, getFilterValues]
3844
3854
  );
3845
3855
  const columnCells = columnsData.map((column) => {
3846
- const Component = column.sort ? sort_js.HeaderCellSort : table_js.HeaderCell;
3856
+ const Component = column.sort ? HeaderCellSort : HeaderCell;
3847
3857
  let firstLine = column.label;
3848
3858
  let secondLine = void 0;
3849
3859
  if (column.label && typeof column.label === "string") {
@@ -3875,7 +3885,7 @@
3875
3885
  });
3876
3886
  const SelectedModeButton = reactDeviceDetect.isMobile ? IconButton : Button2;
3877
3887
  const layout = React.useMemo(() => ({ custom: true, ...fixHeader && { fixedHeader: true } }), [fixHeader]);
3878
- const theme = theme_js.useTheme({
3888
+ const theme2 = useTheme({
3879
3889
  Table: `
3880
3890
  --data-table-library_grid-template-columns: ${gridTemplateColumns} !important;
3881
3891
  `,
@@ -3898,14 +3908,14 @@
3898
3908
  if (showPageNavigation) {
3899
3909
  const numTotalPages = Math.ceil(rows.length / numRowsPerPage);
3900
3910
  setTotalPages(numTotalPages);
3901
- if (pagination.state.page < 0) {
3902
- pagination.fns.onSetPage(0);
3911
+ if (pagination2.state.page < 0) {
3912
+ pagination2.fns.onSetPage(0);
3903
3913
  }
3904
- if (pagination.state.page > numTotalPages - 1) {
3905
- pagination.fns.onSetPage(numTotalPages - 1);
3914
+ if (pagination2.state.page > numTotalPages - 1) {
3915
+ pagination2.fns.onSetPage(numTotalPages - 1);
3906
3916
  }
3907
3917
  }
3908
- }, [rowsPerPage, rows.length, numRowsPerPage, pagination, showPageNavigation]);
3918
+ }, [rowsPerPage, rows.length, numRowsPerPage, pagination2, showPageNavigation]);
3909
3919
  return /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { className: classNames({ [styles$1.outerTableContainer]: showContainer }), direction: "column", height: "100%", children: [
3910
3920
  (!!title || !!description) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$1.headerContainer, children: [
3911
3921
  !!title && /* @__PURE__ */ jsxRuntime.jsx(Text$1, { weight: "bold", size: "5", children: title }),
@@ -3938,7 +3948,7 @@
3938
3948
  color: "crimson",
3939
3949
  onClick: () => {
3940
3950
  setColumnFilterValues(defaultColumnFilterValues);
3941
- pagination.fns.onSetPage(0);
3951
+ pagination2.fns.onSetPage(0);
3942
3952
  },
3943
3953
  "aria-label": "Clear filters",
3944
3954
  children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.Cross2Icon, {})
@@ -3959,33 +3969,33 @@
3959
3969
  ] }),
3960
3970
  children,
3961
3971
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$1.tableContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
3962
- table_js.Table,
3972
+ ReactLibraryTable,
3963
3973
  {
3964
3974
  className: classNames(styles$1.table, className),
3965
3975
  data: tableData,
3966
- theme,
3967
- sort,
3968
- pagination: showPageNavigation && pagination,
3976
+ theme: theme2,
3977
+ sort: sort2,
3978
+ pagination: showPageNavigation && pagination2,
3969
3979
  select: tableSelect,
3970
3980
  layout,
3971
3981
  ref,
3972
3982
  children: (tableList) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3973
- /* @__PURE__ */ jsxRuntime.jsx(table_js.Header, { children: /* @__PURE__ */ jsxRuntime.jsxs(table_js.HeaderRow, { children: [
3974
- showSelect && /* @__PURE__ */ jsxRuntime.jsx(select_js.HeaderCellSelect, { className: styles$1.tableHeaderCell }),
3983
+ /* @__PURE__ */ jsxRuntime.jsx(Header, { children: /* @__PURE__ */ jsxRuntime.jsxs(HeaderRow, { children: [
3984
+ showSelect && /* @__PURE__ */ jsxRuntime.jsx(HeaderCellSelect, { className: styles$1.tableHeaderCell }),
3975
3985
  ...columnCells
3976
3986
  ] }) }),
3977
- /* @__PURE__ */ jsxRuntime.jsxs(table_js.Body, { children: [
3978
- tableList.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(themes.TableRow, { className: styles$1.noDataTextContainer, children: /* @__PURE__ */ jsxRuntime.jsx(table_js.Cell, { children: emptyMessage }) }),
3987
+ /* @__PURE__ */ jsxRuntime.jsxs(Body, { children: [
3988
+ tableList.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(themes.TableRow, { className: styles$1.noDataTextContainer, children: /* @__PURE__ */ jsxRuntime.jsx(Cell, { children: emptyMessage }) }),
3979
3989
  tableList.map((row) => /* @__PURE__ */ jsxRuntime.jsx(
3980
- table_js.Row,
3990
+ Row,
3981
3991
  {
3982
3992
  item: row,
3983
3993
  className: classNames(styles$1.tableRow, rowClassName, row.className, {
3984
3994
  [styles$1.disabled]: row.disabled
3985
3995
  }),
3986
- onClick: !row.loading && !row.disabled && row.onClick,
3996
+ onClick: !row.disabled && row.onClick,
3987
3997
  children: row.loading ? /* @__PURE__ */ jsxRuntime.jsx(
3988
- table_js.Cell,
3998
+ Cell,
3989
3999
  {
3990
4000
  style: {
3991
4001
  gridColumn: `1 / span ${columns.length}`
@@ -3994,11 +4004,11 @@
3994
4004
  },
3995
4005
  `loading-${row.id}`
3996
4006
  ) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3997
- showSelect && /* @__PURE__ */ jsxRuntime.jsx(select_js.CellSelect, { item: row }, row.id),
4007
+ showSelect && /* @__PURE__ */ jsxRuntime.jsx(CellSelect, { item: row }, row.id),
3998
4008
  columns.map((column, i) => {
3999
4009
  const cell = row[column.id];
4000
4010
  return /* @__PURE__ */ jsxRuntime.jsx(
4001
- table_js.Cell,
4011
+ Cell,
4002
4012
  {
4003
4013
  className: classNames(
4004
4014
  styles$1.tableCell,
@@ -4031,7 +4041,7 @@
4031
4041
  items: rowsPerPageOptions,
4032
4042
  defaultValue: (_a = rowsPerPageOptions.find((rowPerPage) => rowPerPage.value === defaultRowsPerPage.toString())) == null ? void 0 : _a.value.toString(),
4033
4043
  onValueChange: (v) => {
4034
- pagination.fns.onSetSize(Number(v));
4044
+ pagination2.fns.onSetSize(Number(v));
4035
4045
  setNumRowsPerPage(Number(v));
4036
4046
  },
4037
4047
  placeholder: rowsPerPageOptions[0].itemContent,
@@ -4039,14 +4049,14 @@
4039
4049
  }
4040
4050
  )
4041
4051
  ] }),
4042
- showPageNumber && /* @__PURE__ */ jsxRuntime.jsx(themes.Flex, { justify: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Text$1, { className: styles$1.pageText, size: "2", children: totalPages > 0 && `Page ${pagination.state.page + 1} of ${totalPages}` }) }),
4052
+ showPageNumber && /* @__PURE__ */ jsxRuntime.jsx(themes.Flex, { justify: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Text$1, { className: styles$1.pageText, size: "2", children: totalPages > 0 && `Page ${pagination2.state.page + 1} of ${totalPages}` }) }),
4043
4053
  showPageNavigation && /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { className: styles$1.rowsPerPageContainer, gap: "2", justify: "end", children: [
4044
4054
  /* @__PURE__ */ jsxRuntime.jsx(
4045
4055
  IconButton,
4046
4056
  {
4047
4057
  variant: "surface",
4048
- onClick: () => pagination.fns.onSetPage(0),
4049
- disabled: pagination.state.page === 0 || totalPages === 0,
4058
+ onClick: () => pagination2.fns.onSetPage(0),
4059
+ disabled: pagination2.state.page === 0 || totalPages === 0,
4050
4060
  "aria-label": "Go to first page",
4051
4061
  children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.DoubleArrowLeftIcon, {})
4052
4062
  }
@@ -4055,8 +4065,8 @@
4055
4065
  IconButton,
4056
4066
  {
4057
4067
  variant: "surface",
4058
- disabled: pagination.state.page === 0 || totalPages === 0,
4059
- onClick: () => pagination.fns.onSetPage(pagination.state.page - 1),
4068
+ disabled: pagination2.state.page === 0 || totalPages === 0,
4069
+ onClick: () => pagination2.fns.onSetPage(pagination2.state.page - 1),
4060
4070
  "aria-label": "Previous page",
4061
4071
  children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.ChevronLeftIcon, {})
4062
4072
  }
@@ -4065,8 +4075,8 @@
4065
4075
  IconButton,
4066
4076
  {
4067
4077
  variant: "surface",
4068
- disabled: pagination.state.page + 1 === totalPages || totalPages === 0,
4069
- onClick: () => pagination.fns.onSetPage(pagination.state.page + 1),
4078
+ disabled: pagination2.state.page + 1 === totalPages || totalPages === 0,
4079
+ onClick: () => pagination2.fns.onSetPage(pagination2.state.page + 1),
4070
4080
  "aria-label": "Next page",
4071
4081
  children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.ChevronRightIcon, {})
4072
4082
  }
@@ -4075,8 +4085,8 @@
4075
4085
  IconButton,
4076
4086
  {
4077
4087
  variant: "surface",
4078
- disabled: pagination.state.page + 1 === totalPages || totalPages === 0,
4079
- onClick: () => pagination.fns.onSetPage(totalPages - 1),
4088
+ disabled: pagination2.state.page + 1 === totalPages || totalPages === 0,
4089
+ onClick: () => pagination2.fns.onSetPage(totalPages - 1),
4080
4090
  "aria-label": "Go to last page",
4081
4091
  children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.DoubleArrowRightIcon, {})
4082
4092
  }
@@ -4290,6 +4300,7 @@
4290
4300
  exports2.IconColorUtility = IconColorUtility;
4291
4301
  exports2.Input = Input;
4292
4302
  exports2.Layout = Layout;
4303
+ exports2.LayoutContext = LayoutContext;
4293
4304
  exports2.LeftAndRightPanels = LeftAndRightPanels;
4294
4305
  exports2.MultiPagePopover = MultiPagePopover;
4295
4306
  exports2.MultiSelect = MultiSelect;