UNPKG

@snowball-tech/fractal

Version:

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

2 lines 1.34 kB
"use client";import{a as e}from"../constants-CW2-utNH.js";import{n as t,r as n}from"../helpers-DBEwVIlX.js";import"../Paper/Paper.constants.js";import{Paper as r}from"../Paper/Paper.js";import{DEFAULT_ELEVATION as i,DEFAULT_ORIENTATION as a,GROUP_NAME as o}from"./Toolbar.constants.js";import{ToolbarContext as s}from"./ToolbarContext.js";import{forwardRef as c}from"react";import l from"lodash/fp/omit.js";import{jsx as u}from"react/jsx-runtime";import*as d from"@radix-ui/react-toolbar";const f=c(({children:c,disabled:f=!1,elevation:p=i,fullWidth:m=!1,orientation:h=a,...g},_)=>u(r,{className:t(`${e}-${o}__wrapper`,`${e}-${o}__wrapper--${h}`,`h-5 max-h-5 min-h-5 px-half py-0`,m?`${e}-${o}__wrapper--full-width w-full`:`w-fit`,f?`${e}-${o}__wrapper--disabled`:``),elevation:p,children:u(d.Root,{ref:_,className:n(`${e}-${o}`,`${e}-${o}--${h}`,`flex items-center gap-1 p-1`,p===`3`||p===`higher`||p===3?`rounded-full`:`rounded-sm`,h===`horizontal`?`flex-row`:`flex-col`,m?`${e}-${o}--full-width w-full`:`w-fit`,f?`${e}-${o}--disabled cursor-not-allowed bg-disabled-light text-disabled`:`cursor-default`,g.className),...h===void 0?{}:{orientation:h},...l([`className`],g),children:u(s.Provider,{value:{disabled:f,orientation:h},children:c})})}));f.displayName=`Toolbar`;export{f as Toolbar,f as default}; //# sourceMappingURL=Toolbar.js.map