flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS
1 lines • 2.79 kB
Source Map (JSON)
{"version":3,"file":"DrawerItems.cjs","sources":["../../../src/components/Drawer/DrawerItems.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, type ComponentProps } from \"react\";\nimport { get } from \"../../helpers/get\";\nimport { resolveProps } from \"../../helpers/resolve-props\";\nimport { useResolveTheme } from \"../../helpers/resolve-theme\";\nimport { twMerge } from \"../../helpers/tailwind-merge\";\nimport { useThemeProvider } from \"../../theme/provider\";\nimport type { ThemingProps } from \"../../types\";\nimport { useDrawerContext } from \"./DrawerContext\";\nimport { drawerTheme } from \"./theme\";\n\nexport interface DrawerItemsTheme {\n base: string;\n}\n\nexport interface DrawerItemsProps extends ComponentProps<\"div\">, ThemingProps<DrawerItemsTheme> {}\n\nexport const DrawerItems = forwardRef<HTMLDivElement, DrawerItemsProps>((props, ref) => {\n const { theme: rootTheme, clearTheme: rootClearTheme, applyTheme: rootApplyTheme } = useDrawerContext();\n\n const provider = useThemeProvider();\n const theme = useResolveTheme(\n [drawerTheme.items, provider.theme?.drawer?.items, rootTheme?.items, props.theme],\n [get(provider.clearTheme, \"drawer.items\"), get(rootClearTheme, \"items\"), props.clearTheme],\n [get(provider.applyTheme, \"drawer.items\"), get(rootApplyTheme, \"items\"), props.applyTheme],\n );\n\n const { children, className, ...restProps } = resolveProps(props, provider.props?.drawerItems);\n\n return (\n <div ref={ref} data-testid=\"flowbite-drawer-items\" className={twMerge(theme.base, className)} {...restProps}>\n {children}\n </div>\n );\n});\n\nDrawerItems.displayName = \"DrawerItems\";\n"],"names":["forwardRef","useDrawerContext","provider","useThemeProvider","theme","useResolveTheme","drawerTheme","get","resolveProps","jsx","twMerge"],"mappings":";;;;;;;;;;;;AAWY,MAAC,WAAW,GAAGA,gBAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AACtD,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,GAAGC,8BAAgB,EAAE;AACzG,EAAE,MAAMC,UAAQ,GAAGC,yBAAgB,EAAE;AACrC,EAAE,MAAMC,OAAK,GAAGC,4BAAe;AAC/B,IAAI,CAACC,iBAAW,CAAC,KAAK,EAAEJ,UAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;AACrF,IAAI,CAACK,OAAG,CAACL,UAAQ,CAAC,UAAU,EAAE,cAAc,CAAC,EAAEK,OAAG,CAAC,cAAc,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC;AAC9F,IAAI,CAACA,OAAG,CAACL,UAAQ,CAAC,UAAU,EAAE,cAAc,CAAC,EAAEK,OAAG,CAAC,cAAc,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC,UAAU;AAC7F,GAAG;AACH,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,GAAGC,yBAAY,CAAC,KAAK,EAAEN,UAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;AAChG,EAAE,uBAAuBO,cAAG,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,aAAa,EAAE,uBAAuB,EAAE,SAAS,EAAEC,qBAAO,CAACN,OAAK,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,GAAG,SAAS,EAAE,QAAQ,EAAE,CAAC;AACvJ,CAAC;AACD,WAAW,CAAC,WAAW,GAAG,aAAa;;;;"}