@snowball-tech/fractal
Version:
Fractal's (Snowball's design system) React component library based on RadixUI and TailwindCSS
2 lines • 1.42 kB
JavaScript
"use client";import{PREFIX as e}from"../../constants.js";import{alternatingBgColorLightClassNames as t,cj as n,cn as r}from"../../styles/helpers.js";import i from"../Typography/Typography.js";import{onlyText as a}from"../../utils.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:r(`${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:n(`${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:n(`${e}-${o}__item-group__items`,C?`${e}-${o}__item-group__items--disabled`:w?t:``),element:`div`,children:f(c.Provider,{value:{disabled:C,rainbow:w},children:h})})]})};h.displayName=`SelectItemGroup`;export{h as default};
//# sourceMappingURL=SelectItemGroup.js.map