flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS
1 lines • 1.91 kB
Source Map (JSON)
{"version":3,"file":"Checkbox.cjs","sources":["../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\nimport { forwardRef } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport { mergeDeep } from \"../../helpers/merge-deep\";\nimport { getTheme } from \"../../theme-store\";\nimport type { DeepPartial } from \"../../types\";\nimport type { FlowbiteColors } from \"../Flowbite\";\n\nexport interface FlowbiteCheckboxTheme {\n root: FlowbiteCheckboxRootTheme;\n}\nexport interface FlowbiteCheckboxRootTheme {\n base: string;\n color: FlowbiteColors;\n}\n\nexport interface CheckboxProps extends Omit<ComponentProps<\"input\">, \"type\" | \"ref\" | \"color\"> {\n theme?: DeepPartial<FlowbiteCheckboxTheme>;\n color?: keyof FlowbiteColors;\n}\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n ({ className, color = \"default\", theme: customTheme = {}, ...props }, ref) => {\n const theme = mergeDeep(getTheme().checkbox, customTheme);\n\n return (\n <input\n ref={ref}\n type=\"checkbox\"\n className={twMerge(theme.root.base, theme.root.color[color], className)}\n {...props}\n />\n );\n },\n);\n\nCheckbox.displayName = \"Checkbox\";\n"],"names":["forwardRef","mergeDeep","getTheme","jsx","twMerge"],"mappings":";;;;;;;;AAMY,MAAC,QAAQ,GAAGA,gBAAU;AAClC,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,GAAG,SAAS,EAAE,KAAK,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAK;AAChF,IAAI,MAAM,KAAK,GAAGC,mBAAS,CAACC,cAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AAC9D,IAAI,uBAAuBC,cAAG;AAC9B,MAAM,OAAO;AACb,MAAM;AACN,QAAQ,GAAG;AACX,QAAQ,IAAI,EAAE,UAAU;AACxB,QAAQ,SAAS,EAAEC,qBAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;AAC/E,QAAQ,GAAG,KAAK;AAChB,OAAO;AACP,KAAK,CAAC;AACN,GAAG;AACH,EAAE;AACF,QAAQ,CAAC,WAAW,GAAG,UAAU;;;;"}