@yamada-ui/react
Version:
React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion
1 lines • 1.65 kB
Source Map (JSON)
{"version":3,"file":"float.cjs","names":["createComponent","floatStyle","varAttr"],"sources":["../../../../src/components/float/float.tsx"],"sourcesContent":["\"use client\"\n\nimport type { CSSProps, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { FloatStyle } from \"./float.style\"\nimport { createComponent, varAttr } from \"../../core\"\nimport { isArray } from \"../../utils\"\nimport { floatStyle } from \"./float.style\"\n\nexport interface FloatProps\n extends Omit<HTMLStyledProps, \"offset\">,\n ThemeProps<FloatStyle> {\n /**\n * Changes position offset.\n */\n offset?: CSSProps[\"inset\"]\n}\n\nconst {\n PropsContext: FloatPropsContext,\n usePropsContext: useFloatPropsContext,\n withContext,\n} = createComponent<FloatProps, FloatStyle>(\"float\", floatStyle)\n\nexport { FloatPropsContext, useFloatPropsContext }\n\n/**\n * `Float` is a component used to anchor an element to the edge of a container.\n *\n * @see https://yamada-ui.com/docs/components/float\n */\nexport const Float = withContext(\"div\")(undefined, ({ offset, ...rest }) => {\n const [offsetBlock, offsetInline] = isArray(offset)\n ? offset\n : [offset, offset]\n\n return {\n \"--offset-block\": varAttr(offsetBlock, \"spaces\"),\n \"--offset-inline\": varAttr(offsetInline, \"spaces\"),\n ...rest,\n }\n})\n"],"mappings":";;;;;;;;;AAiBA,MAAM,EACJ,cAAc,mBACd,iBAAiB,sBACjB,gBACEA,yCAAwC,SAASC,+BAAW;;;;;;AAShE,MAAa,QAAQ,YAAY,MAAM,CAAC,SAAY,EAAE,OAAQ,GAAG,WAAW;CAC1E,MAAM,CAAC,aAAa,+DAAwB,OAAO,GAC/C,SACA,CAAC,QAAQ,OAAO;AAEpB,QAAO;EACL,kBAAkBC,oBAAQ,aAAa,SAAS;EAChD,mBAAmBA,oBAAQ,cAAc,SAAS;EAClD,GAAG;EACJ;EACD"}