@geomak/ui 7.2.2 → 7.3.0
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.cjs +343 -314
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +56 -27
- package/dist/index.js.map +1 -1
- package/dist/styles.css +6 -0
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2647,12 +2647,20 @@ declare function TopBar({ brand, center, actions, height, className, }: TopBarPr
|
|
|
2647
2647
|
/** ─────────────────── types ─────────────────── */
|
|
2648
2648
|
interface SidebarItem {
|
|
2649
2649
|
key: string;
|
|
2650
|
-
icon
|
|
2650
|
+
/** Leading icon. Optional for nested sub-items (they show a dot instead). */
|
|
2651
|
+
icon?: react__default.ReactNode;
|
|
2651
2652
|
label: string;
|
|
2652
2653
|
isActive?: boolean;
|
|
2653
2654
|
onClick?: () => void;
|
|
2654
2655
|
/** Numeric badge shown on the icon */
|
|
2655
2656
|
badge?: number;
|
|
2657
|
+
/**
|
|
2658
|
+
* Nested sub-items. When present (and the sidebar is expanded), the item
|
|
2659
|
+
* becomes an expandable group with a chevron; clicking toggles the children.
|
|
2660
|
+
*/
|
|
2661
|
+
items?: SidebarItem[];
|
|
2662
|
+
/** Start the sub-menu expanded. Defaults to open when a descendant is active. */
|
|
2663
|
+
defaultOpen?: boolean;
|
|
2656
2664
|
}
|
|
2657
2665
|
interface SidebarSection {
|
|
2658
2666
|
key: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -2647,12 +2647,20 @@ declare function TopBar({ brand, center, actions, height, className, }: TopBarPr
|
|
|
2647
2647
|
/** ─────────────────── types ─────────────────── */
|
|
2648
2648
|
interface SidebarItem {
|
|
2649
2649
|
key: string;
|
|
2650
|
-
icon
|
|
2650
|
+
/** Leading icon. Optional for nested sub-items (they show a dot instead). */
|
|
2651
|
+
icon?: react__default.ReactNode;
|
|
2651
2652
|
label: string;
|
|
2652
2653
|
isActive?: boolean;
|
|
2653
2654
|
onClick?: () => void;
|
|
2654
2655
|
/** Numeric badge shown on the icon */
|
|
2655
2656
|
badge?: number;
|
|
2657
|
+
/**
|
|
2658
|
+
* Nested sub-items. When present (and the sidebar is expanded), the item
|
|
2659
|
+
* becomes an expandable group with a chevron; clicking toggles the children.
|
|
2660
|
+
*/
|
|
2661
|
+
items?: SidebarItem[];
|
|
2662
|
+
/** Start the sub-menu expanded. Defaults to open when a descendant is active. */
|
|
2663
|
+
defaultOpen?: boolean;
|
|
2656
2664
|
}
|
|
2657
2665
|
interface SidebarSection {
|
|
2658
2666
|
key: string;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { icons_default as Icon, createIcon } from './chunk-KAFJJO5O.js';
|
|
2
2
|
import { colors_default } from './chunk-I2P4JJDB.js';
|
|
3
3
|
export { colors_default as COLORS, PALETTE as palette, semanticTokens, vars } from './chunk-I2P4JJDB.js';
|
|
4
|
-
import
|
|
4
|
+
import React30, { createContext, useState, useEffect, useMemo, useId, useCallback, useRef, useContext, useSyncExternalStore, useLayoutEffect } from 'react';
|
|
5
5
|
import { createPortal } from 'react-dom';
|
|
6
6
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
@@ -555,7 +555,7 @@ var SIZE_CLASSES = {
|
|
|
555
555
|
md: "h-9 px-4 text-sm gap-1.5 rounded-lg",
|
|
556
556
|
lg: "h-11 px-5 text-sm gap-2 rounded-xl"
|
|
557
557
|
};
|
|
558
|
-
var Button =
|
|
558
|
+
var Button = React30.forwardRef(function Button2({
|
|
559
559
|
content,
|
|
560
560
|
variant = "primary",
|
|
561
561
|
size = "md",
|
|
@@ -663,7 +663,7 @@ function MenuButton({
|
|
|
663
663
|
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
664
664
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
|
|
665
665
|
].join(" "),
|
|
666
|
-
children: items.map((item) => /* @__PURE__ */ jsxs(
|
|
666
|
+
children: items.map((item) => /* @__PURE__ */ jsxs(React30.Fragment, { children: [
|
|
667
667
|
item.separatorBefore && /* @__PURE__ */ jsx(DropdownMenu.Separator, { className: "my-1 h-px bg-border" }),
|
|
668
668
|
/* @__PURE__ */ jsxs(
|
|
669
669
|
DropdownMenu.Item,
|
|
@@ -1762,7 +1762,7 @@ function Kbd({
|
|
|
1762
1762
|
style
|
|
1763
1763
|
}) {
|
|
1764
1764
|
if (keys && keys.length > 0) {
|
|
1765
|
-
return /* @__PURE__ */ jsx("span", { className: cx("inline-flex items-center gap-1", className), style, children: keys.map((k, i) => /* @__PURE__ */ jsxs(
|
|
1765
|
+
return /* @__PURE__ */ jsx("span", { className: cx("inline-flex items-center gap-1", className), style, children: keys.map((k, i) => /* @__PURE__ */ jsxs(React30.Fragment, { children: [
|
|
1766
1766
|
i > 0 && /* @__PURE__ */ jsx("span", { className: "text-foreground-muted text-xs select-none", children: separator }),
|
|
1767
1767
|
/* @__PURE__ */ jsx("kbd", { className: [cap, SIZE3[size]].join(" "), children: k })
|
|
1768
1768
|
] }, `${k}-${i}`)) });
|
|
@@ -1854,7 +1854,7 @@ function FlatCarousel({
|
|
|
1854
1854
|
style
|
|
1855
1855
|
}) {
|
|
1856
1856
|
const scrollerRef = useRef(null);
|
|
1857
|
-
const slides =
|
|
1857
|
+
const slides = React30.Children.toArray(children);
|
|
1858
1858
|
const [active, setActive] = useState(0);
|
|
1859
1859
|
const [atStart, setAtStart] = useState(true);
|
|
1860
1860
|
const [atEnd, setAtEnd] = useState(false);
|
|
@@ -1909,7 +1909,7 @@ function RotatingCarousel({
|
|
|
1909
1909
|
className = "",
|
|
1910
1910
|
style
|
|
1911
1911
|
}) {
|
|
1912
|
-
const slides =
|
|
1912
|
+
const slides = React30.Children.toArray(children);
|
|
1913
1913
|
const count = slides.length;
|
|
1914
1914
|
const [active, setActive] = useState(0);
|
|
1915
1915
|
const reduced = useReducedMotion();
|
|
@@ -5131,7 +5131,7 @@ function Wizard({
|
|
|
5131
5131
|
] });
|
|
5132
5132
|
}
|
|
5133
5133
|
var SearchIcon = /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", className: "w-4 h-4", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M10.5 3.75a6.75 6.75 0 100 13.5 6.75 6.75 0 000-13.5zM2.25 10.5a8.25 8.25 0 1114.59 5.28l4.69 4.69a.75.75 0 11-1.06 1.06l-4.69-4.69A8.25 8.25 0 012.25 10.5z", clipRule: "evenodd" }) });
|
|
5134
|
-
var SearchInput =
|
|
5134
|
+
var SearchInput = React30.forwardRef(function SearchInput2({ value, onChange, disabled, label, htmlFor, placeholder, name, inputStyle, style, layout = "vertical", size = "md", icon, helperText, className }, ref) {
|
|
5135
5135
|
return /* @__PURE__ */ jsx(Field, { className, label, htmlFor, layout, helperText, children: /* @__PURE__ */ jsxs(
|
|
5136
5136
|
"div",
|
|
5137
5137
|
{
|
|
@@ -5429,7 +5429,7 @@ function TableBody({
|
|
|
5429
5429
|
return /* @__PURE__ */ jsx("tbody", { children: rows.map((row, i) => {
|
|
5430
5430
|
const rowKey = getRowKey(row, i);
|
|
5431
5431
|
const isExpanded = expanded.has(rowKey);
|
|
5432
|
-
return /* @__PURE__ */ jsxs(
|
|
5432
|
+
return /* @__PURE__ */ jsxs(React30.Fragment, { children: [
|
|
5433
5433
|
/* @__PURE__ */ jsxs(
|
|
5434
5434
|
"tr",
|
|
5435
5435
|
{
|
|
@@ -5854,13 +5854,22 @@ function TopBar({
|
|
|
5854
5854
|
}
|
|
5855
5855
|
function NavItem({
|
|
5856
5856
|
item,
|
|
5857
|
-
isExpanded
|
|
5857
|
+
isExpanded,
|
|
5858
|
+
depth = 0
|
|
5858
5859
|
}) {
|
|
5860
|
+
const hasChildren = !!(item.items && item.items.length);
|
|
5861
|
+
const [open, setOpen] = useState(item.defaultOpen ?? (hasChildren && !!item.items?.some((c) => c.isActive)));
|
|
5862
|
+
const handleClick = () => {
|
|
5863
|
+
if (hasChildren && isExpanded) setOpen((o) => !o);
|
|
5864
|
+
item.onClick?.();
|
|
5865
|
+
};
|
|
5859
5866
|
const btn = /* @__PURE__ */ jsxs(
|
|
5860
5867
|
"button",
|
|
5861
5868
|
{
|
|
5862
5869
|
type: "button",
|
|
5863
|
-
onClick:
|
|
5870
|
+
onClick: handleClick,
|
|
5871
|
+
"aria-expanded": hasChildren && isExpanded ? open : void 0,
|
|
5872
|
+
style: isExpanded && depth > 0 ? { paddingLeft: 10 + depth * 18 } : void 0,
|
|
5864
5873
|
className: [
|
|
5865
5874
|
"group relative flex w-full items-center gap-2.5 rounded-md",
|
|
5866
5875
|
"px-2.5 py-2 transition-colors duration-100",
|
|
@@ -5869,24 +5878,44 @@ function NavItem({
|
|
|
5869
5878
|
].join(" "),
|
|
5870
5879
|
children: [
|
|
5871
5880
|
/* @__PURE__ */ jsxs("span", { className: "relative flex h-5 w-5 flex-shrink-0 items-center justify-center", children: [
|
|
5872
|
-
item.icon,
|
|
5881
|
+
item.icon ?? (depth > 0 ? /* @__PURE__ */ jsx("span", { className: "h-1.5 w-1.5 rounded-full bg-current opacity-50" }) : null),
|
|
5873
5882
|
item.badge !== void 0 && item.badge > 0 && /* @__PURE__ */ jsx("span", { className: "absolute -right-1 -top-1 flex h-3.5 w-3.5 items-center justify-center rounded-full bg-status-error text-[9px] font-bold text-white leading-none", children: item.badge > 99 ? "99+" : item.badge })
|
|
5874
5883
|
] }),
|
|
5875
|
-
isExpanded && /* @__PURE__ */ jsx(
|
|
5876
|
-
|
|
5884
|
+
isExpanded && /* @__PURE__ */ jsx(motion.span, { initial: false, animate: { opacity: 1 }, className: "flex-1 truncate text-left text-sm font-medium", children: item.label }),
|
|
5885
|
+
isExpanded && hasChildren && /* @__PURE__ */ jsx(
|
|
5886
|
+
"svg",
|
|
5877
5887
|
{
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
|
|
5888
|
+
viewBox: "0 0 24 24",
|
|
5889
|
+
fill: "none",
|
|
5890
|
+
stroke: "currentColor",
|
|
5891
|
+
strokeWidth: 2,
|
|
5892
|
+
"aria-hidden": "true",
|
|
5893
|
+
className: `h-4 w-4 flex-shrink-0 transition-transform duration-200 ${open ? "rotate-180" : ""}`,
|
|
5894
|
+
children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m6 9 6 6 6-6" })
|
|
5882
5895
|
}
|
|
5883
5896
|
),
|
|
5884
|
-
item.isActive && /* @__PURE__ */ jsx("span", { className: "absolute inset-y-0 left-0 w-[3px] rounded-r-full bg-accent" })
|
|
5897
|
+
item.isActive && depth === 0 && /* @__PURE__ */ jsx("span", { className: "absolute inset-y-0 left-0 w-[3px] rounded-r-full bg-accent" })
|
|
5885
5898
|
]
|
|
5886
5899
|
}
|
|
5887
5900
|
);
|
|
5888
|
-
if (isExpanded)
|
|
5889
|
-
|
|
5901
|
+
if (!isExpanded) {
|
|
5902
|
+
return /* @__PURE__ */ jsx(Tooltip, { title: item.label, placement: "right", delayDuration: 200, children: btn });
|
|
5903
|
+
}
|
|
5904
|
+
if (!hasChildren) return btn;
|
|
5905
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5906
|
+
btn,
|
|
5907
|
+
/* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: open && /* @__PURE__ */ jsx(
|
|
5908
|
+
motion.div,
|
|
5909
|
+
{
|
|
5910
|
+
initial: { height: 0, opacity: 0 },
|
|
5911
|
+
animate: { height: "auto", opacity: 1 },
|
|
5912
|
+
exit: { height: 0, opacity: 0 },
|
|
5913
|
+
transition: { duration: 0.2, ease: [0.16, 1, 0.3, 1] },
|
|
5914
|
+
style: { overflow: "hidden" },
|
|
5915
|
+
children: /* @__PURE__ */ jsx("div", { className: "mt-0.5 flex flex-col gap-0.5", children: item.items.map((child) => /* @__PURE__ */ jsx(NavItem, { item: child, isExpanded, depth: depth + 1 }, child.key)) })
|
|
5916
|
+
}
|
|
5917
|
+
) })
|
|
5918
|
+
] });
|
|
5890
5919
|
}
|
|
5891
5920
|
function Sidebar({
|
|
5892
5921
|
sections,
|
|
@@ -6081,8 +6110,8 @@ function MegaMenuLink({ href, icon, description, active, onClick, children, clas
|
|
|
6081
6110
|
function MegaMenuFeatured({ children, className = "" }) {
|
|
6082
6111
|
return /* @__PURE__ */ jsx("div", { className: cx("min-w-0 rounded-lg bg-surface-raised border border-border p-4 flex flex-col", className), children });
|
|
6083
6112
|
}
|
|
6084
|
-
var elementsOfType = (children, type) =>
|
|
6085
|
-
(c) =>
|
|
6113
|
+
var elementsOfType = (children, type) => React30.Children.toArray(children).filter(
|
|
6114
|
+
(c) => React30.isValidElement(c) && c.type === type
|
|
6086
6115
|
);
|
|
6087
6116
|
var MOBILE_CHEVRON = /* @__PURE__ */ jsx(
|
|
6088
6117
|
"svg",
|
|
@@ -6119,9 +6148,9 @@ function MobileLinkRow({ link, onNavigate }) {
|
|
|
6119
6148
|
);
|
|
6120
6149
|
}
|
|
6121
6150
|
function MobilePanel({ panel, onNavigate }) {
|
|
6122
|
-
const nodes =
|
|
6151
|
+
const nodes = React30.Children.toArray(panel.props.children);
|
|
6123
6152
|
return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-4 px-2 pb-3 pt-1", children: nodes.map((node, i) => {
|
|
6124
|
-
if (!
|
|
6153
|
+
if (!React30.isValidElement(node)) return null;
|
|
6125
6154
|
const el = node;
|
|
6126
6155
|
if (el.type === MegaMenuSection) {
|
|
6127
6156
|
const { title, children } = el.props;
|
|
@@ -6530,7 +6559,7 @@ function ThemeProvider({
|
|
|
6530
6559
|
className = "",
|
|
6531
6560
|
style
|
|
6532
6561
|
}) {
|
|
6533
|
-
const id =
|
|
6562
|
+
const id = React30.useId().replace(/:/g, "");
|
|
6534
6563
|
const scopeClass = `geo-th-${id}`;
|
|
6535
6564
|
const divRef = useRef(null);
|
|
6536
6565
|
useEffect(() => {
|
|
@@ -8834,7 +8863,7 @@ function OtpInput({
|
|
|
8834
8863
|
emit(valid.join(""));
|
|
8835
8864
|
focusBox(valid.length);
|
|
8836
8865
|
};
|
|
8837
|
-
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(
|
|
8866
|
+
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(React30.Fragment, { children: [
|
|
8838
8867
|
/* @__PURE__ */ jsx(
|
|
8839
8868
|
"input",
|
|
8840
8869
|
{
|
|
@@ -9890,7 +9919,7 @@ function Blog({
|
|
|
9890
9919
|
post.tag != null && !post.image && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Badge, { tone: "accent", variant: "soft", size: "sm", children: post.tag }) }),
|
|
9891
9920
|
/* @__PURE__ */ jsx("h3", { className: "text-base font-semibold leading-snug text-foreground transition-colors group-hover:text-accent", children: post.title }),
|
|
9892
9921
|
post.excerpt != null && /* @__PURE__ */ jsx("p", { className: "line-clamp-3 text-sm leading-relaxed text-foreground-secondary", children: post.excerpt }),
|
|
9893
|
-
meta.length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-auto flex flex-wrap items-center gap-x-2 gap-y-1 pt-3 text-xs text-foreground-muted", children: meta.map((m, j) => /* @__PURE__ */ jsxs(
|
|
9922
|
+
meta.length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-auto flex flex-wrap items-center gap-x-2 gap-y-1 pt-3 text-xs text-foreground-muted", children: meta.map((m, j) => /* @__PURE__ */ jsxs(React30.Fragment, { children: [
|
|
9894
9923
|
j > 0 && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\xB7" }),
|
|
9895
9924
|
/* @__PURE__ */ jsx("span", { children: m })
|
|
9896
9925
|
] }, j)) })
|