UNPKG

@snowball-tech/fractal

Version:

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

2 lines 1.42 kB
"use client";import{a as e}from"../constants-CW2-utNH.js";import{n as t,r as n,t as r}from"../helpers-DBEwVIlX.js";import{Typography as i}from"../Typography/Typography.js";import{r as a}from"../utils-K22C_6qC.js";import{GROUP_NAME as o}from"./Select.constants.js";import{SelectContext as s}from"./SelectContext.js";import{SelectGroupContext as c}from"./SelectGroupContext.js";import{useContext as l}from"react";import u from"lodash/fp/isString.js";import d from"lodash/fp/omit.js";import{jsx as f,jsxs as p}from"react/jsx-runtime";import*as m from"@radix-ui/react-select";const h=({children:h,disabled:g=!1,label:_,labelElement:v,rainbow:y=!0,...b})=>{let{disabled:x,rainbow:S}=l(s),C=g||x,w=y&&S,T=u(_)?_:a(_);return p(m.Group,{"aria-label":T,className:n(`${e}-${o}__item-group`,`p-2 py-0`,C?`${e}-${o}__item-group--disabled`:``,b.className),title:T,...d([`className`],b),children:[f(m.Label,{asChild:!0,className:t(`${e}-${o}__item-group__label`,`block py-2`,C?`${e}-${o}__item-group__label--disabled text-disabled`:`cursor-default text-placeholder`),children:f(i,{element:v||(u(_)?`label`:`div`),children:_})}),f(i,{className:t(`${e}-${o}__item-group__items`,C?`${e}-${o}__item-group__items--disabled`:w?r:``),element:`div`,children:f(c.Provider,{value:{disabled:C,rainbow:w},children:h})})]})};h.displayName=`SelectItemGroup`;export{h as SelectItemGroup,h as default}; //# sourceMappingURL=SelectItemGroup.js.map