@rebasepro/ui 0.0.1-canary.f81da60 → 0.1.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.
@@ -17,6 +17,10 @@ interface SearchBarProps {
17
17
  disabled?: boolean;
18
18
  loading?: boolean;
19
19
  inputRef?: React.Ref<HTMLInputElement>;
20
+ /**
21
+ * Optional initial value for the search input, e.g. from URL params.
22
+ */
23
+ initialValue?: string;
20
24
  }
21
- export declare function SearchBar({ onClick, onTextSearch, placeholder, expandable, size, innerClassName, className, autoFocus, disabled, loading, inputRef }: SearchBarProps): import("react/jsx-runtime").JSX.Element;
25
+ export declare function SearchBar({ onClick, onTextSearch, placeholder, expandable, size, innerClassName, className, autoFocus, disabled, loading, inputRef, initialValue }: SearchBarProps): import("react/jsx-runtime").JSX.Element;
22
26
  export {};
package/dist/index.css CHANGED
@@ -50,8 +50,8 @@
50
50
  --color-surface-accent-600: #475569;
51
51
  --color-surface-accent-700: #334155;
52
52
  --color-surface-accent-800: #1e293b;
53
- --color-surface-accent-900: #0f172a;
54
- --color-surface-accent-950: #020617;
53
+ --color-surface-accent-900: #172033;
54
+ --color-surface-accent-950: #0f172a;
55
55
  }
56
56
 
57
57
  /* Chrome, Safari and Opera */
