@geomak/ui 6.26.0 → 6.26.1

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
@@ -5729,48 +5729,45 @@ function Pagination({
5729
5729
  if (next) setPerPageKey(next.key);
5730
5730
  }
5731
5731
  }, [serverSide, options.perPage, picker]);
5732
- const navBtn = (icon, disabled, onClick) => /* @__PURE__ */ jsx(IconButton, { disabled, onClick, icon });
5733
- const chevronRight = /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "h-5 w-5", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) });
5734
- const doubleChevronRight = /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "h-5 w-5", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 5l7 7-7 7M5 5l7 7-7 7" }) });
5735
- return /* @__PURE__ */ jsxs("div", { className: "flex gap-2 items-center justify-end pt-2", children: [
5736
- navBtn(
5737
- /* @__PURE__ */ jsx("span", { className: "rotate-180 inline-flex", children: doubleChevronRight }),
5738
- activePage === 0,
5739
- () => onPageChange(0)
5740
- ),
5741
- navBtn(
5742
- /* @__PURE__ */ jsx("span", { className: "rotate-180 inline-flex", children: chevronRight }),
5743
- activePage === 0,
5744
- () => activePage > 0 && onPageChange(activePage - 1)
5745
- ),
5746
- /* @__PURE__ */ jsx("span", { className: "bg-surface-raised rounded-lg ml-2 mr-2 shadow-sm p-2 w-10 text-center select-none text-foreground", children: activePage + 1 }),
5747
- navBtn(
5748
- chevronRight,
5749
- activePage === maxPage,
5750
- () => activePage < maxPage && onPageChange(activePage + 1)
5751
- ),
5752
- navBtn(
5753
- doubleChevronRight,
5754
- activePage === maxPage,
5755
- () => onPageChange(maxPage)
5756
- ),
5757
- options.withPicker && /* @__PURE__ */ jsx(
5758
- Dropdown,
5759
- {
5760
- style: { width: 80, position: "relative", bottom: 4 },
5761
- hasSearch: false,
5762
- items: picker,
5763
- isMultiselect: false,
5764
- value: displayPerPageKey,
5765
- onChange: ({ target: { value } }) => {
5766
- if (Array.isArray(value)) return;
5767
- const numKey = typeof value === "number" ? value : Number(value);
5768
- if (!serverSide) setPerPageKey(numKey);
5769
- const opt = picker.find((o) => o.key === numKey);
5770
- onPerPageChange(opt?.label ?? opt?.value ?? numKey);
5732
+ const navBtn = (icon, disabled, onClick, title) => /* @__PURE__ */ jsx(IconButton, { type: "bordered", size: "sm", disabled, onClick, icon, title });
5733
+ const chevronRight = /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "h-4 w-4", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) });
5734
+ const doubleChevronRight = /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "h-4 w-4", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 5l7 7-7 7M5 5l7 7-7 7" }) });
5735
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-end gap-x-4 gap-y-3 pt-3", children: [
5736
+ options.withPicker && /* @__PURE__ */ jsxs("div", { className: "mr-auto flex items-center gap-2", children: [
5737
+ /* @__PURE__ */ jsx("span", { className: "whitespace-nowrap text-xs text-foreground-muted", children: "Rows per page" }),
5738
+ /* @__PURE__ */ jsx(
5739
+ Dropdown,
5740
+ {
5741
+ size: "sm",
5742
+ style: { width: 76 },
5743
+ hasSearch: false,
5744
+ items: picker,
5745
+ isMultiselect: false,
5746
+ value: displayPerPageKey,
5747
+ onChange: ({ target: { value } }) => {
5748
+ if (Array.isArray(value)) return;
5749
+ const numKey = typeof value === "number" ? value : Number(value);
5750
+ if (!serverSide) setPerPageKey(numKey);
5751
+ const opt = picker.find((o) => o.key === numKey);
5752
+ onPerPageChange(opt?.label ?? opt?.value ?? numKey);
5753
+ }
5771
5754
  }
5772
- }
5773
- )
5755
+ )
5756
+ ] }),
5757
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
5758
+ navBtn(/* @__PURE__ */ jsx("span", { className: "inline-flex rotate-180", children: doubleChevronRight }), activePage === 0, () => onPageChange(0), "First page"),
5759
+ navBtn(/* @__PURE__ */ jsx("span", { className: "inline-flex rotate-180", children: chevronRight }), activePage === 0, () => activePage > 0 && onPageChange(activePage - 1), "Previous page"),
5760
+ /* @__PURE__ */ jsxs("span", { className: "px-2 text-sm tabular-nums text-foreground-secondary select-none", children: [
5761
+ activePage + 1,
5762
+ " ",
5763
+ /* @__PURE__ */ jsxs("span", { className: "text-foreground-muted", children: [
5764
+ "/ ",
5765
+ maxPage + 1
5766
+ ] })
5767
+ ] }),
5768
+ navBtn(chevronRight, activePage === maxPage, () => activePage < maxPage && onPageChange(activePage + 1), "Next page"),
5769
+ navBtn(doubleChevronRight, activePage === maxPage, () => onPageChange(maxPage), "Last page")
5770
+ ] })
5774
5771
  ] });
5775
5772
  }
5776
5773
  function Table({
@@ -8498,7 +8495,7 @@ function OtpInput({
8498
8495
  emit(valid.join(""));
8499
8496
  focusBox(valid.length);
8500
8497
  };
8501
- return /* @__PURE__ */ jsx(Field, { className, label, htmlFor, errorId, errorMessage, required, layout, helperText, children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", role: "group", "aria-label": typeof label === "string" ? label : "One-time code", children: chars.map((char, idx) => /* @__PURE__ */ jsxs(React29.Fragment, { children: [
8498
+ return /* @__PURE__ */ jsx(Field, { className, label, htmlFor, errorId, errorMessage, required, layout, helperText, children: /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-2", role: "group", "aria-label": typeof label === "string" ? label : "One-time code", children: chars.map((char, idx) => /* @__PURE__ */ jsxs(React29.Fragment, { children: [
8502
8499
  /* @__PURE__ */ jsx(
8503
8500
  "input",
8504
8501
  {
@@ -8909,9 +8906,9 @@ function DateRangePicker({
8909
8906
  {
8910
8907
  align: "start",
8911
8908
  sideOffset: 4,
8912
- className: "bg-surface text-foreground border border-border rounded-lg shadow-md z-50 p-3 flex gap-3 animate-in fade-in-0 zoom-in-95",
8909
+ className: "bg-surface text-foreground border border-border rounded-lg shadow-md z-50 p-3 flex flex-col gap-3 sm:flex-row max-w-[calc(100vw-1rem)] max-h-[calc(100vh-2rem)] overflow-auto animate-in fade-in-0 zoom-in-95",
8913
8910
  children: [
8914
- presets && presets.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-1 pr-3 border-r border-border min-w-[120px]", children: presets.map((p) => /* @__PURE__ */ jsx(
8911
+ presets && presets.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-1 min-w-[120px] sm:pr-3 sm:border-r sm:border-border", children: presets.map((p) => /* @__PURE__ */ jsx(
8915
8912
  "button",
8916
8913
  {
8917
8914
  type: "button",
@@ -8924,7 +8921,7 @@ function DateRangePicker({
8924
8921
  },
8925
8922
  p.label
8926
8923
  )) }),
8927
- /* @__PURE__ */ jsxs("div", { className: "flex gap-4", children: [
8924
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 sm:flex-row", children: [
8928
8925
  /* @__PURE__ */ jsxs("div", { className: "relative", children: [
8929
8926
  /* @__PURE__ */ jsx(
8930
8927
  "button",