import type { ColorProps, ComponentAttrs, ElevationProps, ElevationState, PropValue, SStyleProp, useStylesProps } from '../@types'; import type { ClassValue } from 'svelte/elements'; /** * The classes of the s-class_xxx directives (class:xxx on a kit tag): * - true gives the name (class:active -> active); * - a number or a text gives the name and the value, joined by a dash (class:gap={4} -> gap-4), * without a dash when the name ends or the value starts with a separator (- _ : / .): * s-class_gap-={4}, s-class_variant="-primary" and s-class_state=":active" keep working; * - false, null, undefined and '' give nothing. */ export declare function directiveClasses(classProps: Record | undefined): string[]; export declare function useIsInteractive(props: Record, tag: string, interactiveTags: readonly string[], interactive?: boolean): boolean; /** * useStyles - Utility to compute style declarations for a component (pure function). * @param styleAttr - Inline style attribute as a string (raw CSS, kept as it is). * @param sStyle - The s-style property: an object of property / value pairs (camelCase or kebab-case). * @param styleProps - An object containing s-style_xxx directives. * @returns A computed style string; the style attribute comes last, so it wins. */ export declare function useStyles({ styleAttr, sStyle, styleProps }?: useStylesProps): string; /** * useElevation - Utility to resolve the `elevation` prop into its base/hover/active states. * @param elevation - Either a single elevation value applied as `base`, or an object with * independent `base`, `hover` and `active` values (each key is optional). * @returns An object with `base`, `hover` and `active` keys, `undefined` when not provided. */ export declare function useElevation(elevation?: ElevationProps | null): ElevationState; /** * useComponentAttrs - The class, style and other attributes of a labs component, in one call. * * The class is left to Svelte (clsx): class and s-class follow the same rules as class on an element, * a string, an array, or an object whose keys are added when their value is truthy * ({ active: isActive } -> active). The s-class_xxx directives (class:xxx on a kit tag) keep their * rule: class:gap={4} -> gap-4. * * @param baseClass - The class of the component ('kit-btn'), '' for none. * The color prop gives the --{baseClass}-color / --{baseClass}-on-color variables, read by the * color mixin; they come before the style, so the style attribute still wins. * With { base, active }, active picks the color of the active state. * * @param props - The class, s-class, style, s-style, color and active props of the component. * @param rest - The rest of the props: the s-class_xxx / s-style_xxx directives are taken out of it. */ export declare function useComponentAttrs(baseClass: string, { className, sClass, styleAttr, sStyle, color, active }: { className?: ClassValue; sClass?: ClassValue; styleAttr?: string; sStyle?: SStyleProp; color?: ColorProps | null; active?: boolean; }, rest: Record): ComponentAttrs; /** * splitAriaAttrs - Separates the aria-* attributes from the other attributes, for a component whose * role is on another element than its content (dialog, modal). * @param rest - The rest of the props of the component. */ export declare function splitAriaAttrs(rest: Record): { aria: Record; others: Record; };