UNPKG

@rdsaude/pulso-react-native-components

Version:

Biblioteca de componentes React Native do Pulso Design System da RD Saúde oferece componentes consistentes e de alto desempenho, alinhados com os padrões da RDSaúde. Ideal para desenvolver aplicações modernas e acessíveis.

1 lines 802 kB
{"version":3,"sources":["../src/components/theme-provider/index.tsx","../src/components/button/index.tsx","../src/components/button/button.styles.ts","../src/core/styled.ts","../src/hooks/use-theme.ts","../src/components/button/contexts/button-context.tsx","../src/components/button/utils/const.ts","../src/components/refresh/index.tsx","../src/components/refresh/hooks/use-refresh-variants.ts","../src/components/icon/index.tsx","../src/components/icon/components/dual-color/dual-color.styles.ts","../src/components/icon/components/dual-color/index.tsx","../src/components/icon/hooks/use-icon-props.ts","../src/components/button/hooks/use-button-props.tsx","../src/components/button/components/button-icon/index.tsx","../src/components/button/components/button-label/button-label.styles.ts","../src/utils/is-dev.ts","../src/utils/logger.ts","../src/utils/convert-percentage-to-number.ts","../src/components/button/components/button-label/index.tsx","../src/components/checkbox/index.tsx","../src/components/checkbox/checkbox.styles.ts","../src/components/checkbox/components/checkbox-label/checkbox.label.styles.ts","../src/components/checkbox/components/checkbox-label/index.tsx","../src/components/checkbox/components/helper-text/helper-text.styles.ts","../src/components/checkbox/components/helper-text/index.tsx","../src/components/checkbox/hooks/use-checkbox-variants.ts","../src/components/search-bar/index.tsx","../src/components/search-bar/components/button-back/index.tsx","../src/components/search-bar/components/button-barcode/index.tsx","../src/components/search-bar/components/button-microphone/index.tsx","../src/components/search-bar/search-bar.styles.ts","../src/components/search-bar/utils/index.ts","../src/components/radio/index.tsx","../src/components/radio/components/helper-text/helper-text.styles.ts","../src/components/radio/components/helper-text/index.tsx","../src/components/radio/components/radio-label/radio.label.styles.ts","../src/components/radio/components/radio-label/index.tsx","../src/components/radio/hooks/use-radio-variants.ts","../src/components/radio/radio.styles.ts","../src/components/link/index.tsx","../src/components/link/components/link-label/link-label.styles.ts","../src/components/link/components/link-label/index.tsx","../src/components/link/hooks/use-link-props.ts","../src/components/link/link.styles.ts","../src/components/option-menu/option-menu.tsx","../src/components/option-menu/option-menu.styles.ts","../src/components/option-menu/components/divider/index.tsx","../src/hooks/use-layout-observer.tsx","../src/components/option-menu/components/footer/index.tsx","../src/components/option-menu/components/footer/footer.styles.ts","../src/components/option-menu/components/group/group.styles.ts","../src/components/option-menu/components/group/index.tsx","../src/components/option-menu/components/item/index.tsx","../src/components/option-menu/components/item/item.styles.ts","../src/components/option-menu/hooks/use-map-variants-to-state.ts","../src/components/option-menu/components/list/index.tsx","../src/components/option-menu/utils/is-item-element.ts","../src/utils/guid.ts","../src/components/input-text/contexts/input-text-context.tsx","../src/components/helper-text/helper-text.styles.ts","../src/components/helper-text/index.tsx","../src/components/input-text/components/input-field/index.tsx","../src/components/input-text/components/input-field/input-field.styles.ts","../src/components/input-text/hooks/use-input-text-props.tsx","../src/components/input-text/components/input-label/input-label.styles.ts","../src/components/input-text/components/input-label/index.tsx","../src/components/input-text/components/input-actions/index.tsx","../src/components/input-text/components/input-button/input-button.styles.ts","../src/components/input-text/components/input-button/index.tsx","../src/components/input-text/components/input-actions/input-actions.styles.ts","../src/components/input-text/components/input-icon/index.tsx","../src/components/input-text/components/input-helper-text/index.tsx","../src/components/input-text/index.tsx","../src/components/input-text/text-input.styles.tsx","../src/components/input-text/utils/const.ts","../src/components/rating/index.tsx","../src/components/rating/index.styles.ts","../src/components/content/content.tsx","../src/components/content/components/content-actions/content-actions.styles.ts","../src/components/content/components/content-actions/index.tsx","../src/components/content/components/content-actions-text/content-actions-text-styles.ts","../src/components/content/components/content-actions-text/index.tsx","../src/components/content/components/content-icon/index.tsx","../src/components/content/components/content-link/index.tsx","../src/components/content/components/content-subtitle/content-subtitlte.styles.ts","../src/components/content/components/content-subtitle/index.tsx","../src/components/content/components/content-title/content-titlte.styles.ts","../src/components/content/components/content-title/index.tsx","../src/components/content/content.styles.ts","../src/components/card-category/index.tsx","../src/components/card-category/card-category.styles.ts","../src/components/card-category/components/card-category-icon/index.tsx","../src/components/card-category/components/card-category-label/card-category.label.styles.ts","../src/components/card-category/components/card-category-label/index.tsx","../src/components/progress-indicator/index.tsx","../src/components/progress-indicator/progress-indicator.styles.ts","../src/components/input-select/input-select.tsx","../src/components/input-select/input-select.styles.ts","../src/components/input-select/components/input-select-dropdownlist/index.tsx","../src/components/input-select/components/input-select-dropdownlist/select-dropdownlist.styles.ts","../src/components/input-select/components/input-select-helpertext/select-helpertext.styles.ts","../src/components/input-select/components/input-select-helpertext/index.tsx","../src/components/input-select/components/input-select-field/select-field.styles.ts","../src/components/input-select/components/input-select-field/index.tsx","../src/components/input-select/components/input-select-item/index.tsx","../src/components/input-select/components/input-select-label/index.tsx","../src/components/input-select/components/input-select-label/select-label.styles.ts","../src/components/input-select/components/input-select-portal/index.tsx","../src/components/input-select/components/input-select-trigger/index.tsx","../src/components/input-select/components/input-select-trigger/select-trigger.styles.ts","../src/components/input-select/components/input-select-value/index.tsx","../src/components/input-select/components/input-select-value/select-value.styles.ts","../src/components/input-select/hooks/use-split-children.ts","../src/components/switch/index.tsx","../src/components/switch/components/switch-label/switch.label.styles.ts","../src/components/switch/components/switch-label/index.tsx","../src/components/switch/components/switch-refresh/switch-refresh.styles.ts","../src/components/switch/components/switch-refresh/index.tsx","../src/components/switch/components/switch-toggle/switch-toggle.styles.ts","../src/components/switch/components/switch-toggle/index.tsx","../src/components/switch/switch.styles.ts","../src/components/scrim/styles.ts","../src/components/scrim/index.tsx","../src/components/snackbar/snackbar.tsx","../src/components/snackbar/components/content/index.tsx","../src/components/snackbar/utils/format-description.ts","../src/components/snackbar/utils/format-title.ts","../src/components/snackbar/components/content/content.styles.ts","../src/components/snackbar/components/footer/footer.styles.ts","../src/components/snackbar/components/footer/index.tsx","../src/components/snackbar/utils/progress-indicator-mapper.ts","../src/components/snackbar/components/timer-bar/timer-bar.styles.ts","../src/components/snackbar/components/timer-bar/index.tsx","../src/components/snackbar/snackbar.styles.ts","../src/components/card-informative/card-informative.tsx","../src/components/card-informative/card-informative.styles.ts","../src/components/card-informative/components/card-informative-content/index.tsx","../src/components/card-informative/components/card-informative-title/card-informative-title.styles.ts","../src/components/card-informative/components/card-informative-title/index.tsx","../src/components/card-informative/components/card-informative-content/card-informative-content.styles.ts","../src/components/card-informative/components/card-informative-description/card-informative-description.styles.ts","../src/components/card-informative/components/card-informative-description/index.tsx","../src/components/card-informative/components/card-informative-icon/index.tsx","../src/components/card-informative/components/card-informative-icon/card-informative.icon.styles.ts","../src/components/chip/components/input/index.tsx","../src/components/chip/components/input/index.styles.ts","../src/components/chip/components/multi-filter/index.tsx","../src/components/chip/components/multi-filter/index.styles.ts","../src/components/chip/components/single-filter/index.tsx","../src/components/chip/components/single-filter/index.styles.ts","../src/components/chip/components/label/index.styles.ts","../src/components/chip/components/label/index.tsx","../src/components/chip/components/badge/index.styles.ts","../src/components/chip/components/badge/index.tsx","../src/components/chip/index.tsx","../src/components/tag/index.tsx","../src/components/tag/components/tag-icon/index.tsx","../src/components/tag/components/tag-label/tag.label.styles.ts","../src/components/tag/components/tag-label/index.tsx","../src/components/tag/tag.styles.ts","../src/components/accordion/accordion.tsx","../src/components/accordion/accordion.styles.ts","../src/components/accordion/components/content/content.styles.ts","../src/components/accordion/components/content/index.tsx","../src/components/accordion/components/header/index.tsx","../src/components/accordion/components/header/header.styles.ts","../src/components/accordion/components/item/index.tsx","../src/components/accordion/components/item/item.styles.ts","../src/components/modal/index.tsx","../src/components/modal/components/modal-body/modal-body.styles.ts","../src/components/modal/components/modal-body/index.tsx","../src/components/modal/components/modal-closable-button/index.tsx","../src/components/modal/components/modal-description/modal-description.styles.ts","../src/components/modal/components/modal-description/index.tsx","../src/components/modal/components/modal-footer/index.tsx","../src/components/modal/components/modal-footer/modal-footer.styles.ts","../src/components/modal/components/modal-header/modal-header.styles.ts","../src/components/modal/components/modal-header/index.tsx","../src/components/modal/components/modal-icon/index.tsx","../src/components/modal/components/modal-title/modal-title.styles.ts","../src/components/modal/components/modal-title/index.tsx","../src/components/modal/modal.styles.ts","../src/components/toast/toast.tsx","../src/components/toast/components/toast-description/toast.styles.ts","../src/components/toast/components/toast-description/index.tsx","../src/components/toast/components/toast-icon/index.tsx","../src/components/toast/toast.styles.ts","../src/components/input-multi-select/components/control/index.tsx","../src/components/input-multi-select/components/control/control.styles.ts","../src/components/input-multi-select/input-multi-select.context.ts","../src/components/input-multi-select/components/chip/index.tsx","../src/components/input-multi-select/components/control/use-control-interactions-size.ts","../src/components/input-multi-select/components/control/use-selected-options.ts","../src/components/input-multi-select/components/dropdown-list/index.tsx","../src/components/input-multi-select/components/dropdown-list/dropdown-list.styles.ts","../src/components/input-multi-select/components/helper-text/index.tsx","../src/components/input-multi-select/components/label/index.tsx","../src/components/input-multi-select/components/label/label.styles.ts","../src/components/input-multi-select/components/root/index.tsx","../src/components/input-multi-select/components/root/root.styles.ts","../src/components/input-multi-select/components/root/use-split-children.ts","../src/components/input-multi-select/input-multi-select-reducer.ts","../src/components/input-multi-select/components/portal/index.tsx","../src/components/input-multi-select/namespace.ts","../src/components/card-shape/index.tsx","../src/components/card-shape/card-shape.styles.ts","../src/components/input-counter/index.tsx","../src/components/input-counter/components/input-counter-button.tsx","../src/components/input-counter/input-counter.styles.ts","../src/components/stepper/index.tsx","../src/components/stepper/stepper.styles.ts","../src/components/logo/assets/drogasil/black.tsx","../src/components/logo/assets/drogasil/black-symbol.tsx","../src/components/logo/assets/drogasil/colored.tsx","../src/components/logo/assets/drogasil/colored-symbol.tsx","../src/components/logo/assets/drogasil/white.tsx","../src/components/logo/assets/drogasil/white-symbol.tsx","../src/components/logo/components/without-variants/without-variants.styles.ts","../src/components/logo/components/without-variants/index.tsx","../src/components/logo/components/drogasil/logos.tsx","../src/components/logo/components/drogasil/index.tsx","../src/components/logo/assets/pulso/black.tsx","../src/components/logo/assets/pulso/black-symbol.tsx","../src/components/logo/assets/pulso/colored.tsx","../src/components/logo/assets/pulso/colored-symbol.tsx","../src/components/logo/assets/pulso/white.tsx","../src/components/logo/assets/pulso/white-symbol.tsx","../src/components/logo/components/pulso/logos.tsx","../src/components/logo/components/pulso/index.tsx","../src/components/logo/assets/raia/black.tsx","../src/components/logo/assets/raia/black-symbol.tsx","../src/components/logo/assets/raia/colored.tsx","../src/components/logo/assets/raia/colored-symbol.tsx","../src/components/logo/assets/raia/white.tsx","../src/components/logo/assets/raia/white-symbol.tsx","../src/components/logo/components/raia/logos.tsx","../src/components/logo/components/raia/index.tsx","../src/components/logo/assets/rd-saude/black.tsx","../src/components/logo/assets/rd-saude/colored.tsx","../src/components/logo/assets/rd-saude/dark-green.tsx","../src/components/logo/assets/rd-saude/light-green.tsx","../src/components/logo/assets/rd-saude/white.tsx","../src/components/logo/assets/rd-saude/yellow.tsx","../src/components/logo/components/rd-saude/logos.tsx","../src/components/logo/components/rd-saude/index.tsx","../src/components/logo/assets/rd-saude-tagline/black.tsx","../src/components/logo/assets/rd-saude-tagline/colored.tsx","../src/components/logo/assets/rd-saude-tagline/dark-green.tsx","../src/components/logo/assets/rd-saude-tagline/light-green.tsx","../src/components/logo/assets/rd-saude-tagline/white.tsx","../src/components/logo/assets/rd-saude-tagline/yellow.tsx","../src/components/logo/components/rd-saude-tagline/logos.tsx","../src/components/logo/components/rd-saude-tagline/index.tsx","../src/components/logo/logo.tsx"],"sourcesContent":["import type React from 'react'\nimport { createContext, useMemo } from 'react'\n\nimport {\n DROGASIL_TOKENS,\n GLOBALS_TOKENS,\n PRIME_TOKENS,\n RAIA_TOKENS,\n RDSAUDESISTEMAS_TOKENS,\n SUBSCRIPTION_TOKENS,\n type Themes,\n rnFontFamily,\n} from '@raiadrogasil/pulso-design-tokens'\n\ntype TThemeProviderProps = {\n theme: Themes\n children: React.ReactNode\n}\n\ntype ColorsTokens =\n | typeof DROGASIL_TOKENS\n | typeof RAIA_TOKENS\n | typeof RDSAUDESISTEMAS_TOKENS\n | typeof SUBSCRIPTION_TOKENS\n | typeof PRIME_TOKENS\n\ntype BaseTokens = typeof GLOBALS_TOKENS\n\ntype DesignTokens = ColorsTokens &\n BaseTokens & {\n fontFamily: typeof rnFontFamily\n }\n\nexport const ThemeContext = createContext({} as DesignTokens)\n\nexport function ThemeProvider({ theme, children }: TThemeProviderProps) {\n const currentTheme = useMemo(() => {\n const mapThemes = {\n rdsaudesistemas: RDSAUDESISTEMAS_TOKENS,\n drogasil: DROGASIL_TOKENS,\n raia: RAIA_TOKENS,\n subscription: SUBSCRIPTION_TOKENS,\n prime: PRIME_TOKENS,\n } as const\n\n return {\n // @ts-ignore\n ...mapThemes[theme],\n fontFamily: {\n ...rnFontFamily,\n },\n ...GLOBALS_TOKENS,\n }\n }, [theme]) satisfies DesignTokens\n\n return (\n <ThemeContext.Provider value={currentTheme}>\n {children}\n </ThemeContext.Provider>\n )\n}\n\nexport function withThemeProvider<T extends {}>(\n Component: React.ComponentType<T>,\n variant: Themes\n) {\n return function ThemedComponent(componentProps: T) {\n return (\n <ThemeProvider theme={variant}>\n <Component {...componentProps} />\n </ThemeProvider>\n )\n }\n}\n","import React, { useState } from 'react'\n\nimport type { IButtonProps } from './types'\n\nimport * as Comp from './button.styles'\n\nimport { ButtonProvider } from './contexts/button-context'\n\nimport { SCOPE_WARNING_MESSAGE } from './utils/const'\n\nimport { Refresh } from '~/components/refresh'\nimport { ButtonIcon, ButtonLabel } from './components'\n\nimport type { GestureResponderEvent } from 'react-native'\nimport { isDEV, logger } from '~/utils'\n\nconst ButtonRoot = React.forwardRef<\n React.ElementRef<typeof Comp.Root>,\n IButtonProps\n>(\n (\n {\n children,\n variant = 'brand-primary',\n size = 'md',\n full,\n disabled,\n loading,\n onPressIn,\n onPressOut,\n ...props\n },\n ref\n ) => {\n const [isPressed, setIsPressed] = useState(false)\n\n const renderInternalComponents = React.Children.map(children, child => {\n if (!React.isValidElement(child)) return\n\n if (child.type === ButtonLabel || child.type === ButtonIcon) {\n return child\n }\n\n if (isDEV()) {\n logger.warning(SCOPE_WARNING_MESSAGE)\n return\n }\n })\n\n const isDisabled = !!disabled\n const isLoading = !!loading\n\n const refreshColor = variant === 'brand-primary' ? 'white' : 'neutral'\n\n const accessibilityProperties = {\n role: 'button',\n 'aria-disabled': isDisabled,\n accessible: true,\n } as const\n\n const isOnlyIcon = renderInternalComponents\n ? renderInternalComponents?.length > 1\n ? false\n : renderInternalComponents[0].type === ButtonIcon\n : false\n\n const componentProperties = {\n size,\n variant,\n full,\n disabled: isDisabled || isLoading,\n hasPressed: isPressed,\n hasLoading: isLoading,\n hasDisabled: isDisabled && !isLoading,\n hasFull: full,\n hasOnlyIcon: isOnlyIcon,\n } as const\n\n function handlePressIn(event: GestureResponderEvent) {\n setIsPressed(true)\n onPressIn?.(event)\n }\n\n function handlePressOut(event: GestureResponderEvent) {\n setIsPressed(false)\n onPressOut?.(event)\n }\n\n return (\n <ButtonProvider {...componentProperties}>\n <Comp.Root\n ref={ref}\n {...props}\n {...componentProperties}\n {...accessibilityProperties}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n >\n {isLoading ? (\n <Refresh size=\"sm\" color={refreshColor} />\n ) : (\n renderInternalComponents?.slice(0, 3)\n )}\n </Comp.Root>\n </ButtonProvider>\n )\n }\n)\n\nButtonRoot.displayName = 'Button'\n\nexport const Button = {\n Root: ButtonRoot,\n Label: ButtonLabel,\n Icon: ButtonIcon,\n}\n\nexport type { IButtonProps }\n","import { Pressable } from 'react-native'\n\nimport { styled } from '~/utils/styled'\n\nexport const Root = styled(Pressable, theme => {\n return {\n base: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n\n gap: theme.spacingInlineTwopulse,\n\n borderRadius: theme.borderRadiusPill,\n },\n variants: {\n variant: {\n 'brand-primary': {\n borderWidth: theme.borderWidthNone,\n borderColor: theme.colorActionBorderBrandPrimaryEnabled,\n\n backgroundColor: theme.colorActionFillBrandPrimaryEnabled,\n },\n 'neutral-secondary': {\n borderWidth: theme.borderWidthQuarterpulse,\n borderColor: theme.colorActionBorderNeutralSecondaryEnabled,\n\n backgroundColor: theme.colorActionFillNeutralSecondaryEnabled,\n },\n 'neutral-tertiary': {\n borderWidth: theme.borderWidthNone,\n borderColor: theme.colorActionBorderNeutralTertiaryEnabled,\n\n backgroundColor: theme.colorActionFillNeutralTertiaryEnabled,\n },\n },\n size: {\n md: {\n minWidth: theme.sizingMedium,\n height: theme.sizingMedium,\n\n paddingHorizontal: theme.paddingInsetFourpulse,\n },\n ml: {\n minWidth: theme.sizingMediumlarge,\n height: theme.sizingMediumlarge,\n\n paddingHorizontal: theme.paddingInsetFourpulse,\n },\n lg: {\n minWidth: theme.sizingLarge,\n height: theme.sizingLarge,\n\n paddingHorizontal: theme.paddingInsetFivepulse,\n },\n xl: {\n minWidth: theme.sizingExtralarge,\n height: theme.sizingExtralarge,\n\n paddingHorizontal: theme.paddingInsetSixpulse,\n },\n },\n hasFull: {\n true: {\n width: '100%',\n },\n },\n hasPressed: {\n true: {},\n },\n hasLoading: {\n true: {\n paddingHorizontal: theme.paddingInsetNone,\n },\n },\n hasOnlyIcon: {\n true: {\n paddingHorizontal: theme.paddingInsetNone,\n },\n },\n hasDisabled: {\n true: {},\n },\n },\n compoundVariants: [\n {\n variants: {\n variant: 'brand-primary',\n hasPressed: true,\n },\n css: {\n borderColor: theme.colorActionBorderBrandPrimaryPressed,\n backgroundColor: theme.colorActionFillBrandPrimaryPressed,\n },\n },\n {\n variants: {\n variant: 'brand-primary',\n hasDisabled: true,\n },\n css: {\n borderWidth: theme.borderWidthNone,\n borderColor: theme.colorActionBorderBrandPrimaryDisabled,\n\n backgroundColor: theme.colorActionFillBrandPrimaryDisabled,\n },\n },\n {\n variants: {\n variant: 'neutral-secondary',\n hasPressed: true,\n },\n css: {\n borderColor: theme.colorActionBorderNeutralSecondaryPressed,\n backgroundColor: theme.colorActionFillNeutralSecondaryPressed,\n },\n },\n {\n variants: {\n variant: 'neutral-secondary',\n hasDisabled: true,\n },\n css: {\n borderColor: theme.colorActionBorderNeutralSecondaryDisabled,\n backgroundColor: theme.colorActionFillNeutralSecondaryDisabled,\n },\n },\n {\n variants: {\n variant: 'neutral-tertiary',\n hasPressed: true,\n },\n css: {\n borderColor: theme.colorActionBorderNeutralTertiaryPressed,\n backgroundColor: theme.colorActionFillNeutralTertiaryPressed,\n },\n },\n ],\n }\n})\n","import {\n type ComponentProps,\n type ComponentType,\n createElement,\n forwardRef,\n} from 'react'\nimport {\n type ImageStyle,\n StyleSheet,\n type TextStyle,\n type ViewStyle,\n} from 'react-native'\n\nimport { useTheme } from '~/hooks/use-theme'\n\ntype TCSSProperties = ViewStyle | TextStyle | ImageStyle\n\ntype TBooleanVariants = {\n true?: unknown\n false?: unknown\n}\n\ntype TVariantStyleData = Record<string, TCSSProperties>\ntype TVariants = Record<string, TVariantStyleData>\n\ntype TCompoundVariant<V extends TVariants> = {\n variants: Partial<{\n [K in keyof V]: V[K] extends TBooleanVariants ? boolean : keyof V[K]\n }>\n css: TCSSProperties\n}\n\ntype TStyledProperties<V extends TVariants> = {\n base: TCSSProperties\n variants?: V\n compoundVariants?: TCompoundVariant<V>[]\n}\n\ntype TStyledPropertiesWithArgs<V extends TVariants> = (\n theme: ReturnType<typeof useTheme>\n) => TStyledProperties<V>\n\nexport function styled<\n // biome-ignore lint/suspicious/noExplicitAny:\n C extends ComponentType<any>,\n V extends TVariants = Record<string, never>,\n>(Comp: C, opts: TStyledProperties<V> | TStyledPropertiesWithArgs<V>) {\n type TVariantProps = V extends Record<string, never>\n ? {}\n : {\n [K in keyof V]?: V[K] extends TBooleanVariants ? boolean : keyof V[K]\n }\n\n type TComponentProps = ComponentProps<C> & TVariantProps\n\n // biome-ignore lint/suspicious/noExplicitAny:\n const StyledComponent = forwardRef<any, TComponentProps>((props, ref) => {\n const theme = useTheme()\n\n const {\n base,\n variants = {} as V,\n compoundVariants = [],\n } = typeof opts === 'function' ? opts(theme) : opts\n\n const mergedVariantStyles = getMergedVariantStyles<V>(\n props,\n variants,\n compoundVariants\n )\n\n const styleSheet = createStyleSheet(base, mergedVariantStyles)\n\n const finalStyles = [...Object.values(styleSheet), props.style].filter(\n Boolean\n )\n\n return createElement<C>(Comp, {\n ...props,\n ref,\n style: finalStyles,\n })\n })\n\n StyledComponent.displayName = `Styled${Comp.displayName || Comp.name || 'Component'}`\n\n return StyledComponent\n}\n\nfunction createStyleSheet(\n base: TCSSProperties,\n mergedVariantStyles: TCSSProperties[]\n) {\n return StyleSheet.create({\n base,\n ...mergedVariantStyles.reduce((acc, variantStyle, idx) => {\n const variantKey = `variant-${idx + 1}`\n acc[variantKey] = variantStyle\n return acc\n }, {} as TVariantStyleData),\n })\n}\n\n// Função que combina os estilos base com os estilos de variantes e compostos\nfunction getMergedVariantStyles<V extends TVariants>(\n props: Record<string, unknown>,\n variants: V,\n compoundVariants: TCompoundVariant<V>[]\n): TCSSProperties[] {\n const mergedVariantStyles: TCSSProperties[] = []\n\n if (variants && Object.keys(variants).length > 0) {\n addVariantStyles(props, variants, mergedVariantStyles)\n }\n\n addCompoundVariantStyles(props, compoundVariants, mergedVariantStyles)\n\n return mergedVariantStyles\n}\n\nfunction addVariantStyles<V extends TVariants>(\n props: Record<string, unknown>,\n variants: V,\n mergedVariantStyles: TCSSProperties[]\n) {\n for (const variantKey in variants) {\n if (Object.prototype.hasOwnProperty.call(variants, variantKey)) {\n const variantValue = props[variantKey] as keyof V[typeof variantKey]\n\n if (variantValue && variants[variantKey]) {\n const variantStyleData = variants[variantKey][variantValue]\n\n if (variantStyleData) {\n mergedVariantStyles.push(variantStyleData)\n }\n }\n }\n }\n}\n\n// Função que adiciona os estilos compostos\nfunction addCompoundVariantStyles<V extends TVariants>(\n props: Record<string, unknown>,\n compoundVariants: TCompoundVariant<V>[],\n mergedVariantStyles: TCSSProperties[]\n) {\n for (const compound of compoundVariants) {\n const applyCompound = Object.keys(compound.variants).every(\n variantKey => props[variantKey] === compound.variants[variantKey]\n )\n\n if (applyCompound) {\n mergedVariantStyles.push(compound.css)\n }\n }\n}\n","import { useContext } from 'react'\n\nimport { ThemeContext } from '~/components/theme-provider'\n\n/**\n * Hook personalizado para acessar o contexto do tema da aplicação.\n */\nexport function useTheme() {\n const context = useContext(ThemeContext)\n\n if (!context) {\n throw new Error('useTheme deve ser usado dentro de um ThemeProvider do Pulso.')\n }\n\n return context\n}\n","import { createContext } from 'react'\n\nimport type { IButtonProps } from '../types'\n\ninterface ButtonPropsProviderProps extends IButtonProps {\n children: React.ReactNode\n}\n\nexport const ButtonContext = createContext({} as Omit<IButtonProps, 'children'>)\nconst { Provider } = ButtonContext\n\nexport function ButtonProvider({\n children,\n ...props\n}: ButtonPropsProviderProps) {\n return <Provider value={props}>{children}</Provider>\n}\n","export const SCOPE_WARNING_MESSAGE =\n 'The internal components of the Button must be its own elements. For more information, see the documentation.'\n","import { ActivityIndicator } from 'react-native'\nimport { useRefreshVariants } from './hooks'\nimport type { TRefreshProps } from './types'\n\nexport const Refresh = ({ color, size, testID }: TRefreshProps) => {\n const { refreshSizeMapping, refreshColorMapping } = useRefreshVariants()\n\n return (\n <ActivityIndicator\n color={refreshColorMapping[color]}\n size={refreshSizeMapping[size]}\n testID={testID}\n />\n )\n}\n\nexport type { TRefreshProps }\n","import { useTheme } from '~/hooks/use-theme'\n\nimport type { TRefreshColors, TRefreshSizes } from '../types'\n\nexport const useRefreshVariants = () => {\n const theme = useTheme()\n\n const refreshSizeMapping: Record<TRefreshSizes, number> = {\n sm: theme.sizingSmall,\n md: theme.sizingMedium,\n lg: theme.sizingLarge,\n }\n\n const refreshColorMapping: Record<TRefreshColors, string> = {\n brand: theme.colorActionFillBrandPrimaryEnabled,\n neutral: theme.colorTextNeutralReadonly,\n black: theme.colorTextNeutralDefault,\n white: theme.colorTextNeutralInverse,\n }\n\n return {\n refreshSizeMapping,\n refreshColorMapping,\n }\n}\n","import { View } from 'react-native'\n\nimport { icoMoonConfig } from '@raiadrogasil/pulso-icons'\n\nimport Svg, { Path } from '@rd-core-svg/svg'\nimport IcoMoon from 'react-icomoon'\n\nimport type {\n IconNameBullet,\n IconNameMulticolor,\n TIconDualColorsProps,\n TIconProps,\n} from './types'\n\nimport { IconDualColor } from './components/dual-color'\nimport { useIconProps } from './hooks/use-icon-props'\n\nconst Icon = ({\n size = 'medium',\n color,\n symbol = 'rdicon-default',\n testID,\n}: TIconProps) => {\n const { size: iconSize, color: iconColor } = useIconProps({ size, color })\n\n const iconSymbol = symbol.replace('rdicon-', '')\n\n const iconProps = {\n size: iconSize,\n color: iconColor,\n icon: iconSymbol,\n }\n\n return (\n <View testID={testID}>\n <IcoMoon\n {...iconProps}\n SvgComponent={Svg}\n PathComponent={Path}\n iconSet={icoMoonConfig}\n native\n />\n </View>\n )\n}\n\nIcon.Dual = IconDualColor\n\nexport {\n Icon,\n type TIconProps,\n type TIconDualColorsProps,\n type IconNameBullet,\n type IconNameMulticolor,\n}\n","import { View } from 'react-native'\nimport { styled } from '~/core/styled'\n\nexport const Group = styled(View, theme => {\n return {\n base: {},\n variants: {},\n }\n})\n\nexport const Container = styled(View, theme => {\n return {\n base: {\n position: 'absolute',\n },\n variants: {},\n }\n})\n","import { Icon } from '../..'\nimport type { TIconDualColorsProps } from '../../types'\nimport * as Comp from './dual-color.styles'\n\nexport const IconDualColor = (props: TIconDualColorsProps) => {\n const { symbols, colors, size, testID } = props\n return (\n <Comp.Group testID={testID}>\n <Icon symbol={symbols[0]} color={colors[0]} size={size} />\n <Comp.Container>\n <Icon symbol={symbols[1]} color={colors[1]} size={size} />\n </Comp.Container>\n </Comp.Group>\n )\n}\n","import { useTheme } from '~/hooks/use-theme'\nimport type { TIconProps, TIconSizes } from '../types'\n\nexport function useIconProps({\n size = 'small',\n color = 'colorTextNeutralDefault',\n}: Omit<TIconProps, 'symbol'>) {\n const theme = useTheme()\n\n const iconSizeMapping: Record<TIconSizes, number> = {\n tiny: theme.sizingTiny,\n 'extra-small': theme.sizingExtrasmall,\n small: theme.sizingSmall,\n medium: theme.sizingMedium,\n }\n\n const iconColorMapping = theme[color]\n\n return {\n size: iconSizeMapping[size],\n color: iconColorMapping,\n }\n}\n","import { useContext } from 'react'\n\nimport { ButtonContext } from '../contexts/button-context'\n\nexport function useButtonProps() {\n const props = useContext(ButtonContext)\n return props\n}\n","import { Icon, type TIconProps } from '~/components/icon'\n\nimport type { TButtonSizes, TButtonVariants } from '../../types'\n\nimport { useButtonProps } from '../../hooks/use-button-props'\n\ninterface IButtonIconProps extends Pick<TIconProps, 'symbol'> {\n testID?: string\n}\n\nexport function ButtonIcon({ symbol, testID }: IButtonIconProps) {\n const { variant = 'brand-primary', size = 'md', disabled } = useButtonProps()\n\n const isDisabled = !!disabled\n\n const iconColorMapping: Record<TButtonVariants, TIconProps['color']> = {\n 'brand-primary': 'colorTextNeutralInverse',\n 'neutral-secondary': 'colorTextNeutralDefault',\n 'neutral-tertiary': 'colorTextNeutralDefault',\n }\n\n const iconSizeMapping: Record<TButtonSizes, TIconProps['size']> = {\n md: 'tiny',\n ml: 'small',\n lg: 'small',\n xl: 'small',\n }\n\n return (\n <Icon\n symbol={symbol}\n size={iconSizeMapping[size]}\n color={\n isDisabled ? 'colorTextNeutralDisabled' : iconColorMapping[variant]\n }\n testID={testID}\n />\n )\n}\n","import { Text, type TextStyle } from 'react-native'\n\nimport { convertPercentageToNumber, styled } from '~/utils'\n\nexport const Label = styled(Text, theme => {\n const baseFontWeight = String(theme.fontWeightBold) as TextStyle['fontWeight']\n\n return {\n base: {\n fontFamily: 'RDModern-Bold',\n fontWeight: baseFontWeight,\n letterSpacing: convertPercentageToNumber(theme.letterSpacingDefault),\n },\n variants: {\n variant: {\n 'brand-primary': {\n color: theme.colorTextNeutralInverse,\n },\n 'neutral-secondary': {\n color: theme.colorTextNeutralDefault,\n },\n 'neutral-tertiary': {\n color: theme.colorTextNeutralDefault,\n },\n },\n size: {\n md: {\n fontSize: theme.fontSizeThreepulse,\n },\n ml: {\n fontSize: theme.fontSizeThreeandhalfpulse,\n },\n lg: {\n fontSize: theme.fontSizeThreeandhalfpulse,\n },\n xl: {\n fontSize: theme.fontSizeThreeandhalfpulse,\n },\n },\n hasDisabled: {\n true: {\n color: theme.colorTextNeutralDisabled,\n },\n },\n },\n }\n})\n","export function isDEV() {\n return __DEV__\n}\n","export const logger = {\n warning(log: string) {\n console.warn(log)\n },\n}\n","export function convertPercentageToNumber(percentage: string) {\n const valueWithoutSymbol = percentage.slice(0, percentage.length - 1)\n const result = Number.parseFloat(valueWithoutSymbol) / 100\n\n return result\n}\n\nexport function convertLineHeight(fontSize: number, lineHeight: string) {\n const formattedLineHeight = convertPercentageToNumber(lineHeight)\n return fontSize * formattedLineHeight\n}\n","import * as Comp from './button-label.styles'\n\nimport { useButtonProps } from '../../hooks/use-button-props'\n\ntype TButtonLabelProps = {\n children: React.ReactNode\n}\n\nexport function ButtonLabel({ children }: TButtonLabelProps) {\n const { variant, size, disabled } = useButtonProps()\n\n return (\n <Comp.Label\n variant={variant}\n size={size}\n hasDisabled={disabled}\n numberOfLines={1}\n ellipsizeMode=\"clip\"\n >\n {children}\n </Comp.Label>\n )\n}\n","import React from 'react'\nimport { Icon, type TIconProps } from '~/components/icon'\nimport * as Comp from './checkbox.styles'\nimport { CheckboxLabel } from './components/checkbox-label'\nimport { CheckboxHelperText } from './components/helper-text'\nimport { useCheckboxVariants } from './hooks'\nimport type { TCheckboxProps } from './types'\n\nconst CheckboxRoot = ({\n size = 'md',\n checked = false,\n indeterminate = false,\n onPress,\n error,\n disabled,\n readOnly,\n children,\n testID,\n}: TCheckboxProps) => {\n const { iconSizeMapping, renderCurrentStateCheckbox, pressed, setPressed } =\n useCheckboxVariants()\n\n const renderInternalLabel = React.Children.map(children, child => {\n if (!React.isValidElement(child)) return\n\n if (React.isValidElement(child) && child.type === CheckboxLabel) {\n return React.cloneElement(child as React.ReactElement<TCheckboxProps>, {\n size,\n disabled,\n readOnly,\n error,\n })\n }\n })\n\n const renderInternalHelperText = React.Children.map(children, child => {\n if (!React.isValidElement(child)) return\n\n if (React.isValidElement(child) && child.type === CheckboxHelperText) {\n return React.cloneElement(child as React.ReactElement<TCheckboxProps>, {\n size,\n })\n }\n })\n\n const renderNestedParent = React.Children.map(children, child => {\n if (!React.isValidElement(child)) return\n\n if (child.type === Comp.NestedContainer) {\n return React.cloneElement(child as React.ReactElement<TCheckboxProps>, {\n testID: 'checkbox-nested-container',\n })\n }\n })\n\n const componentProperties = {\n size,\n hasPressed: pressed,\n hasDisabled: disabled,\n hasError: !!error,\n hasReadOnly: readOnly,\n hasInternalLabel: !!renderInternalLabel?.length,\n readOnly,\n }\n const iconColorMapping = (): TIconProps['color'] => {\n return disabled\n ? 'colorTextNeutralDisabled'\n : readOnly\n ? 'colorTextNeutralReadonly'\n : 'colorTextNeutralDefault'\n }\n return (\n <Comp.Root\n testID={testID}\n disabled={disabled || readOnly}\n onPress={() => {\n if (typeof onPress === 'function') {\n onPress()\n }\n }}\n onPressIn={() => setPressed(true)}\n onPressOut={() => setPressed(false)}\n {...componentProperties}\n >\n <Comp.Actions {...componentProperties}>\n <Icon\n testID=\"checkbox-icon\"\n color={iconColorMapping()}\n size={iconSizeMapping[size]}\n symbol={renderCurrentStateCheckbox(indeterminate, checked)}\n />\n {renderInternalLabel}\n </Comp.Actions>\n {error && !!renderInternalLabel?.length ? (\n <Comp.HelperTextContainer {...componentProperties}>\n {renderInternalHelperText}\n </Comp.HelperTextContainer>\n ) : null}\n {renderNestedParent}\n </Comp.Root>\n )\n}\n\nexport const Checkbox = {\n Root: CheckboxRoot,\n Label: CheckboxLabel,\n HelperText: CheckboxHelperText,\n NestedContainer: Comp.NestedContainer,\n}\n\nexport type { TCheckboxProps }\n","import { Pressable, View } from 'react-native'\n\nimport { styled } from '~/utils/styled'\n\nexport const Root = styled(Pressable, theme => {\n return {\n base: {\n width: '100%',\n borderRadius: theme.borderRadiusPill,\n },\n variants: {},\n }\n})\n\nexport const Actions = styled(View, theme => {\n return {\n base: {\n flexDirection: 'row',\n alignItems: 'center',\n borderRadius: theme.borderRadiusPill,\n backgroundColor: 'transparent',\n minWidth: theme.sizingHuge,\n minHeight: theme.sizingSmall,\n },\n variants: {\n size: {\n md: {\n paddingTop: theme.paddingInsetTwopulse,\n paddingLeft: theme.paddingInsetTwopulse,\n paddingBottom: theme.paddingInsetTwopulse,\n paddingRight: theme.paddingInsetTwopulse,\n minWidth: theme.sizingMedium,\n minHeight: theme.sizingMedium,\n },\n ml: {\n paddingTop: theme.paddingInsetTwopulse,\n paddingLeft: theme.paddingInsetTwopulse,\n paddingBottom: theme.paddingInsetTwopulse,\n paddingRight: theme.paddingInsetTwopulse,\n minWidth: theme.sizingMediumlarge,\n minHeight: theme.sizingMediumlarge,\n },\n lg: {\n paddingTop: theme.paddingInsetTwopulse,\n paddingLeft: theme.paddingInsetTwopulse,\n paddingBottom: theme.paddingInsetTwopulse,\n paddingRight: theme.paddingInsetTwopulse,\n minWidth: theme.sizingLarge,\n minHeight: theme.sizingLarge,\n },\n xl: {\n paddingTop: theme.paddingInsetThreepulse,\n paddingLeft: theme.paddingInsetThreepulse,\n paddingBottom: theme.paddingInsetThreepulse,\n paddingRight: theme.paddingInsetThreepulse,\n minWidth: theme.sizingExtralarge,\n minHeight: theme.sizingExtralarge,\n },\n },\n hasPressed: {\n true: {\n backgroundColor: theme.colorActionFillNeutralTertiaryPressed,\n borderColor: theme.colorActionBorderNeutralTertiaryPressed,\n borderWidth: theme.borderWidthNone,\n },\n },\n hasError: {\n true: {\n borderWidth: theme.borderWidthHalfpulse,\n borderColor: theme.colorFormsBorderError,\n },\n },\n hasDisabled: {\n true: {\n backgroundColor: theme.colorActionFillNeutralTertiaryDisabled,\n borderColor: theme.colorActionBorderNeutralTertiaryDisabled,\n borderWidth: theme.borderWidthNone,\n },\n },\n hasReadOnly: {\n true: {\n //@TODO trocar para o token theme.colorActionFillNeutralTertiaryReadonly\n backgroundColor: '#00000000',\n //@TODO trocar para o token theme.colorActionBorderNeutralTertiaryReadonly\n borderColor: '#00000000',\n borderWidth: theme.borderWidthNone,\n },\n },\n },\n compoundVariants: [\n {\n variants: {\n size: 'xl',\n hasInternalLabel: true,\n },\n css: {\n paddingLeft: theme.paddingInsetSixpulse,\n paddingRight: theme.paddingInsetSixpulse,\n },\n },\n {\n variants: {\n size: 'lg',\n hasInternalLabel: true,\n },\n css: {\n paddingLeft: theme.paddingInsetFivepulse,\n paddingRight: theme.paddingInsetFivepulse,\n },\n },\n {\n variants: {\n size: 'ml',\n hasInternalLabel: true,\n },\n css: {\n paddingLeft: theme.paddingInsetFourpulse,\n paddingRight: theme.paddingInsetFourpulse,\n },\n },\n {\n variants: {\n size: 'md',\n hasInternalLabel: true,\n },\n css: {\n paddingLeft: theme.paddingInsetFourpulse,\n paddingRight: theme.paddingInsetFourpulse,\n paddingTop: theme.paddingInsetOnepulse,\n paddingBottom: theme.paddingInsetOnepulse,\n },\n },\n ],\n }\n})\n\nexport const HelperTextContainer = styled(View, theme => {\n return {\n base: {\n alignItems: 'center',\n width: '100%',\n paddingTop: theme.spacingStackTwopulse,\n backgroundColor: 'transparent',\n paddingLeft: theme.paddingInsetSixpulse,\n paddingRight: theme.paddingInsetSixpulse,\n },\n variants: {\n size: {\n md: {\n paddingLeft: theme.paddingInsetFourpulse,\n paddingRight: theme.paddingInsetFourpulse,\n },\n ml: {\n paddingLeft: theme.paddingInsetFourpulse,\n paddingRight: theme.paddingInsetFourpulse,\n },\n lg: {\n paddingLeft: theme.paddingInsetFivepulse,\n paddingRight: theme.paddingInsetFivepulse,\n },\n xl: {\n paddingLeft: theme.paddingInsetSixpulse,\n paddingRight: theme.paddingInsetSixpulse,\n },\n },\n },\n }\n})\n\nexport const NestedContainer = styled(View, theme => {\n return {\n base: {\n paddingTop: theme.paddingInsetOnepulse,\n paddingLeft: theme.paddingInsetEightpulse,\n },\n variants: {},\n }\n})\n","import { Text, type TextStyle } from 'react-native'\n\nimport { convertLineHeight, convertPercentageToNumber, styled } from '~/utils'\n\nexport const Label = styled(Text, theme => {\n const baseFontWeight = String(\n theme.fontWeightRegular\n ) as TextStyle['fontWeight']\n\n const semiboldFontWeight = String(\n theme.fontWeightSemibold\n ) as TextStyle['fontWeight']\n\n return {\n base: {\n flexShrink: 1,\n textAlign: 'left',\n fontFamily: 'RDModern-Regular',\n fontWeight: baseFontWeight,\n letterSpacing: convertPercentageToNumber(theme.letterSpacingDefault),\n paddingLeft: theme.paddingInsetTwopulse,\n color: theme.colorTextNeutralDefault,\n },\n variants: {\n size: {\n md: {\n fontSize: theme.fontSizeThreepulse,\n paddingLeft: theme.paddingInsetOnepulse,\n lineHeight: convertLineHeight(\n theme.fontSizeThreepulse,\n theme.lineHeightMedium\n ),\n },\n ml: {\n fontSize: theme.fontSizeThreeandhalfpulse,\n paddingLeft: theme.paddingInsetTwopulse,\n lineHeight: convertLineHeight(\n theme.fontSizeThreeandhalfpulse,\n theme.lineHeightSmall\n ),\n },\n lg: {\n fontSize: theme.fontSizeFourpulse,\n paddingLeft: theme.paddingInsetTwopulse,\n lineHeight: convertLineHeight(\n theme.fontSizeFourpulse,\n theme.lineHeightSmall\n ),\n },\n xl: {\n fontSize: theme.fontSizeFourpulse,\n paddingLeft: theme.paddingInsetTwopulse,\n lineHeight: convertLineHeight(\n theme.fontSizeFourpulse,\n theme.lineHeightSmall\n ),\n },\n },\n hasError: {\n true: {\n fontWeight: semiboldFontWeight,\n },\n },\n hasDisabled: {\n true: {\n color: theme.colorTextNeutralDisabled,\n },\n },\n hasReadOnly: {\n true: {\n color: theme.colorTextNeutralReadonly,\n },\n },\n },\n }\n})\n","import type { TCheckboxSizes } from '../../types'\nimport * as Comp from './checkbox.label.styles'\n\ntype TCheckboxLabelProps = {\n children: string\n size?: TCheckboxSizes\n error?: boolean\n disabled?: boolean\n readOnly?: boolean\n testID?: string\n}\n\nexport function CheckboxLabel({\n children,\n size,\n error,\n disabled,\n readOnly,\n testID,\n}: TCheckboxLabelProps) {\n const componentProperties = {\n size,\n hasError: !!error,\n hasDisabled: !!disabled,\n hasReadOnly: !!readOnly && !disabled,\n }\n\n return (\n <Comp.Label testID={testID} {...componentProperties} numberOfLines={4}>\n {children}\n </Comp.Label>\n )\n}\n","import { Text, type TextStyle, View } from 'react-native'\n\nimport { convertLineHeight, styled } from '~/utils'\n\nexport const Root = styled(View, theme => {\n return {\n base: {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n alignContent: 'center',\n justifyContent: 'flex-start',\n gap: theme.spacingInlineHalfpulse,\n },\n variants: {},\n }\n})\n\nexport const Label = styled(Text, theme => {\n const semiboldFontWeight = String(\n theme.fontWeightSemibold\n ) as TextStyle['fontWeight']\n\n return {\n base: {\n color: theme.colorTextDangerAlternative,\n fontWeight: semiboldFontWeight,\n fontFamily: 'RDModern-SemiBold',\n fontSize: theme.fontSizeThreepulse,\n paddingLeft: theme.spacingInlineOnepulse,\n lineHeight: convertLineHeight(\n theme.fontSizeThreepulse,\n theme.lineHeightDefault\n ),\n textAlign: 'left',\n textAlignVertical: 'top',\n },\n variants: {},\n }\n})\n","import { Icon, type TIconProps } from '~/components/icon'\nimport type { TCheckboxSizes } from '../../types'\nimport * as Comp from './helper-text.styles'\n\ntype IHelperTextProps = {\n children: string\n size?: TCheckboxSizes\n testID?: string\n}\n\nexport function CheckboxHelperText({\n size = 'md',\n testID,\n ...props\n}: IHelperTextProps) {\n const iconSizeMapping: Record<TCheckboxSizes, TIconProps['size']> = {\n md: 'tiny',\n ml: 'tiny',\n lg: 'tiny',\n xl: 'tiny',\n }\n\n return (\n <Comp.Root testID={testID}>\n <Icon\n size={iconSizeMapping[size]}\n symbol=\"rdicon-warning-circle\"\n color=\"colorTextDangerAlternative\"\n />\n <Comp.Label numberOfLines={2}>{props.children}</Comp.Label>\n </Comp.Root>\n )\n}\n","import { useState } from 'react'\nimport type { TIconProps } from '~/components/icon'\nimport { CHECKBOX_STATE_MAPPER, type TCheckboxSizes } from '../types'\n\nexport const useCheckboxVariants = () => {\n const [pressed, setPressed] = useState(false)\n\n const iconSizeMapping: Record<TCheckboxSizes, TIconProps['size']> = {\n md: 'tiny',\n ml: 'small',\n lg: 'medium',\n xl: 'medium',\n }\n\n const renderCurrentStateCheckbox = (\n indeterminate: boolean,\n isChecked: boolean\n ) => {\n if (indeterminate) {\n return CHECKBOX_STATE_MAPPER.INDETERMINATE\n }\n if (isChecked) {\n return CHECKBOX_STATE_MAPPER.CHECKED\n }\n return CHECKBOX_STATE_MAPPER.UNCHECKED\n }\n\n return {\n renderCurrentStateCheckbox,\n iconSizeMa