Something went wrong. Try again.
Monorepo for Tangled tangled.org
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657import type { Component } from "svelte";import type { SvelteHTMLElements } from "svelte/elements";import { tv, type VariantProps } from "tailwind-variants";
export interface SelectOption { value: string; label?: string; hint?: string; group?: string; disabled?: boolean; separator?: boolean; icon?: Component<SvelteHTMLElements["svg"]>;}
export type SelectAlign = "left" | "right";
export const selectField = tv({ slots: { box: "w-full rounded-sm border bg-background-default transition-colors outline-none disabled:cursor-not-allowed", chevron: "shrink-0 text-foreground-subtle" }, variants: { error: { false: { box: "border-border-default text-foreground-default focus-visible:border-border-strong focus-visible:ring-1 focus-visible:ring-border-strong aria-expanded:border-border-strong aria-expanded:ring-1 aria-expanded:ring-border-strong" }, true: { box: "border-border-danger bg-background-danger-subtle text-foreground-danger focus-visible:border-border-focus-danger focus-visible:ring-1 focus-visible:ring-border-focus-danger aria-expanded:border-border-focus-danger aria-expanded:ring-1 aria-expanded:ring-border-focus-danger", chevron: "text-foreground-danger" } }, disabled: { false: {}, true: { box: "text-foreground-disabled", chevron: "text-foreground-disabled" } } }, compoundVariants: [ { error: true, disabled: true, class: { box: "border-border-danger-subtle bg-background-danger-subtle text-foreground-danger-subtle", chevron: "text-foreground-danger-subtle" } } ], defaultVariants: { error: false, disabled: false }});
export type SelectFieldVariants = VariantProps<typeof selectField>;