UNPKG

@snowball-tech/fractal

Version:

Fractal's (Snowball's design system) React component library based on RadixUI and TailwindCSS

2 lines 1.16 kB
"use client";import{a as e}from"../constants-CW2-utNH.js";import{r as t}from"../helpers-DBEwVIlX.js";import{Typography as n}from"../Typography/Typography.js";import{r}from"../utils-K22C_6qC.js";import{GROUP_NAME as i}from"./Select.constants.js";import a from"lodash/fp/isEmpty.js";import o from"lodash/fp/isString.js";import s from"lodash/fp/omit.js";import{jsx as c,jsxs as l}from"react/jsx-runtime";import*as u from"@radix-ui/react-select";const d=({children:d,label:f,labelElement:p,value:m=`empty-value`,...h})=>{let g=!!d;!g&&!f&&console.warn("You must provide a `label` or `children` to the `SelectEmpty` component");let _=o(f)?f:a(f)?r(d):r(f);return l(u.Item,{"aria-label":_,className:t(`${e}-${i}__empty`,`pointer-events-none flex cursor-default items-center gap-1 rounded-sm p-2 outline-none`,h.className),title:_,value:m||`empty-value`,onSelect:e=>e.preventDefault(),...s([`className`,`disabled`,`onSelect`],h),children:[c(u.ItemText,{asChild:!0,children:c(n,{element:p||(o(g?d:f)?void 0:`div`),children:g?d:f})}),c(u.ItemIndicator,{})]})};d.displayName=`SelectEmpty`;export{d as SelectEmpty,d as default}; //# sourceMappingURL=SelectEmpty.js.map