package/dist/index.es.js CHANGED
@@ -964,18 +964,18 @@ const ButtonInner = React__default.memo(React__default.forwardRef((t0, ref) => {
964
964
  "border border-primary bg-primary focus:ring-primary shadow-sm hover:shadow-md hover:brightness-110 text-white hover:text-white": t8,
965
965
  "border border-secondary bg-secondary focus:ring-secondary shadow-sm hover:shadow-md hover:brightness-110 text-white hover:text-white": t9,
966
966
  "border border-red-500 bg-red-500 hover:bg-red-600 focus:ring-red-500 shadow-sm hover:shadow-md text-white hover:text-white": t10,
967
- "border border-surface-accent-200 bg-surface-accent-200 hover:bg-surface-accent-300 focus:ring-surface-accent-400 shadow-sm hover:shadow-md text-text-primary hover:text-text-primary dark:text-text-primary-dark hover:dark:text-text-primary-dark": t11,
968
- "border border-transparent bg-surface-100 hover:bg-surface-accent-200 text-text-primary dark:bg-surface-700 dark:hover:bg-surface-accent-600 dark:text-text-primary-dark hover:text-text-primary dark:text-text-primary-dark hover:dark:text-text-primary-dark": t12,
967
+ "border border-surface-accent-200 bg-surface-accent-200 hover:bg-surface-accent-300 focus:ring-surface-accent-400 shadow-sm hover:shadow-md text-text-primary hover:text-text-primary dark:border-surface-accent-700 dark:bg-surface-accent-700 dark:hover:bg-surface-accent-600 dark:text-text-primary-dark hover:dark:text-text-primary-dark": t11,
968
+ "border border-transparent bg-surface-100 hover:bg-surface-accent-200 text-text-primary dark:bg-surface-700 dark:hover:bg-surface-accent-700 dark:text-text-primary-dark hover:text-text-primary dark:text-text-primary-dark hover:dark:text-text-primary-dark": t12,
969
969
  "border border-transparent text-primary hover:text-primary hover:bg-surface-accent-200 hover:bg-opacity-75 hover:bg-surface-accent-200/75 dark:hover:bg-surface-accent-800": t13,
970
970
  "border border-transparent text-secondary hover:text-secondary hover:bg-surface-accent-200 hover:bg-opacity-75 hover:bg-surface-accent-200/75 dark:hover:bg-surface-accent-800": t14,
971
971
  "border border-transparent text-red-500 hover:text-red-500 hover:bg-red-500 hover:bg-opacity-10 hover:bg-red-500/10": t15,
972
- "border border-transparent text-text-primary hover:text-text-primary dark:text-text-primary-dark hover:dark:text-text-primary-dark hover:bg-surface-accent-200 hover:dark:bg-surface-700": t16,
973
- "border border-transparent text-text-primary hover:text-text-primary hover:bg-surface-accent-200 dark:text-text-primary-dark dark:hover:text-text-primary-dark dark:hover:bg-surface-accent-700": t17,
972
+ "border border-transparent text-text-primary hover:text-text-primary dark:text-text-primary-dark hover:dark:text-text-primary-dark hover:bg-surface-accent-200 hover:bg-opacity-75 hover:bg-surface-accent-200/75 dark:hover:bg-surface-accent-800": t16,
973
+ "border border-transparent text-text-primary hover:text-text-primary hover:bg-surface-accent-200 hover:bg-opacity-75 hover:bg-surface-accent-200/75 dark:text-text-primary-dark dark:hover:text-text-primary-dark dark:hover:bg-surface-accent-800": t17,
974
974
  "border border-primary text-primary hover:text-primary hover:bg-primary-bg hover:bg-primary/10": t18,
975
975
  "border border-secondary text-secondary hover:text-secondary hover:bg-secondary-bg": t19,
976
976
  "border border-red-500 text-red-500 hover:text-red-500 hover:bg-red-500 hover:text-white": t20,
977
- "border border-surface-accent-400 text-text-primary hover:text-text-primary dark:text-text-primary-dark hover:bg-surface-accent-200": t21,
978
- "border border-surface-300 text-text-primary hover:bg-surface-accent-200 dark:border-surface-600 dark:text-text-primary-dark dark:hover:bg-surface-accent-700": t22,
977
+ "border border-surface-accent-400 text-text-primary hover:text-text-primary dark:text-text-primary-dark dark:border-surface-accent-600 hover:bg-surface-accent-200 hover:bg-opacity-75 hover:bg-surface-accent-200/75 dark:hover:bg-surface-accent-800": t21,
978
+ "border border-surface-300 text-text-primary hover:bg-surface-accent-200 hover:bg-opacity-75 hover:bg-surface-accent-200/75 dark:border-surface-600 dark:text-text-primary-dark dark:hover:bg-surface-accent-800": t22,
979
979
  "text-text-disabled dark:text-text-disabled-dark": disabled,
980
980
  "border border-transparent opacity-50": t23,
981
981
  "border border-surface-500 opacity-50": t24,
@@ -1776,7 +1776,7 @@ function Chip(t0) {
1776
1776
  return t11;
1777
1777
  }
1778
1778
  const Tooltip = (t0) => {
1779
- const $ = c(28);
1779
+ const $ = c(30);
1780
1780
  const {
1781
1781
  open,
1782
1782
  defaultOpen,
@@ -1824,61 +1824,72 @@ const Tooltip = (t0) => {
1824
1824
  }
1825
1825
  const trigger = t4;
1826
1826
  let t5;
1827
- if ($[7] !== tooltipClassName) {
1828
- t5 = cls("TooltipContent", "max-w-lg leading-relaxed", "z-50 rounded px-3 py-2 text-xs leading-none bg-surface-accent-700 dark:bg-surface-accent-800 bg-opacity-90 bg-surface-accent-700/90 dark:bg-surface-accent-800/90 font-medium text-surface-accent-50 shadow-2xl select-none duration-400 ease-in transform opacity-100", tooltipClassName);
1829
- $[7] = tooltipClassName;
1830
- $[8] = t5;
1827
+ if ($[7] !== onOpenChange || $[8] !== open) {
1828
+ t5 = open !== void 0 ? {
1829
+ open,
1830
+ onOpenChange
1831
+ } : {};
1832
+ $[7] = onOpenChange;
1833
+ $[8] = open;
1834
+ $[9] = t5;
1831
1835
  } else {
1832
- t5 = $[8];
1836
+ t5 = $[9];
1833
1837
  }
1834
- const t6 = sideOffset === void 0 ? 4 : sideOffset;
1835
- let t7;
1836
- if ($[9] !== align || $[10] !== side || $[11] !== t5 || $[12] !== t6 || $[13] !== title || $[14] !== tooltipStyle) {
1837
- t7 = /* @__PURE__ */ jsx(TooltipPrimitive.Content, { className: t5, style: tooltipStyle, sideOffset: t6, align, side, children: title });
1838
- $[9] = align;
1839
- $[10] = side;
1840
- $[11] = t5;
1841
- $[12] = t6;
1842
- $[13] = title;
1843
- $[14] = tooltipStyle;
1844
- $[15] = t7;
1838
+ let t6;
1839
+ if ($[10] !== tooltipClassName) {
1840
+ t6 = cls("TooltipContent", "max-w-lg leading-relaxed", "z-50 rounded px-3 py-2 text-xs leading-none bg-surface-accent-700 dark:bg-surface-accent-800 bg-opacity-90 bg-surface-accent-700/90 dark:bg-surface-accent-800/90 font-medium text-surface-accent-50 shadow-2xl select-none duration-400 ease-in transform opacity-100", tooltipClassName);
1841
+ $[10] = tooltipClassName;
1842
+ $[11] = t6;
1845
1843
  } else {
1846
- t7 = $[15];
1844
+ t6 = $[11];
1847
1845
  }
1846
+ const t7 = sideOffset === void 0 ? 4 : sideOffset;
1848
1847
  let t8;
1849
- if ($[16] !== finalContainer || $[17] !== t7) {
1850
- t8 = /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { container: finalContainer, children: t7 });
1851
- $[16] = finalContainer;
1852
- $[17] = t7;
1848
+ if ($[12] !== align || $[13] !== side || $[14] !== t6 || $[15] !== t7 || $[16] !== title || $[17] !== tooltipStyle) {
1849
+ t8 = /* @__PURE__ */ jsx(TooltipPrimitive.Content, { className: t6, style: tooltipStyle, sideOffset: t7, align, side, children: title });
1850
+ $[12] = align;
1851
+ $[13] = side;
1852
+ $[14] = t6;
1853
+ $[15] = t7;
1854
+ $[16] = title;
1855
+ $[17] = tooltipStyle;
1853
1856
  $[18] = t8;
1854
1857
  } else {
1855
1858
  t8 = $[18];
1856
1859
  }
1857
1860
  let t9;
1858
- if ($[19] !== defaultOpen || $[20] !== onOpenChange || $[21] !== open || $[22] !== t8 || $[23] !== trigger) {
1859
- t9 = /* @__PURE__ */ jsxs(TooltipPrimitive.Root, { open, onOpenChange, defaultOpen, children: [
1861
+ if ($[19] !== finalContainer || $[20] !== t8) {
1862
+ t9 = /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { container: finalContainer, children: t8 });
1863
+ $[19] = finalContainer;
1864
+ $[20] = t8;
1865
+ $[21] = t9;
1866
+ } else {
1867
+ t9 = $[21];
1868
+ }
1869
+ let t10;
1870
+ if ($[22] !== defaultOpen || $[23] !== t5 || $[24] !== t9 || $[25] !== trigger) {
1871
+ t10 = /* @__PURE__ */ jsxs(TooltipPrimitive.Root, { ...t5, defaultOpen, children: [
1860
1872
  trigger,
1861
- t8
1873
+ t9
1862
1874
  ] });
1863
- $[19] = defaultOpen;
1864
- $[20] = onOpenChange;
1865
- $[21] = open;
1866
- $[22] = t8;
1867
- $[23] = trigger;
1875
+ $[22] = defaultOpen;
1876
+ $[23] = t5;
1868
1877
  $[24] = t9;
1878
+ $[25] = trigger;
1879
+ $[26] = t10;
1869
1880
  } else {
1870
- t9 = $[24];
1881
+ t10 = $[26];
1871
1882
  }
1872
- let t10;
1873
- if ($[25] !== delayDuration || $[26] !== t9) {
1874
- t10 = /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { delayDuration, children: t9 });
1875
- $[25] = delayDuration;
1876
- $[26] = t9;
1877
- $[27] = t10;
1883
+ let t11;
1884
+ if ($[27] !== delayDuration || $[28] !== t10) {
1885
+ t11 = /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { delayDuration, children: t10 });
1886
+ $[27] = delayDuration;
1887
+ $[28] = t10;
1888
+ $[29] = t11;
1878
1889
  } else {
1879
- t10 = $[27];
1890
+ t11 = $[29];
1880
1891
  }
1881
- return t10;
1892
+ return t11;
1882
1893
  };
1883
1894
  const styles$2 = `
1884
1895
 
@@ -2334,7 +2345,7 @@ const DateTimeField = ({
2334
2345
  /* @__PURE__ */ jsx(IconButton, { onClick: (e_2) => {
2335
2346
  e_2.stopPropagation();
2336
2347
  inputRef.current?.showPicker();
2337
- }, className: "absolute right-3 top-1/2 transform -translate-y-1/2 text-surface-accent-500!", children: /* @__PURE__ */ jsx(CalendarIcon, { color: "disabled" }) }),
2348
+ }, className: "absolute right-3 top-1/2 transform -translate-y-1/2 text-surface-accent-500!", children: /* @__PURE__ */ jsx(CalendarIcon, {}) }),
2338
2349
  clearable && value && /* @__PURE__ */ jsx(IconButton, { onClick: handleClear, className: "absolute right-14 top-1/2 transform -translate-y-1/2 text-surface-accent-400 ", children: /* @__PURE__ */ jsx(XIcon, {}) })
2339
2350
  ] }),
2340
2351
  invalidValue && /* @__PURE__ */ jsxs("div", { className: "flex items-center m-2", children: [
@@ -5046,12 +5057,13 @@ function SearchBar(t0) {
5046
5057
  autoFocus,
5047
5058
  disabled,
5048
5059
  loading,
5049
- inputRef
5060
+ inputRef,
5061
+ initialValue
5050
5062
  } = t0;
5051
5063
  const placeholder = t1 === void 0 ? "Search" : t1;
5052
5064
  const expandable = t2 === void 0 ? false : t2;
5053
5065
  const size = t3 === void 0 ? "medium" : t3;
5054
- const [searchText, setSearchText] = useState("");
5066
+ const [searchText, setSearchText] = useState(initialValue ?? "");
5055
5067
  const [active, setActive] = useState(false);
5056
5068
  const deferredValues = useDebounceValue(searchText, 200);
5057
5069
  let t4;
@@ -7405,7 +7417,7 @@ const VirtualTableHeader = React__default.memo(function VirtualTableHeader2(t0)
7405
7417
  const thisColumnIsResizing = isResizingIndex === columnIndex;
7406
7418
  const anotherColumnIsResizing = isResizingIndex !== columnIndex && isResizingIndex > 0;
7407
7419
  const hovered = !anotherColumnIsResizing && (onHover || thisColumnIsResizing);
7408
- const t3 = isDragging ? "bg-primary-bg dark:bg-primary-bg-dark" : "bg-surface-50 dark:bg-surface-800";
7420
+ const t3 = isDragging ? "bg-primary-bg dark:bg-primary-bg-dark" : "bg-surface-50 dark:bg-surface-900";
7409
7421
  const t4 = !isDragging && "hover:bg-surface-100 dark:hover:bg-surface-900 hover:bg-opacity-50 hover:bg-surface-100/50 dark:hover:bg-opacity-50 dark:hover:bg-surface-900/50";
7410
7422
  const t5 = column.frozen ? "sticky left-0 z-10" : "relative z-0";
7411
7423
  const t6 = isDraggable && "cursor-grab";
@@ -7496,7 +7508,7 @@ const VirtualTableHeader = React__default.memo(function VirtualTableHeader2(t0)
7496
7508
  }
7497
7509
  let t18;
7498
7510
  if ($[28] !== column.key || $[29] !== column.sortable || $[30] !== hovered || $[31] !== onColumnSort || $[32] !== onHover || $[33] !== openFilter || $[34] !== sort) {
7499
- t18 = column.sortable && (sort || hovered || openFilter) && /* @__PURE__ */ jsx(Badge, { color: "secondary", invisible: !sort, children: /* @__PURE__ */ jsxs(IconButton, { size: "small", className: onHover || openFilter ? "bg-white dark:bg-surface-800" : void 0, onClick: () => {
7511
+ t18 = column.sortable && (sort || hovered || openFilter) && /* @__PURE__ */ jsx(Badge, { color: "secondary", invisible: !sort, children: /* @__PURE__ */ jsxs(IconButton, { size: "small", className: onHover || openFilter ? "bg-white dark:bg-surface-900" : void 0, onClick: () => {
7500
7512
  onColumnSort(column.key);
7501
7513
  }, children: [
7502
7514
  !sort && /* @__PURE__ */ jsx(ArrowUpIcon, {}),
@@ -7528,7 +7540,7 @@ const VirtualTableHeader = React__default.memo(function VirtualTableHeader2(t0)
7528
7540
  }
7529
7541
  let t20;
7530
7542
  if ($[39] !== column || $[40] !== createFilterField || $[41] !== filter || $[42] !== hidden || $[43] !== onHover || $[44] !== openFilter || $[45] !== update) {
7531
- t20 = column.filter && createFilterField && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Badge, { color: "secondary", invisible: !filter, children: /* @__PURE__ */ jsx(Popover, { open: openFilter, onOpenChange: setOpenFilter, className: hidden ? "hidden" : void 0, modal: true, trigger: /* @__PURE__ */ jsx(IconButton, { className: onHover || openFilter ? "bg-white dark:bg-surface-800" : void 0, size: "small", onClick: handleSettingsClick, children: /* @__PURE__ */ jsx(FilterIcon, { size: iconSize.small }) }), children: /* @__PURE__ */ jsx(FilterForm, { column, filter, onHover, onFilterUpdate: update, createFilterField, hidden, setHidden }) }) }) });
7543
+ t20 = column.filter && createFilterField && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Badge, { color: "secondary", invisible: !filter, children: /* @__PURE__ */ jsx(Popover, { open: openFilter, onOpenChange: setOpenFilter, className: hidden ? "hidden" : void 0, modal: true, trigger: /* @__PURE__ */ jsx(IconButton, { className: onHover || openFilter ? "bg-white dark:bg-surface-900" : void 0, size: "small", onClick: handleSettingsClick, children: /* @__PURE__ */ jsx(FilterIcon, { size: iconSize.small }) }), children: /* @__PURE__ */ jsx(FilterForm, { column, filter, onHover, onFilterUpdate: update, createFilterField, hidden, setHidden }) }) }) });
7532
7544
  $[39] = column;
7533
7545
  $[40] = createFilterField;
7534
7546
  $[41] = filter;
@@ -7957,7 +7969,7 @@ const VirtualTableHeaderRow = ({
7957
7969
  setIsResizing(index_0);
7958
7970
  setCursorDocument(true);
7959
7971
  }, [setCursorDocument]);
7960
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: cls(defaultBorderMixin, "z-20 sticky min-w-full flex w-fit flex-row top-0 left-0 border-b bg-surface-50 dark:bg-surface-800"), style: {
7972
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: cls(defaultBorderMixin, "z-20 sticky min-w-full flex w-fit flex-row top-0 left-0 border-b bg-surface-50 dark:bg-surface-900"), style: {
7961
7973
  height: headerHeight
7962
7974
  }, children: [
7963
7975
  columns.map((column_0, columnIndex) => {
@@ -8002,7 +8014,7 @@ const VirtualTableRow = React__default.memo(function VirtualTableRow2(t0) {
8002
8014
  const onClick = t1;
8003
8015
  let t2;
8004
8016
  if ($[4] !== hoverRow || $[5] !== onRowClick || $[6] !== rowClassName || $[7] !== rowData) {
8005
- t2 = cls("flex min-w-full text-sm border-b border-surface-200/60 dark:border-surface-700/60 dark:bg-surface-900", rowClassName ? rowClassName(rowData) : "", {
8017
+ t2 = cls("flex min-w-full text-sm border-b border-surface-200/60 dark:border-surface-700/60 dark:bg-surface-800", rowClassName ? rowClassName(rowData) : "", {
8006
8018
  "hover:!bg-surface-50/75 dark:hover:!bg-surface-800/75": hoverRow,
8007
8019
  "cursor-pointer ": onRowClick
8008
8020
  });
@@ -8098,7 +8110,7 @@ const innerElementType = forwardRef((t0, ref) => {
8098
8110
  /* @__PURE__ */ jsx("div", { style: {
8099
8111
  position: "sticky",
8100
8112
  top: 0,
8101
- zIndex: 10
8113
+ zIndex: 20
8102
8114
  }, children: /* @__PURE__ */ jsx(VirtualTableHeaderRow, { ...virtualTableProps }) }),
8103
8115
  !customView && children
8104
8116
  ] }) }),
@@ -8291,7 +8303,7 @@ const VirtualTable = React__default.memo(function VirtualTable2({
8291
8303
  const customView = error ? /* @__PURE__ */ jsxs(CenteredView, { maxWidth: "2xl", className: "flex flex-col gap-2", children: [
8292
8304
  /* @__PURE__ */ jsx(Typography, { variant: "h6", children: "Error" }),
8293
8305
  error?.message && /* @__PURE__ */ jsx(SafeLinkRenderer, { text: error.message })
8294
- ] }) : empty ? loading ? /* @__PURE__ */ jsx(CircularProgressCenter, {}) : /* @__PURE__ */ jsx("div", { className: "flex flex-col overflow-auto items-center justify-center p-8 h-full", children: emptyComponent }) : void 0;
8306
+ ] }) : empty ? loading ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-12 px-8", children: /* @__PURE__ */ jsx(CircularProgress, { size: "small" }) }) : /* @__PURE__ */ jsx("div", { className: "flex flex-col overflow-auto items-center justify-center py-12 px-8", children: emptyComponent }) : void 0;
8295
8307
  const virtualListController = useMemo(() => ({
8296
8308
  data,
8297
8309
  rowHeight,
@@ -8386,7 +8398,7 @@ const SortableCellWrapper = (t0) => {
8386
8398
  t5 = $[8];
8387
8399
  }
8388
8400
  const style = t5;
8389
- const t6 = frozen && "sticky left-0 z-10 bg-white dark:bg-surface-800";
8401
+ const t6 = frozen && "sticky left-0 z-10 bg-white dark:bg-surface-900";
8390
8402
  let t7;
8391
8403
  if ($[9] !== t6) {
8392
8404
  t7 = cls("flex-shrink-0", t6);
@@ -8467,7 +8479,7 @@ function MemoizedList({
8467
8479
  columnIndex,
8468
8480
  extraData
8469
8481
  }
8470
- ) }, `cell_wrapper_${column.key}`) : /* @__PURE__ */ jsx("div", { className: cls("flex-shrink-0 relative", column.frozen && "sticky left-0 z-10 bg-white dark:bg-surface-800"), style: {
8482
+ ) }, `cell_wrapper_${column.key}`) : /* @__PURE__ */ jsx("div", { className: cls("flex-shrink-0 relative", column.frozen && "sticky left-0 z-10 bg-white dark:bg-surface-900"), style: {
8471
8483
  minWidth: column.width,
8472
8484
  maxWidth: column.width,
8473
8485
  width: column.width