UNPKG

@eslamdevui/ui

Version:

A UI Library for Modern Web Apps, powered by Vue & Tailwind CSS.

1,828 lines (1,785 loc) 194 kB
import { pick } from '../../dist/runtime/utils/index.js'; import 'node:url'; import { kebabCase } from 'scule'; import { genExport } from 'knitwork'; import colors from 'tailwindcss/colors'; import { addTypeTemplate, addTemplate, hasNuxtModule } from '@nuxt/kit'; import { defuFn, defu } from 'defu'; const icons = { arrowDown: "i-lucide-arrow-down", arrowLeft: "i-lucide-arrow-left", arrowRight: "i-lucide-arrow-right", arrowUp: "i-lucide-arrow-up", caution: "i-lucide-circle-alert", check: "i-lucide-check", chevronDoubleLeft: "i-lucide-chevrons-left", chevronDoubleRight: "i-lucide-chevrons-right", chevronDown: "i-lucide-chevron-down", chevronLeft: "i-lucide-chevron-left", chevronRight: "i-lucide-chevron-right", chevronUp: "i-lucide-chevron-up", close: "i-lucide-x", copy: "i-lucide-copy", copyCheck: "i-lucide-copy-check", dark: "i-lucide-moon", ellipsis: "i-lucide-ellipsis", error: "i-lucide-circle-x", external: "i-lucide-arrow-up-right", eye: "i-lucide-eye", eyeOff: "i-lucide-eye-off", file: "i-lucide-file", folder: "i-lucide-folder", folderOpen: "i-lucide-folder-open", hash: "i-lucide-hash", info: "i-lucide-info", light: "i-lucide-sun", loading: "i-lucide-loader-circle", menu: "i-lucide-menu", minus: "i-lucide-minus", panelClose: "i-lucide-panel-left-close", panelOpen: "i-lucide-panel-left-open", plus: "i-lucide-plus", reload: "i-lucide-rotate-ccw", search: "i-lucide-search", stop: "i-lucide-square", success: "i-lucide-circle-check", system: "i-lucide-monitor", tip: "i-lucide-lightbulb", upload: "i-lucide-upload", warning: "i-lucide-triangle-alert" }; const getDefaultUiConfig = (colors) => ({ colors: pick({ primary: "green", secondary: "blue", success: "green", info: "blue", warning: "yellow", error: "red", neutral: "slate" }, [...colors || [], "neutral"]), icons }); const defaultOptions = { prefix: "U", fonts: true, colorMode: true, theme: { colors: void 0, transitions: true }, mdc: false, content: false }; const resolveColors = (colors) => { return colors?.length ? [.../* @__PURE__ */ new Set(["primary", ...colors])] : ["primary", "secondary", "success", "info", "warning", "error"]; }; const accordion$1 = { slots: { root: "w-full", item: "border-b border-default last:border-b-0", header: "flex", trigger: "group flex-1 flex items-center gap-1.5 font-medium text-sm py-3.5 focus-visible:outline-primary min-w-0", content: "data-[state=open]:animate-[accordion-down_200ms_ease-out] data-[state=closed]:animate-[accordion-up_200ms_ease-out] overflow-hidden focus:outline-none", body: "text-sm pb-3.5", leadingIcon: "shrink-0 size-5", trailingIcon: "shrink-0 size-5 ms-auto group-data-[state=open]:rotate-180 transition-transform duration-200", label: "text-start break-words" }, variants: { disabled: { true: { trigger: "cursor-not-allowed opacity-75" } } } }; const alert = (options) => ({ slots: { root: "relative overflow-hidden w-full rounded-lg p-4 flex gap-2.5", wrapper: "min-w-0 flex-1 flex flex-col", title: "text-sm font-medium", description: "text-sm opacity-90", icon: "shrink-0 size-5", avatar: "shrink-0", avatarSize: "2xl", actions: "flex flex-wrap gap-1.5 shrink-0", close: "p-0" }, variants: { color: { ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])), neutral: "" }, variant: { solid: "", outline: "", soft: "", subtle: "" }, orientation: { horizontal: { root: "items-center", actions: "items-center" }, vertical: { root: "items-start", actions: "items-start mt-2.5" } }, title: { true: { description: "mt-1" } } }, compoundVariants: [...(options.theme.colors || []).map((color) => ({ color, variant: "solid", class: { root: `bg-${color} text-inverted` } })), ...(options.theme.colors || []).map((color) => ({ color, variant: "outline", class: { root: `text-${color} ring ring-inset ring-${color}/25` } })), ...(options.theme.colors || []).map((color) => ({ color, variant: "soft", class: { root: `bg-${color}/10 text-${color}` } })), ...(options.theme.colors || []).map((color) => ({ color, variant: "subtle", class: { root: `bg-${color}/10 text-${color} ring ring-inset ring-${color}/25` } })), { color: "neutral", variant: "solid", class: { root: "text-inverted bg-inverted" } }, { color: "neutral", variant: "outline", class: { root: "text-highlighted bg-default ring ring-inset ring-default" } }, { color: "neutral", variant: "soft", class: { root: "text-highlighted bg-elevated/50" } }, { color: "neutral", variant: "subtle", class: { root: "text-highlighted bg-elevated/50 ring ring-inset ring-accented" } }], defaultVariants: { color: "primary", variant: "solid" } }); const authForm = { slots: { root: "w-full space-y-6", header: "flex flex-col text-center", leading: "mb-2", leadingIcon: "size-8 shrink-0 inline-block", title: "text-xl text-pretty font-semibold text-highlighted", description: "mt-1 text-base text-pretty text-muted", body: "gap-y-6 flex flex-col", providers: "space-y-3", checkbox: "", select: "", password: "w-full", otp: "w-full justify-center", input: "w-full", separator: "", form: "space-y-5", footer: "text-sm text-center text-muted mt-2" } }; const avatar = { slots: { root: "inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated", image: "h-full w-full rounded-[inherit] object-cover", fallback: "font-medium leading-none text-muted truncate", icon: "text-muted shrink-0" }, variants: { size: { "3xs": { root: "size-4 text-[8px]" }, "2xs": { root: "size-5 text-[10px]" }, "xs": { root: "size-6 text-xs" }, "sm": { root: "size-7 text-sm" }, "md": { root: "size-8 text-base" }, "lg": { root: "size-9 text-lg" }, "xl": { root: "size-10 text-xl" }, "2xl": { root: "size-11 text-[22px]" }, "3xl": { root: "size-12 text-2xl" } } }, defaultVariants: { size: "md" } }; const avatarGroup = { slots: { root: "inline-flex flex-row-reverse justify-end", base: "relative rounded-full ring-bg first:me-0" }, variants: { size: { "3xs": { base: "ring -me-0.5" }, "2xs": { base: "ring -me-0.5" }, "xs": { base: "ring -me-0.5" }, "sm": { base: "ring-2 -me-1.5" }, "md": { base: "ring-2 -me-1.5" }, "lg": { base: "ring-2 -me-1.5" }, "xl": { base: "ring-3 -me-2" }, "2xl": { base: "ring-3 -me-2" }, "3xl": { base: "ring-3 -me-2" } } }, defaultVariants: { size: "md" } }; const fieldGroupVariant = { fieldGroup: { horizontal: "not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]", vertical: "not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]" } }; const fieldGroupVariantWithRoot = { fieldGroup: { horizontal: { root: "group has-focus-visible:z-[1]", base: "group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none" }, vertical: { root: "group has-focus-visible:z-[1]", base: "group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none" } } }; const fieldGroup$1 = { base: "relative", variants: { size: { xs: "", sm: "", md: "", lg: "", xl: "" }, orientation: { horizontal: "inline-flex -space-x-px", vertical: "flex flex-col -space-y-px" } } }; const badge$1 = (options) => ({ slots: { base: "font-medium inline-flex items-center", label: "truncate", leadingIcon: "shrink-0", leadingAvatar: "shrink-0", leadingAvatarSize: "", trailingIcon: "shrink-0" }, variants: { ...fieldGroupVariant, color: { ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])), neutral: "" }, variant: { solid: "", outline: "", soft: "", subtle: "" }, size: { xs: { base: "text-[8px]/3 px-1 py-0.5 gap-1 rounded-sm", leadingIcon: "size-3", leadingAvatarSize: "3xs", trailingIcon: "size-3" }, sm: { base: "text-[10px]/3 px-1.5 py-1 gap-1 rounded-sm", leadingIcon: "size-3", leadingAvatarSize: "3xs", trailingIcon: "size-3" }, md: { base: "text-xs px-2 py-1 gap-1 rounded-md", leadingIcon: "size-4", leadingAvatarSize: "3xs", trailingIcon: "size-4" }, lg: { base: "text-sm px-2 py-1 gap-1.5 rounded-md", leadingIcon: "size-5", leadingAvatarSize: "2xs", trailingIcon: "size-5" }, xl: { base: "text-base px-2.5 py-1 gap-1.5 rounded-md", leadingIcon: "size-6", leadingAvatarSize: "2xs", trailingIcon: "size-6" } }, square: { true: "" } }, compoundVariants: [...(options.theme.colors || []).map((color) => ({ color, variant: "solid", class: `bg-${color} text-inverted` })), ...(options.theme.colors || []).map((color) => ({ color, variant: "outline", class: `text-${color} ring ring-inset ring-${color}/50` })), ...(options.theme.colors || []).map((color) => ({ color, variant: "soft", class: `bg-${color}/10 text-${color}` })), ...(options.theme.colors || []).map((color) => ({ color, variant: "subtle", class: `bg-${color}/10 text-${color} ring ring-inset ring-${color}/25` })), { color: "neutral", variant: "solid", class: "text-inverted bg-inverted" }, { color: "neutral", variant: "outline", class: "ring ring-inset ring-accented text-default bg-default" }, { color: "neutral", variant: "soft", class: "text-default bg-elevated" }, { color: "neutral", variant: "subtle", class: "ring ring-inset ring-accented text-default bg-elevated" }, { size: "xs", square: true, class: "p-0.5" }, { size: "sm", square: true, class: "p-1" }, { size: "md", square: true, class: "p-1" }, { size: "lg", square: true, class: "p-1" }, { size: "xl", square: true, class: "p-1" }], defaultVariants: { color: "primary", variant: "solid", size: "md" } }); const banner = (options) => ({ slots: { root: ["relative z-50 w-full", options.theme.transitions && "transition-colors"], container: "flex items-center justify-between gap-3 h-12", left: "hidden lg:flex-1 lg:flex lg:items-center", center: "flex items-center gap-1.5 min-w-0", right: "lg:flex-1 flex items-center justify-end", icon: "size-5 shrink-0 text-inverted pointer-events-none", title: "text-sm text-inverted font-medium truncate", actions: "flex gap-1.5 shrink-0 isolate", close: "text-inverted hover:bg-default/10 focus-visible:bg-default/10 -me-1.5 lg:me-0" }, variants: { color: { ...Object.fromEntries((options.theme.colors || []).map((color) => [color, { root: `bg-${color}` }])), neutral: { root: "bg-inverted" } }, to: { true: "" } }, compoundVariants: [...(options.theme.colors || []).map((color) => ({ color, to: true, class: { root: `hover:bg-${color}/90` } })), { color: "neutral", to: true, class: { root: "hover:bg-inverted/90" } }], defaultVariants: { color: "primary" } }); const blogPost = (options) => ({ slots: { root: "relative group/blog-post flex flex-col rounded-lg overflow-hidden", header: "relative overflow-hidden aspect-[16/9] w-full pointer-events-none", body: "min-w-0 flex-1 flex flex-col", footer: "", image: "object-cover object-top w-full h-full", title: "text-xl text-pretty font-semibold text-highlighted", description: "mt-1 text-base text-pretty", authors: "pt-4 mt-auto flex flex-wrap gap-x-3 gap-y-1.5", avatar: "", meta: "flex items-center gap-2 mb-2", date: "text-sm", badge: "" }, variants: { orientation: { horizontal: { root: "lg:grid lg:grid-cols-2 lg:items-center gap-x-8", body: "justify-center p-4 sm:p-6 lg:px-0" }, vertical: { root: "flex flex-col", body: "p-4 sm:p-6" } }, variant: { outline: { root: "bg-default ring ring-default", date: "text-toned", description: "text-muted" }, soft: { root: "bg-elevated/50", date: "text-muted", description: "text-toned" }, subtle: { root: "bg-elevated/50 ring ring-default", date: "text-muted", description: "text-toned" }, ghost: { date: "text-toned", description: "text-muted", header: "shadow-lg rounded-lg" }, naked: { root: "p-0 sm:p-0", date: "text-toned", description: "text-muted", header: "shadow-lg rounded-lg" } }, to: { true: { root: [options.theme.transitions && "transition"], image: "transform transition-transform duration-200 group-hover/blog-post:scale-110", avatar: "transform transition-transform duration-200 hover:scale-115" } }, image: { true: "" } }, compoundVariants: [{ variant: "outline", to: true, class: { root: "hover:bg-elevated/50" } }, { variant: "soft", to: true, class: { root: "hover:bg-elevated" } }, { variant: "subtle", to: true, class: { root: "hover:bg-elevated hover:ring-accented" } }, { variant: "ghost", to: true, class: { root: "hover:bg-elevated/50", header: ["group-hover/blog-post:shadow-none", options.theme.transitions && "transition-all"] } }, { variant: "ghost", to: true, orientation: "vertical", class: { header: "group-hover/blog-post:rounded-b-none" } }, { variant: "ghost", to: true, orientation: "horizontal", class: { header: "group-hover/blog-post:rounded-r-none" } }, { orientation: "vertical", image: false, variant: "naked", class: { body: "p-0 sm:p-0" } }], defaultVariants: { variant: "outline" } }); const blogPosts = { base: "flex flex-col gap-8 lg:gap-y-16", variants: { orientation: { horizontal: "sm:grid sm:grid-cols-2 lg:grid-cols-3", vertical: "" } } }; const breadcrumb = (options) => ({ slots: { root: "relative min-w-0", list: "flex items-center gap-1.5", item: "flex min-w-0", link: "group relative flex items-center gap-1.5 text-sm min-w-0 focus-visible:outline-primary", linkLeadingIcon: "shrink-0 size-5", linkLeadingAvatar: "shrink-0", linkLeadingAvatarSize: "2xs", linkLabel: "truncate", separator: "flex", separatorIcon: "shrink-0 size-5 text-muted" }, variants: { active: { true: { link: "text-primary font-semibold" }, false: { link: "text-muted font-medium" } }, disabled: { true: { link: "cursor-not-allowed opacity-75" } }, to: { true: "" } }, compoundVariants: [{ disabled: false, active: false, to: true, class: { link: ["hover:text-default", options.theme.transitions && "transition-colors"] } }] }); const button = (options) => ({ slots: { base: ["rounded-md font-medium inline-flex items-center disabled:cursor-not-allowed aria-disabled:cursor-not-allowed disabled:opacity-75 aria-disabled:opacity-75", options.theme.transitions && "transition-colors"], label: "truncate", leadingIcon: "shrink-0", leadingAvatar: "shrink-0", leadingAvatarSize: "", trailingIcon: "shrink-0" }, variants: { ...fieldGroupVariant, color: { ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])), neutral: "" }, variant: { solid: "", outline: "", soft: "", subtle: "", ghost: "", link: "" }, size: { xs: { base: "px-2 py-1 text-xs gap-1", leadingIcon: "size-4", leadingAvatarSize: "3xs", trailingIcon: "size-4" }, sm: { base: "px-2.5 py-1.5 text-xs gap-1.5", leadingIcon: "size-4", leadingAvatarSize: "3xs", trailingIcon: "size-4" }, md: { base: "px-2.5 py-1.5 text-sm gap-1.5", leadingIcon: "size-5", leadingAvatarSize: "2xs", trailingIcon: "size-5" }, lg: { base: "px-3 py-2 text-sm gap-2", leadingIcon: "size-5", leadingAvatarSize: "2xs", trailingIcon: "size-5" }, xl: { base: "px-3 py-2 text-base gap-2", leadingIcon: "size-6", leadingAvatarSize: "xs", trailingIcon: "size-6" } }, block: { true: { base: "w-full justify-center", trailingIcon: "ms-auto" } }, square: { true: "" }, leading: { true: "" }, trailing: { true: "" }, loading: { true: "" }, active: { true: { base: "" }, false: { base: "" } } }, compoundVariants: [...(options.theme.colors || []).map((color) => ({ color, variant: "solid", class: `text-inverted bg-${color} hover:bg-${color}/75 active:bg-${color}/75 disabled:bg-${color} aria-disabled:bg-${color} focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-${color}` })), ...(options.theme.colors || []).map((color) => ({ color, variant: "outline", class: `ring ring-inset ring-${color}/50 text-${color} hover:bg-${color}/10 active:bg-${color}/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent focus:outline-none focus-visible:ring-2 focus-visible:ring-${color}` })), ...(options.theme.colors || []).map((color) => ({ color, variant: "soft", class: `text-${color} bg-${color}/10 hover:bg-${color}/15 active:bg-${color}/15 focus:outline-none focus-visible:bg-${color}/15 disabled:bg-${color}/10 aria-disabled:bg-${color}/10` })), ...(options.theme.colors || []).map((color) => ({ color, variant: "subtle", class: `text-${color} ring ring-inset ring-${color}/25 bg-${color}/10 hover:bg-${color}/15 active:bg-${color}/15 disabled:bg-${color}/10 aria-disabled:bg-${color}/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-${color}` })), ...(options.theme.colors || []).map((color) => ({ color, variant: "ghost", class: `text-${color} hover:bg-${color}/10 active:bg-${color}/10 focus:outline-none focus-visible:bg-${color}/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent` })), ...(options.theme.colors || []).map((color) => ({ color, variant: "link", class: `text-${color} hover:text-${color}/75 active:text-${color}/75 disabled:text-${color} aria-disabled:text-${color} focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-${color}` })), { color: "neutral", variant: "solid", class: "text-inverted bg-inverted hover:bg-inverted/90 active:bg-inverted/90 disabled:bg-inverted aria-disabled:bg-inverted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-inverted" }, { color: "neutral", variant: "outline", class: "ring ring-inset ring-accented text-default bg-default hover:bg-elevated active:bg-elevated disabled:bg-default aria-disabled:bg-default focus:outline-none focus-visible:ring-2 focus-visible:ring-inverted" }, { color: "neutral", variant: "soft", class: "text-default bg-elevated hover:bg-accented/75 active:bg-accented/75 focus:outline-none focus-visible:bg-accented/75 disabled:bg-elevated aria-disabled:bg-elevated" }, { color: "neutral", variant: "subtle", class: "ring ring-inset ring-accented text-default bg-elevated hover:bg-accented/75 active:bg-accented/75 disabled:bg-elevated aria-disabled:bg-elevated focus:outline-none focus-visible:ring-2 focus-visible:ring-inverted" }, { color: "neutral", variant: "ghost", class: "text-default hover:bg-elevated active:bg-elevated focus:outline-none focus-visible:bg-elevated hover:disabled:bg-transparent dark:hover:disabled:bg-transparent hover:aria-disabled:bg-transparent dark:hover:aria-disabled:bg-transparent" }, { color: "neutral", variant: "link", class: "text-muted hover:text-default active:text-default disabled:text-muted aria-disabled:text-muted focus:outline-none focus-visible:ring-inset focus-visible:ring-2 focus-visible:ring-inverted" }, { size: "xs", square: true, class: "p-1" }, { size: "sm", square: true, class: "p-1.5" }, { size: "md", square: true, class: "p-1.5" }, { size: "lg", square: true, class: "p-2" }, { size: "xl", square: true, class: "p-2" }, { loading: true, leading: true, class: { leadingIcon: "animate-spin" } }, { loading: true, leading: false, trailing: true, class: { trailingIcon: "animate-spin" } }], defaultVariants: { color: "primary", variant: "solid", size: "md" } }); const calendar = (options) => ({ slots: { root: "", header: "flex items-center justify-between", body: "flex flex-col space-y-4 pt-4 sm:flex-row sm:space-x-4 sm:space-y-0", heading: "text-center font-medium truncate mx-auto", grid: "w-full border-collapse select-none space-y-1 focus:outline-none", gridRow: "grid grid-cols-7 place-items-center", gridWeekDaysRow: "mb-1 grid w-full grid-cols-7", gridBody: "grid", headCell: "rounded-md", cell: "relative text-center", cellTrigger: ["m-0.5 relative flex items-center justify-center rounded-full whitespace-nowrap focus-visible:ring-2 focus:outline-none data-disabled:text-muted data-unavailable:line-through data-unavailable:text-muted data-unavailable:pointer-events-none data-[selected]:text-inverted data-today:font-semibold data-[outside-view]:text-muted", options.theme.transitions && "transition"] }, variants: { color: { ...Object.fromEntries((options.theme.colors || []).map((color) => [color, { headCell: `text-${color}`, cellTrigger: `focus-visible:ring-${color} data-[selected]:bg-${color} data-today:not-data-[selected]:text-${color} data-[highlighted]:bg-${color}/20 hover:not-data-[selected]:bg-${color}/20` }])), neutral: { headCell: "text-highlighted", cellTrigger: "focus-visible:ring-inverted data-[selected]:bg-inverted data-today:not-data-[selected]:text-highlighted data-[highlighted]:bg-inverted/20 hover:not-data-[selected]:bg-inverted/10" } }, size: { xs: { heading: "text-xs", cell: "text-xs", headCell: "text-[10px]", cellTrigger: "size-7", body: "space-y-2 pt-2" }, sm: { heading: "text-xs", headCell: "text-xs", cell: "text-xs", cellTrigger: "size-7" }, md: { heading: "text-sm", headCell: "text-xs", cell: "text-sm", cellTrigger: "size-8" }, lg: { heading: "text-md", headCell: "text-md", cellTrigger: "size-9 text-md" }, xl: { heading: "text-lg", headCell: "text-lg", cellTrigger: "size-10 text-lg" } } }, defaultVariants: { size: "md", color: "primary" } }); const card$1 = { slots: { root: "rounded-lg overflow-hidden", header: "p-4 sm:px-6", body: "p-4 sm:p-6", footer: "p-4 sm:px-6" }, variants: { variant: { solid: { root: "bg-inverted text-inverted" }, outline: { root: "bg-default ring ring-default divide-y divide-default" }, soft: { root: "bg-elevated/50 divide-y divide-default" }, subtle: { root: "bg-elevated/50 ring ring-default divide-y divide-default" } } }, defaultVariants: { variant: "outline" } }; const carousel = (options) => ({ slots: { root: "relative focus:outline-none", viewport: "overflow-hidden", container: "flex items-start", item: "min-w-0 shrink-0 basis-full", controls: "", arrows: "", prev: "absolute rounded-full", next: "absolute rounded-full", dots: "absolute inset-x-0 -bottom-7 flex flex-wrap items-center justify-center gap-3", dot: ["cursor-pointer size-3 bg-accented rounded-full", options.theme.transitions && "transition"] }, variants: { orientation: { vertical: { container: "flex-col -mt-4", item: "pt-4", prev: "top-4 sm:-top-12 left-1/2 -translate-x-1/2 rotate-90 rtl:-rotate-90", next: "bottom-4 sm:-bottom-12 left-1/2 -translate-x-1/2 rotate-90 rtl:-rotate-90" }, horizontal: { container: "flex-row -ms-4", item: "ps-4", prev: "start-4 sm:-start-12 top-1/2 -translate-y-1/2", next: "end-4 sm:-end-12 top-1/2 -translate-y-1/2" } }, active: { true: { dot: "data-[state=active]:bg-inverted" } } } }); const changelogVersion = { slots: { root: "relative", container: "flex flex-col mx-auto max-w-2xl", header: "", meta: "flex items-center gap-3 mb-2", date: "text-sm/6 text-toned truncate", badge: "", title: "relative text-xl text-pretty font-semibold text-highlighted", description: "text-base text-pretty text-muted mt-1", imageWrapper: "relative overflow-hidden rounded-lg aspect-[16/9] mt-5 group/changelog-version-image", image: "object-cover object-top w-full h-full", authors: "flex flex-wrap gap-x-4 gap-y-1.5", footer: "border-t border-default pt-5 flex items-center justify-between", indicator: "absolute start-0 top-0 w-32 hidden lg:flex items-center justify-end gap-3 min-w-0", dot: "size-4 rounded-full bg-default ring ring-default flex items-center justify-center my-1", dotInner: "size-2 rounded-full bg-primary" }, variants: { body: { false: { footer: "mt-5" } }, badge: { false: { meta: "lg:hidden" } }, to: { true: { image: "transform transition-transform duration-200 group-hover/changelog-version-image:scale-105" } }, hidden: { true: { date: "lg:hidden" } } } }; const changelogVersions = { slots: { root: "relative", container: "flex flex-col gap-y-8 sm:gap-y-12 lg:gap-y-16", indicator: "absolute hidden lg:block overflow-hidden inset-y-3 start-32 h-full w-px bg-border -ms-[8.5px]", beam: "absolute start-0 top-0 w-full bg-primary will-change-[height]" } }; const chatMessage = (options) => ({ slots: { root: "group/message relative w-full", container: "relative flex items-start group-data-[role=user]/message:max-w-[75%]", leading: "inline-flex items-center justify-center min-h-6", leadingIcon: "shrink-0", leadingAvatar: "shrink-0", leadingAvatarSize: "", content: "relative text-pretty min-w-0", actions: ["opacity-0 group-hover/message:opacity-100 absolute bottom-0 flex items-center", options.theme.transitions && "transition-opacity"] }, variants: { variant: { solid: { content: "bg-inverted text-inverted" }, outline: { content: "bg-default ring ring-default" }, soft: { content: "bg-elevated/50" }, subtle: { content: "bg-elevated/50 ring ring-default" }, naked: { content: "" } }, side: { left: { container: "rtl:justify-end" }, right: { container: "ltr:justify-end ms-auto" } }, leading: { true: "" }, actions: { true: "" }, compact: { true: { root: "scroll-mt-3", container: "gap-1.5 pb-3", leadingIcon: "size-5", leadingAvatarSize: "2xs" }, false: { root: "scroll-mt-4 sm:scroll-mt-6", container: "gap-3 pb-8", leadingIcon: "size-8", leadingAvatarSize: "md" } } }, compoundVariants: [{ compact: true, actions: true, class: { container: "pb-8" } }, { leading: true, compact: false, side: "left", class: { actions: "left-11" } }, { leading: true, compact: true, side: "left", class: { actions: "left-6.5" } }, { variant: ["solid", "outline", "soft", "subtle"], compact: false, class: { content: "px-4 py-3 rounded-lg min-h-12", leading: "mt-2" } }, { variant: ["solid", "outline", "soft", "subtle"], compact: true, class: { content: "px-2 py-1 rounded-lg min-h-8", leading: "mt-1" } }], defaultVariants: { variant: "naked" } }); const chatMessages = { slots: { root: "w-full flex flex-col gap-1 flex-1 px-2.5 [&>article]:last-of-type:min-h-(--last-message-height)", indicator: "h-6 flex items-center gap-1 py-3 *:size-2 *:rounded-full *:bg-elevated [&>*:nth-child(1)]:animate-[bounce_1s_infinite] [&>*:nth-child(2)]:animate-[bounce_1s_0.15s_infinite] [&>*:nth-child(3)]:animate-[bounce_1s_0.3s_infinite]", viewport: "absolute inset-x-0 top-[86%] data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_200ms_ease-in]", autoScroll: "rounded-full absolute right-1/2 translate-x-1/2 bottom-0" }, variants: { compact: { true: "", false: "" } } }; const chatPalette = { slots: { root: "relative flex-1 flex flex-col min-h-0 min-w-0", prompt: "px-0 rounded-t-none border-t border-default", close: "", content: "overflow-y-auto flex-1 flex flex-col py-3" } }; const chatPrompt = { slots: { root: "relative flex flex-col items-stretch gap-2 px-2.5 py-2 w-full rounded-lg backdrop-blur", header: "flex items-center gap-1.5", body: "items-start", footer: "flex items-center justify-between gap-1.5", base: "text-base/5" }, variants: { variant: { outline: { root: "bg-default/75 ring ring-default" }, soft: { root: "bg-elevated/50" }, subtle: { root: "bg-elevated/50 ring ring-default" }, naked: { root: "" } } }, defaultVariants: { variant: "outline" } }; const chatPromptSubmit = { slots: { base: "" } }; const checkbox = (options) => ({ slots: { root: "relative flex items-start", container: "flex items-center", base: "rounded-sm ring ring-inset ring-accented overflow-hidden focus-visible:outline-2 focus-visible:outline-offset-2", indicator: "flex items-center justify-center size-full text-inverted", icon: "shrink-0 size-full", wrapper: "w-full", label: "block font-medium text-default", description: "text-muted" }, variants: { color: { ...Object.fromEntries((options.theme.colors || []).map((color) => [color, { base: `focus-visible:outline-${color}`, indicator: `bg-${color}` }])), neutral: { base: "focus-visible:outline-inverted", indicator: "bg-inverted" } }, variant: { list: { root: "" }, card: { root: "border border-muted rounded-lg" } }, indicator: { start: { root: "flex-row", wrapper: "ms-2" }, end: { root: "flex-row-reverse", wrapper: "me-2" }, hidden: { base: "sr-only", wrapper: "text-center" } }, size: { xs: { base: "size-3", container: "h-4", wrapper: "text-xs" }, sm: { base: "size-3.5", container: "h-4", wrapper: "text-xs" }, md: { base: "size-4", container: "h-5", wrapper: "text-sm" }, lg: { base: "size-4.5", container: "h-5", wrapper: "text-sm" }, xl: { base: "size-5", container: "h-6", wrapper: "text-base" } }, required: { true: { label: "after:content-['*'] after:ms-0.5 after:text-error" } }, disabled: { true: { base: "cursor-not-allowed opacity-75", label: "cursor-not-allowed opacity-75", description: "cursor-not-allowed opacity-75" } }, checked: { true: "" } }, compoundVariants: [ { size: "xs", variant: "card", class: { root: "p-2.5" } }, { size: "sm", variant: "card", class: { root: "p-3" } }, { size: "md", variant: "card", class: { root: "p-3.5" } }, { size: "lg", variant: "card", class: { root: "p-4" } }, { size: "xl", variant: "card", class: { root: "p-4.5" } }, ...(options.theme.colors || []).map((color) => ({ color, variant: "card", class: { root: `has-data-[state=checked]:border-${color}` } })), { color: "neutral", variant: "card", class: { root: "has-data-[state=checked]:border-inverted" } }, { variant: "card", disabled: true, class: { root: "cursor-not-allowed opacity-75" } } ], defaultVariants: { size: "md", color: "primary", variant: "list", indicator: "start" } }); const checkboxGroup = (options) => ({ slots: { root: "relative", fieldset: "flex gap-x-2", legend: "mb-1 block font-medium text-default", item: "" }, variants: { orientation: { horizontal: { fieldset: "flex-row" }, vertical: { fieldset: "flex-col" } }, color: { ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {}])), neutral: {} }, variant: { list: {}, card: {}, table: { item: "border border-muted" } }, size: { xs: { fieldset: "gap-y-0.5", legend: "text-xs" }, sm: { fieldset: "gap-y-0.5", legend: "text-xs" }, md: { fieldset: "gap-y-1", legend: "text-sm" }, lg: { fieldset: "gap-y-1", legend: "text-sm" }, xl: { fieldset: "gap-y-1.5", legend: "text-base" } }, required: { true: { legend: "after:content-['*'] after:ms-0.5 after:text-error" } } }, compoundVariants: [ { size: "xs", variant: "table", class: { item: "p-2.5" } }, { size: "sm", variant: "table", class: { item: "p-3" } }, { size: "md", variant: "table", class: { item: "p-3.5" } }, { size: "lg", variant: "table", class: { item: "p-4" } }, { size: "xl", variant: "table", class: { item: "p-4.5" } }, { orientation: "horizontal", variant: "table", class: { item: "first-of-type:rounded-s-lg last-of-type:rounded-e-lg", fieldset: "gap-0 -space-x-px" } }, { orientation: "vertical", variant: "table", class: { item: "first-of-type:rounded-t-lg last-of-type:rounded-b-lg", fieldset: "gap-0 -space-y-px" } }, ...(options.theme.colors || []).map((color) => ({ color, variant: "table", class: { item: `has-data-[state=checked]:bg-${color}/10 has-data-[state=checked]:border-${color}/50 has-data-[state=checked]:z-[1]` } })), { color: "neutral", variant: "table", class: { item: "has-data-[state=checked]:bg-elevated has-data-[state=checked]:border-inverted/50 has-data-[state=checked]:z-[1]" } }, { variant: "table", disabled: true, class: { item: "cursor-not-allowed opacity-75" } } ], defaultVariants: { size: "md", variant: "list", color: "primary" } }); const chip = (options) => ({ slots: { root: "relative inline-flex items-center justify-center shrink-0", base: "rounded-full ring ring-bg flex items-center justify-center text-inverted font-medium whitespace-nowrap" }, variants: { color: { ...Object.fromEntries((options.theme.colors || []).map((color) => [color, `bg-${color}`])), neutral: "bg-inverted" }, size: { "3xs": "h-[4px] min-w-[4px] text-[4px]", "2xs": "h-[5px] min-w-[5px] text-[5px]", "xs": "h-[6px] min-w-[6px] text-[6px]", "sm": "h-[7px] min-w-[7px] text-[7px]", "md": "h-[8px] min-w-[8px] text-[8px]", "lg": "h-[9px] min-w-[9px] text-[9px]", "xl": "h-[10px] min-w-[10px] text-[10px]", "2xl": "h-[11px] min-w-[11px] text-[11px]", "3xl": "h-[12px] min-w-[12px] text-[12px]" }, position: { "top-right": "top-0 right-0", "bottom-right": "bottom-0 right-0", "top-left": "top-0 left-0", "bottom-left": "bottom-0 left-0" }, inset: { false: "" }, standalone: { false: "absolute" } }, compoundVariants: [{ position: "top-right", inset: false, class: "-translate-y-1/2 translate-x-1/2 transform" }, { position: "bottom-right", inset: false, class: "translate-y-1/2 translate-x-1/2 transform" }, { position: "top-left", inset: false, class: "-translate-y-1/2 -translate-x-1/2 transform" }, { position: "bottom-left", inset: false, class: "translate-y-1/2 -translate-x-1/2 transform" }], defaultVariants: { size: "md", color: "primary", position: "top-right" } }); const collapsible$1 = { slots: { root: "", content: "data-[state=open]:animate-[collapsible-down_200ms_ease-out] data-[state=closed]:animate-[collapsible-up_200ms_ease-out] overflow-hidden" } }; const colorPicker = { slots: { root: "data-[disabled]:opacity-75", picker: "flex gap-4", selector: "rounded-md touch-none", selectorBackground: "w-full h-full relative rounded-md", selectorThumb: "-translate-y-1/2 -translate-x-1/2 absolute size-4 ring-2 ring-(--color-white) rounded-full cursor-pointer data-[disabled]:cursor-not-allowed", track: "w-[8px] relative rounded-md touch-none", trackThumb: "absolute transform -translate-y-1/2 -translate-x-[4px] rtl:translate-x-[4px] size-4 rounded-full ring-2 ring-(--color-white) cursor-pointer data-[disabled]:cursor-not-allowed" }, variants: { size: { xs: { selector: "w-38 h-38", track: "h-38" }, sm: { selector: "w-40 h-40", track: "h-40" }, md: { selector: "w-42 h-42", track: "h-42" }, lg: { selector: "w-44 h-44", track: "h-44" }, xl: { selector: "w-46 h-46", track: "h-46" } } }, compoundVariants: [], defaultVariants: { size: "md" } }; const commandPalette = (options) => ({ slots: { root: "flex flex-col min-h-0 min-w-0 divide-y divide-default", input: "[&>input]:h-12", close: "", back: "p-0", content: "relative overflow-hidden flex flex-col", footer: "p-1", viewport: "relative divide-y divide-default scroll-py-1 overflow-y-auto flex-1 focus:outline-none", group: "p-1 isolate", empty: "py-6 text-center text-sm text-muted", label: "p-1.5 text-xs font-semibold text-highlighted", item: "group relative w-full flex items-center gap-1.5 p-1.5 text-sm select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75", itemLeadingIcon: "shrink-0 size-5", itemLeadingAvatar: "shrink-0", itemLeadingAvatarSize: "2xs", itemLeadingChip: "shrink-0 size-5", itemLeadingChipSize: "md", itemTrailing: "ms-auto inline-flex gap-1.5 items-center", itemTrailingIcon: "shrink-0 size-5", itemTrailingHighlightedIcon: "shrink-0 size-5 text-dimmed hidden group-data-highlighted:inline-flex", itemTrailingKbds: "hidden lg:inline-flex items-center shrink-0 gap-0.5", itemTrailingKbdsSize: "md", itemLabel: "truncate space-x-1 text-dimmed", itemLabelBase: "text-highlighted [&>mark]:text-inverted [&>mark]:bg-primary", itemLabelPrefix: "text-default", itemLabelSuffix: "text-dimmed [&>mark]:text-inverted [&>mark]:bg-primary" }, variants: { active: { true: { item: "text-highlighted before:bg-elevated", itemLeadingIcon: "text-default" }, false: { item: ["text-default data-highlighted:not-data-disabled:text-highlighted data-highlighted:not-data-disabled:before:bg-elevated/50", options.theme.transitions && "transition-colors before:transition-colors"], itemLeadingIcon: ["text-dimmed group-data-highlighted:not-group-data-disabled:text-default", options.theme.transitions && "transition-colors"] } }, loading: { true: { itemLeadingIcon: "animate-spin" } } } }); const container = { base: "w-full max-w-(--ui-container) mx-auto px-4 sm:px-6 lg:px-8" }; const contextMenu = (options) => ({ slots: { content: "min-w-32 bg-default shadow-lg rounded-md ring ring-default overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-(--reka-context-menu-content-transform-origin) flex flex-col", viewport: "relative divide-y divide-default scroll-py-1 overflow-y-auto flex-1", group: "p-1 isolate", label: "w-full flex items-center font-semibold text-highlighted", separator: "-mx-1 my-1 h-px bg-border", item: "group relative w-full flex items-center select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75", itemLeadingIcon: "shrink-0", itemLeadingAvatar: "shrink-0", itemLeadingAvatarSize: "", itemTrailing: "ms-auto inline-flex gap-1.5 items-center", itemTrailingIcon: "shrink-0", itemTrailingKbds: "hidden lg:inline-flex items-center shrink-0", itemTrailingKbdsSize: "", itemLabel: "truncate", itemLabelExternalIcon: "inline-block size-3 align-top text-dimmed" }, variants: { color: { ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])), neutral: "" }, active: { true: { item: "text-highlighted before:bg-elevated", itemLeadingIcon: "text-default" }, false: { item: ["text-default data-highlighted:text-highlighted data-[state=open]:text-highlighted data-highlighted:before:bg-elevated/50 data-[state=open]:before:bg-elevated/50", options.theme.transitions && "transition-colors before:transition-colors"], itemLeadingIcon: ["text-dimmed group-data-highlighted:text-default group-data-[state=open]:text-default", options.theme.transitions && "transition-colors"] } }, loading: { true: { itemLeadingIcon: "animate-spin" } }, size: { xs: { label: "p-1 text-xs gap-1", item: "p-1 text-xs gap-1", itemLeadingIcon: "size-4", itemLeadingAvatarSize: "3xs", itemTrailingIcon: "size-4", itemTrailingKbds: "gap-0.5", itemTrailingKbdsSize: "sm" }, sm: { label: "p-1.5 text-xs gap-1.5", item: "p-1.5 text-xs gap-1.5", itemLeadingIcon: "size-4", itemLeadingAvatarSize: "3xs", itemTrailingIcon: "size-4", itemTrailingKbds: "gap-0.5", itemTrailingKbdsSize: "sm" }, md: { label: "p-1.5 text-sm gap-1.5", item: "p-1.5 text-sm gap-1.5", itemLeadingIcon: "size-5", itemLeadingAvatarSize: "2xs", itemTrailingIcon: "size-5", itemTrailingKbds: "gap-0.5", itemTrailingKbdsSize: "md" }, lg: { label: "p-2 text-sm gap-2", item: "p-2 text-sm gap-2", itemLeadingIcon: "size-5", itemLeadingAvatarSize: "2xs", itemTrailingIcon: "size-5", itemTrailingKbds: "gap-1", itemTrailingKbdsSize: "md" }, xl: { label: "p-2 text-base gap-2", item: "p-2 text-base gap-2", itemLeadingIcon: "size-6", itemLeadingAvatarSize: "xs", itemTrailingIcon: "size-6", itemTrailingKbds: "gap-1", itemTrailingKbdsSize: "lg" } } }, compoundVariants: [...(options.theme.colors || []).map((color) => ({ color, active: false, class: { item: `text-${color} data-highlighted:text-${color} data-highlighted:before:bg-${color}/10 data-[state=open]:before:bg-${color}/10`, itemLeadingIcon: `text-${color}/75 group-data-highlighted:text-${color} group-data-[state=open]:text-${color}` } })), ...(options.theme.colors || []).map((color) => ({ color, active: true, class: { item: `text-${color} before:bg-${color}/10`, itemLeadingIcon: `text-${color}` } }))], defaultVariants: { size: "md" } }); const dashboardGroup = { base: "fixed inset-0 flex overflow-hidden" }; const dashboardNavbar = { slots: { root: "h-(--ui-header-height) shrink-0 flex items-center justify-between border-b border-default px-4 sm:px-6 gap-1.5", left: "flex items-center gap-1.5 min-w-0", icon: "shrink-0 size-5 self-center me-1.5", title: "flex items-center gap-1.5 font-semibold text-highlighted truncate", center: "hidden lg:flex", right: "flex items-center shrink-0 gap-1.5", toggle: "" }, variants: { toggleSide: { left: { toggle: "" }, right: { toggle: "" } } } }; const dashboardPanel = { slots: { root: "relative flex flex-col min-w-0 min-h-svh lg:not-last:border-r lg:not-last:border-default shrink-0", body: "flex flex-col gap-4 sm:gap-6 flex-1 overflow-y-auto p-4 sm:p-6", handle: "" }, variants: { size: { true: { root: "w-full lg:w-(--width)" }, false: { root: "flex-1" } } } }; const dashboardResizeHandle = { base: "hidden lg:block touch-none select-none cursor-ew-resize relative before:absolute before:inset-y-0 before:-left-1.5 before:-right-1.5" }; const dashboardSearch = { slots: { modal: "sm:max-w-3xl sm:h-[28rem]", input: "[&>input]:text-base/5" } }; const dashboardSearchButton = { slots: { base: "", trailing: "hidden lg:flex items-center gap-0.5 ms-auto" } }; const dashboardSidebar = { slots: { root: "relative hidden lg:flex flex-col min-h-svh min-w-16 w-(--width) shrink-0", header: "h-(--ui-header-height) shrink-0 flex items-center gap-1.5 px-4", body: "flex flex-col gap-4 flex-1 overflow-y-auto px-4 py-2", footer: "shrink-0 flex items-center gap-1.5 px-4 py-2", toggle: "", handle: "", content: "lg:hidden", overlay: "lg:hidden" }, variants: { menu: { true: { header: "sm:px-6", body: "sm:px-6", footer: "sm:px-6" } }, side: { left: { root: "border-r border-default" }, right: { root: "" } }, toggleSide: { left: { toggle: "" }, right: { toggle: "ms-auto" } } } }; const dashboardSidebarCollapse = { base: "hidden lg:flex", variants: { side: { left: "", right: "" } } }; const dashboardSidebarToggle = { base: "lg:hidden", variants: { side: { left: "", right: "" } } }; const dashboardToolbar = { slots: { root: "shrink-0 flex items-center justify-between border-b border-default px-4 sm:px-6 gap-1.5 overflow-x-auto min-h-[49px]", left: "flex items-center gap-1.5", right: "flex items-center gap-1.5" } }; const drawer = (options) => ({ slots: { overlay: "fixed inset-0 bg-elevated/75", content: "fixed bg-default ring ring-default flex focus:outline-none", handle: ["shrink-0 !bg-accented", options.theme.transitions && "transition-opacity"], container: "w-full flex flex-col gap-4 p-4 overflow-y-auto", header: "", title: "text-highlighted font-semibold", description: "mt-1 text-muted text-sm", body: "flex-1", footer: "flex flex-col gap-1.5" }, variants: { direction: { top: { content: "mb-24 flex-col-reverse", handle: "mb-4" }, right: { content: "flex-row", handle: "!ml-4" }, bottom: { content: "mt-24 flex-col", handle: "mt-4" }, left: { content: "flex-row-reverse", handle: "!mr-4" } }, inset: { true: { content: "rounded-lg after:hidden overflow-hidden [--initial-transform:calc(100%+1.5rem)]" } } }, compoundVariants: [{ direction: ["top", "bottom"], class: { con