@kubit-ui-web/react-components
Version:
Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience
252 lines • 9.29 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.INPUT_STYLES = void 0;
const size_1 = require("../../../../components/iconHighlighted/types/size");
const inputTheme_1 = require("../../../../components/input/types/inputTheme");
const breakpoints_1 = require("../../../../types/breakpoints/breakpoints");
const borders_1 = require("../../foundations/borders");
const colors_1 = require("../../foundations/colors");
const sizes_1 = require("../../foundations/sizes");
const spacings_1 = require("../../foundations/spacings");
const typography_1 = require("../../foundations/typography");
const variants_1 = require("../loader/variants");
const variants_2 = require("../text/variants");
const variants_3 = require("../variants");
const variants_4 = require("./variants");
const commonProps = {
topContentContainer: {
margin_bottom: spacings_1.SPACINGS.spacing_150,
},
label: {
type: inputTheme_1.LABEL_TYPE.STANDARD,
font_weight: typography_1.FONT_WEIGHT.font_weight_500,
font_variant: variants_2.TextVariantType.PARAGRAPH_MEDIUM_EXTENDED,
color: colors_1.COLORS.NEUTRAL.color_neutral_font_50,
},
asterisk: {
font_weight: typography_1.FONT_WEIGHT.font_weight_500,
font_variant: variants_2.TextVariantType.PARAGRAPH_MEDIUM_EXTENDED,
color: colors_1.COLORS.BRAND.color_brand_font_50,
},
input: {
font_weight: typography_1.FONT_WEIGHT.font_weight_400,
font_size: typography_1.PARAGRAPH.SMALL[breakpoints_1.DeviceBreakpointsType.DESKTOP].font_size,
line_height: typography_1.PARAGRAPH.SMALL[breakpoints_1.DeviceBreakpointsType.DESKTOP].line_height,
},
inputContainer: {
opacity: '1',
padding: spacings_1.SPACINGS.spacing_250,
background_color: colors_1.COLORS.NEUTRAL.color_neutral_bg_250,
border_width: borders_1.BORDERS.border_50,
border_color: colors_1.COLORS.NEUTRAL.color_neutral_border_50,
border_radius: spacings_1.SPACINGS.spacing_0,
border_style: 'solid',
},
placeholder: {
font_variant: typography_1.PARAGRAPH.SMALL[breakpoints_1.DeviceBreakpointsType.DESKTOP].font_size,
font_weight: typography_1.FONT_WEIGHT.font_weight_400,
color: colors_1.COLORS.NEUTRAL.color_neutral_font_50,
},
errorAndHelpMessageContainer: {
display: 'flex',
flex_direction: 'column',
gap: spacings_1.SPACINGS.spacing_150,
},
helpMessageContainer: {
padding: spacings_1.SPACINGS.spacing_0,
padding_left: spacings_1.SPACINGS.spacing_0,
display: 'flex',
flex_direction: 'row',
justify_content: 'space-between',
},
helpMessage: {
text_align: typography_1.TEXT_ALIGN.left,
font_weight: typography_1.FONT_WEIGHT.font_weight_300,
color: colors_1.COLORS.NEUTRAL.color_neutral_font_100,
font_variant: variants_2.TextVariantType.PARAGRAPH_CAPTION_EXPANDED,
position: inputTheme_1.InputHelpMessagePosition.BOTTOM,
},
informationAssociatedIconHightlight: {
size: size_1.IconHighlightedSizeType.LARGE,
color: colors_1.COLORS.SECONDARY.color_secondary_bg_100,
variant: variants_3.IconHighlightedVariantType.ROUND,
},
inputIcon: {
color: colors_1.COLORS.ACCENT.color_accent_default_icon_100,
width: sizes_1.SIZES.size_250,
height: sizes_1.SIZES.size_250,
},
inputIconContainer: {
position: 'absolute',
top: '50%',
transform: 'translate(0%, -50%)',
left: spacings_1.SPACINGS.spacing_250,
},
inputIconContainerRight: {
position: 'absolute',
top: '50%',
transform: 'translate(0%, -50%)',
left: 'auto',
right: spacings_1.SPACINGS.spacing_250,
},
loaderContainer: {
position: 'absolute',
top: '50%',
left: 'auto',
right: '1.1rem',
transform: 'translate(0%, -50%)',
},
loaderIcon: {
width: sizes_1.SIZES.size_250,
height: sizes_1.SIZES.size_250,
},
loaderVariant: variants_1.LoaderVariantType.PRIMARY_RED,
};
const informationAssociatedProps = {
informationAssociated: {
font_variant: variants_2.TextVariantType.PARAGRAPH_SMALL_EXTENDED,
color: colors_1.COLORS.NEUTRAL.color_neutral_font_50,
font_weight: typography_1.FONT_WEIGHT.font_weight_400,
},
informationAssociatedContainer: {
justify_content: 'space-between',
align_items: 'flex-start',
display: 'flex',
background_color: colors_1.COLORS.NEUTRAL.color_neutral_bg_200,
padding: `${spacings_1.SPACINGS.spacing_250} ${spacings_1.SPACINGS.spacing_300}`,
},
informationAssociatedIcon: {
width: sizes_1.SIZES.size_250,
height: sizes_1.SIZES.size_250,
color: colors_1.COLORS.NEUTRAL.color_neutral_icon_50,
},
informationAssociatedTextAndDecorativeContainer: {
display: 'flex',
gap: spacings_1.SPACINGS.spacing_150,
},
};
const informationAssociatedErrorProps = {
...informationAssociatedProps,
informationAssociatedIcon: {
...informationAssociatedProps.informationAssociatedIcon,
color: colors_1.COLORS.FEEDBACK.color_feedbackError_icon_100,
},
informationAssociatedButton: {
variant: variants_3.ButtonVariantType.ACTION_SECONDARY_ALT,
size: variants_3.ButtonSizeType.LARGE,
},
};
const errorProps = {
input: {
...commonProps.input,
color: colors_1.COLORS.FEEDBACK.color_feedbackError_font_50,
},
inputContainer: {
...commonProps.inputContainer,
border_color: colors_1.COLORS.FEEDBACK.color_feedbackError_border_100,
},
errorAndHelpMessageContainer: {
...commonProps.errorAndHelpMessageContainer,
margin_top: spacings_1.SPACINGS.spacing_150,
},
errorMessage: {
font_variant: variants_2.TextVariantType.PARAGRAPH_CAPTION_EXPANDED,
font_weight: typography_1.FONT_WEIGHT.font_weight_300,
font_align: typography_1.TEXT_ALIGN.left,
color: colors_1.COLORS.FEEDBACK.color_feedbackError_font_50,
},
errorMessageContainer: {
display: 'flex',
flex_direction: 'row',
gap: spacings_1.SPACINGS.spacing_100,
padding_left: spacings_1.SPACINGS.spacing_0,
},
errorMessageIcon: {
width: sizes_1.SIZES.size_150,
height: sizes_1.SIZES.size_150,
color: colors_1.COLORS.FEEDBACK.color_feedbackError_icon_100,
},
placeholder: {
...commonProps.placeholder,
color: colors_1.COLORS.FEEDBACK.color_feedbackError_font_50,
},
};
const disabledCommonProps = {
inputContainer: {
...commonProps.inputContainer,
container_background_color: colors_1.COLORS.DISABLED.color_accentDisabled_bg_150,
container_border_size: borders_1.BORDERS.border_100,
container_border_color: colors_1.COLORS.DISABLED.color_accentDisabled_border_100,
},
input: {
color: colors_1.COLORS.DISABLED.color_accentDisabled_font_50,
},
label: {
...commonProps.label,
color: colors_1.COLORS.DISABLED.color_accentDisabled_font_50,
},
placeholder: {
...commonProps.placeholder,
color: colors_1.COLORS.DISABLED.color_accentDisabled_font_50,
},
helpMessage: {
...commonProps.helpMessage,
color: colors_1.COLORS.DISABLED.color_accentDisabled_font_50,
},
inputIcon: {
...commonProps.inputIcon,
color: colors_1.COLORS.DISABLED.color_accentDisabled_icon_50,
},
};
exports.INPUT_STYLES = {
[variants_4.InputVariantType.DEFAULT]: {
[inputTheme_1.InputState.EMPTY]: {
...commonProps,
},
[inputTheme_1.InputState.ACTIVE]: {
...commonProps,
inputContainer: {
...commonProps.inputContainer,
border_width: borders_1.BORDERS.border_100,
},
},
[inputTheme_1.InputState.FILLED]: {
...commonProps,
...informationAssociatedProps,
},
[inputTheme_1.InputState.ERROR_EMPTY]: {
...commonProps,
...errorProps,
},
[inputTheme_1.InputState.ERROR_FILLED]: {
...commonProps,
...errorProps,
},
[inputTheme_1.InputState.ERROR_ACTIVE]: {
...commonProps,
...errorProps,
inputContainer: {
...errorProps.inputContainer,
border_width: borders_1.BORDERS.border_100,
},
},
[inputTheme_1.InputState.ERROR_FILLED_WITH_INFO]: {
...commonProps,
...informationAssociatedErrorProps,
},
[inputTheme_1.InputState.DISABLED_FILLED]: {
...commonProps,
...disabledCommonProps,
},
[inputTheme_1.InputState.DISABLED_EMPTY]: {
...commonProps,
...disabledCommonProps,
},
[inputTheme_1.InputState.DISABLED_FILLED_WITH_INFO]: {
...commonProps,
...disabledCommonProps,
...informationAssociatedProps,
},
},
};
//# sourceMappingURL=styles.js.map