@yamada-ui/react
Version:
React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion
1 lines • 1.15 kB
Source Map (JSON)
{"version":3,"file":"use-css.cjs","names":["useSystem","useTheme","css"],"sources":["../../../../src/core/css/use-css.ts"],"sourcesContent":["import type { StyledTheme, System, UsageTheme } from \"../system\"\nimport type { CSSObject, CSSObjectOrFunction } from \"./index.types\"\nimport { css as emotionCSS } from \"@emotion/css\"\nimport { useMemo } from \"react\"\nimport { useSystem, useTheme } from \"../system\"\nimport { css } from \"./css\"\n\nexport const useCSS = (cssObject: CSSObject | CSSObjectOrFunction = {}) => {\n const system = useSystem()\n const { theme } = useTheme<UsageTheme>()\n\n return useMemo(\n () => getCSS(system, theme)(cssObject),\n [cssObject, system, theme],\n )\n}\n\nexport const getCSS =\n (system: System, theme: StyledTheme<UsageTheme>) =>\n (cssObject: CSSObject | CSSObjectOrFunction = {}) =>\n emotionCSS(css(system, theme)(cssObject))\n"],"mappings":";;;;;;;;;;AAOA,MAAa,UAAU,YAA6C,EAAE,KAAK;CACzE,MAAM,SAASA,mCAAW;CAC1B,MAAM,EAAE,UAAUC,iCAAsB;AAExC,iCACQ,OAAO,QAAQ,MAAM,CAAC,UAAU,EACtC;EAAC;EAAW;EAAQ;EAAM,CAC3B;;AAGH,MAAa,UACV,QAAgB,WAChB,YAA6C,EAAE,4BACnCC,gBAAI,QAAQ,MAAM,CAAC,UAAU,CAAC"}