import { nanoid } from '../../../../node_modules/nanoid/index.browser.mjs';
import '../../../../node_modules/preact/compat/dist/compat.module.mjs';
import { useRef as _ } from '../../../../node_modules/preact/hooks/dist/hooks.module.mjs';

/**
 * Create a unique ID (like React 18's useId()) with a specific prefix. The default 's' prefix
 * should be good enough for most use cases - we always want an alphabet as the first character
 * but we don't want it to be long enough to become selectable, to prevent this from accidentally
 * becoming a stable API.
 */ const useUniqueId = (prefix = 's')=>{
    const id = _(nanoid());
    return prefix + id.current;
};

export { useUniqueId };
//# sourceMappingURL=uniqueId.mjs.map
