UNPKG

@vela-ui/react

Version:

Vela UI React components

64 lines (62 loc) 2.71 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/components/native-select.tsx var native_select_exports = {}; __export(native_select_exports, { NativeSelect: () => NativeSelect }); module.exports = __toCommonJS(native_select_exports); var import_tailwind_variants = require("tailwind-variants"); var import_jsx_runtime = require("react/jsx-runtime"); var selectVariants = (0, import_tailwind_variants.tv)({ base: [ "border-input dark:bg-input/30 dark:hover:bg-input/50 relative w-full appearance-none rounded-md border bg-transparent px-3 pr-9 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow]", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] focus-visible:outline-none", "disabled:cursor-not-allowed disabled:opacity-50", "aria-invalid:ring-destructive/20 aria-invalid:dark:ring-destructive/40 aria-invalid:border-destructive" ], variants: { size: { xs: "h-8", sm: "h-9", md: "h-10", lg: "h-11" } }, defaultVariants: { size: "md" } }); var styles = { backgroundRepeat: "no-repeat", backgroundPosition: "right 0.75rem center", backgroundSize: "1.25em", paddingRight: "2.5rem", backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='oklch(70.8% 0 0)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")` }; function NativeSelect({ className, placeholder, size = "md", ...props }) { return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("select", { className: selectVariants({ className, size }), style: styles, ...props, children: [ placeholder && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "", children: placeholder }), props.children ] }); } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { NativeSelect });