UNPKG

@scrolia/react

Version:

A headless scrollbar component

1 lines 1.23 kB
{"version":3,"file":"index.mjs","names":["props: ContainerProps","p: ContainerProps"],"sources":["../../../src/components/container/index.tsx"],"sourcesContent":["\"use client\";\n\nimport type * as React from \"react\";\n\nimport { useScrollCore } from \"#/contexts/scrollcore\";\nimport { getComponentProps } from \"#/functions/props\";\nimport { useLengthHandler } from \"#/hooks/length\";\nimport { useScrollHandler } from \"#/hooks/scroll\";\n\n/** Props for the `Container` component. */\ntype ContainerProps = React.ComponentProps<\"div\">;\n\n/** Container component. */\nconst Container = (props: ContainerProps): React.JSX.Element => {\n useLengthHandler();\n useScrollHandler();\n\n const {\n options: { plugins },\n } = useScrollCore();\n\n const p: ContainerProps = getComponentProps({\n name: \"container\",\n props,\n plugins,\n });\n\n return <div {...p}>{p.children}</div>;\n};\n\nexport type { ContainerProps };\nexport { Container };\n"],"mappings":";;;;;;;;;;AAaA,MAAM,YAAY,CAACA,UAA6C;AAC5D,mBAAkB;AAClB,mBAAkB;CAElB,MAAM,EACF,SAAS,EAAE,SAAS,EACvB,GAAG,eAAe;CAEnB,MAAMC,IAAoB,kBAAkB;EACxC,MAAM;EACN;EACA;CACH,EAAC;AAEF,wBAAO,IAAC;EAAI,GAAI;YAAI,EAAE;GAAe;AACxC"}