UNPKG

geoiq-frontend-ui-kit

Version:

This project is a UI kit for GeoIQ's frontend. It's built with React, TypeScript, and Vite.

123 lines (122 loc) 4.96 kB
import * as e from "react"; import { ChevronDownIcon as s, CheckIcon as p, ChevronUpIcon as f } from "lucide-react"; import * as t from "@radix-ui/react-select"; import { cn as o } from "./index88.es.js"; import { Typography as u } from "./index19.es.js"; const S = t.Group, v = t.Value, y = e.forwardRef(({ className: r, children: l, ...a }, n) => /* @__PURE__ */ e.createElement( t.Trigger, { ref: n, className: o( "data-[placeholder]:text-light-4 flex h-10 w-full items-center justify-between whitespace-nowrap rounded-lg border border-neutral-2 bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background focus:ring-4 focus:outline-none focus:ring-primary-1 focus:border-primary-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1", r ), ...a }, l, /* @__PURE__ */ e.createElement(t.Icon, { asChild: !0 }, /* @__PURE__ */ e.createElement(s, { className: "h-4 w-4 opacity-50" })) )); y.displayName = t.Trigger.displayName; const c = e.forwardRef(({ className: r, ...l }, a) => /* @__PURE__ */ e.createElement( t.ScrollUpButton, { ref: a, className: o( "flex cursor-default items-center justify-center py-1", r ), ...l }, /* @__PURE__ */ e.createElement(f, null) )); c.displayName = t.ScrollUpButton.displayName; const d = e.forwardRef(({ className: r, ...l }, a) => /* @__PURE__ */ e.createElement( t.ScrollDownButton, { ref: a, className: o( "flex cursor-default items-center justify-center py-1", r ), ...l }, /* @__PURE__ */ e.createElement(s, null) )); d.displayName = t.ScrollDownButton.displayName; const g = e.forwardRef( ({ className: r, children: l, position: a = "popper", portalContainer: n, ...m }, i) => /* @__PURE__ */ e.createElement(t.Portal, { container: n ?? void 0 }, /* @__PURE__ */ e.createElement( t.Content, { ref: i, className: o( "relative z-50 max-h-96 min-w-[8rem] rounded-lg border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", a === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", r ), position: a, ...m }, /* @__PURE__ */ e.createElement(c, null), /* @__PURE__ */ e.createElement( t.Viewport, { datatype: "view", className: o( "py-1 overflow-y-scroll custom-scrollbar", // Width matches the trigger, as popper-positioned selects usually do — but // height must NOT be pinned to the trigger's height (~1 row): that clips // every option after the first one to the trigger's own height instead of // letting the list grow with its content up to SelectContent's max-h-96. a === "popper" && "w-full min-w-[var(--radix-select-trigger-width)]" ) }, l ), /* @__PURE__ */ e.createElement(d, null) )) ); g.displayName = t.Content.displayName; const w = e.forwardRef(({ className: r, ...l }, a) => /* @__PURE__ */ e.createElement( t.Label, { ref: a, className: o("px-2 py-1.5 text-sm font-semibold", r), ...l } )); w.displayName = t.Label.displayName; const b = e.forwardRef(({ className: r, children: l, ...a }, n) => /* @__PURE__ */ e.createElement("div", { className: "py-0.5 px-1.5 bg-white" }, /* @__PURE__ */ e.createElement( t.Item, { ref: n, className: o( "relative flex w-full p-2 mr-8 cursor-default items-center rounded-md text-sm outline-none hover:bg-light-2 focus:bg-light-2 focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[state=checked]:bg-light-2", r ), ...a }, /* @__PURE__ */ e.createElement("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center" }, /* @__PURE__ */ e.createElement(t.ItemIndicator, null, /* @__PURE__ */ e.createElement(p, { className: "h-5 w-5 stroke-brand" }))), /* @__PURE__ */ e.createElement(t.ItemText, null, /* @__PURE__ */ e.createElement(u, { variant: "body1" }, l)) ))); b.displayName = t.Item.displayName; const h = e.forwardRef(({ className: r, ...l }, a) => /* @__PURE__ */ e.createElement( t.Separator, { ref: a, className: o("-mx-1 my-1 h-px bg-muted", r), ...l } )); h.displayName = t.Separator.displayName; export { g as SelectContent, S as SelectGroup, b as SelectItem, w as SelectLabel, d as SelectScrollDownButton, c as SelectScrollUpButton, h as SelectSeparator, y as SelectTrigger, v as SelectValue }; //# sourceMappingURL=index90.es.js.map