@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
166 lines • 6.98 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getInputStyles = void 0;
const size_1 = require("../../../../../components/iconHighlighted/types/size");
const inputTheme_1 = require("../../../../../components/input/types/inputTheme");
const variants_1 = require("../../../../../designSystem/kubit/components/variants");
const borders_1 = require("../../../../../designSystem/kubitWireframe/commons/foundations/borders");
const sizes_1 = require("../../../../../designSystem/kubitWireframe/commons/foundations/sizes");
const spacings_1 = require("../../../../../designSystem/kubitWireframe/commons/foundations/spacings");
const typography_1 = require("../../../../../designSystem/kubitWireframe/commons/foundations/typography");
const breakpoints_1 = require("../../../../../types/breakpoints/breakpoints");
const wireframe_1 = require("../../../utils/wireframe");
const variants_2 = require("../variants");
const variants_3 = require("./variants");
const commonProps = COLORS => ({
label: {
type: inputTheme_1.LABEL_TYPE.STANDARD,
font_weight: typography_1.FONT_WEIGHT.font_weight_500,
font_variant: variants_2.TextVariantType.PARAGRAPH_SMALL_EXTENDED,
color: COLORS.NEUTRAL.color_neutral_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,
},
inputWrapperContainer: {
...(0, wireframe_1.transformShadow)(borders_1.RADIUS.radius_300),
...(0, wireframe_1.shadowAfterStyles)(borders_1.RADIUS.radius_300, COLORS.BRAND.color_brand_bg_50, spacings_1.SPACINGS.spacing_50),
},
inputContainer: {
opacity: '1',
padding_left: spacings_1.SPACINGS.spacing_50,
padding: spacings_1.SPACINGS.spacing_250,
background_color: COLORS.NEUTRAL.color_neutral_bg_250,
border_width: borders_1.BORDERS.border_50,
border_color: COLORS.NEUTRAL.color_neutral_border_50,
border_radius: borders_1.RADIUS.radius_300,
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.NEUTRAL.color_neutral_font_50,
},
helpMessage: {
font_align: typography_1.TEXT_ALIGN.left,
font_weight: typography_1.FONT_WEIGHT.font_weight_300,
color: 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.SECONDARY.color_secondary_bg_100,
variant: variants_2.IconHighlightedVariantType.ROUND,
},
helpMessageContainer: {
margin_top: spacings_1.SPACINGS.spacing_100,
padding: spacings_1.SPACINGS.spacing_0,
padding_left: spacings_1.SPACINGS.spacing_0,
display: 'flex',
flex_direction: 'row',
justify_content: 'space-between',
},
inputIcon: {
color: COLORS.NEUTRAL.color_neutral_icon_50,
width: sizes_1.SIZES.size_250,
height: sizes_1.SIZES.size_250,
},
inputIconContainer: {
position: 'absolute',
top: '50%',
transform: 'translate(0%, -50%)',
left: '0.625rem',
},
inputIconContainerRight: {
position: 'absolute',
top: '50%',
transform: 'translate(0%, -50%)',
left: 'auto',
right: '1.1rem',
},
loaderIcon: {
width: sizes_1.SIZES.size_250,
height: sizes_1.SIZES.size_250,
},
loaderVariant: variants_1.LoaderVariantType.PRIMARY_WHITE,
});
const informationAssociatedProps = COLORS => ({
informationAssociated: {
font_variant: variants_2.TextVariantType.PARAGRAPH_SMALL_EXTENDED,
color: 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.NEUTRAL.color_neutral_bg_200,
padding: `${spacings_1.SPACINGS.spacing_250} ${spacings_1.SPACINGS.spacing_300}`,
margin_top: spacings_1.SPACINGS.spacing_150,
...(0, wireframe_1.transformShadow)(borders_1.RADIUS.radius_300),
...(0, wireframe_1.shadowAfterStyles)(borders_1.RADIUS.radius_300, COLORS.BRAND.color_brand_bg_50, spacings_1.SPACINGS.spacing_50),
},
informationAssociatedIcon: {
width: sizes_1.SIZES.size_250,
height: sizes_1.SIZES.size_250,
color: COLORS.NEUTRAL.color_neutral_icon_50,
},
informationAssociatedTextAndDecorativeContainer: {
display: 'flex',
gap: spacings_1.SPACINGS.spacing_150,
},
});
const getInputStyles = (COLORS) => {
return {
[variants_3.InputVariantType.DEFAULT]: {
[inputTheme_1.InputState.EMPTY]: {
...commonProps(COLORS),
},
[inputTheme_1.InputState.ACTIVE]: {
...commonProps(COLORS),
},
[inputTheme_1.InputState.FILLED]: {
...commonProps(COLORS),
...informationAssociatedProps(COLORS),
},
[inputTheme_1.InputState.ERROR_EMPTY]: {
...commonProps(COLORS),
errorMessageContainer: {
margin_top: spacings_1.SPACINGS.spacing_150,
},
},
[inputTheme_1.InputState.ERROR_FILLED]: {
...commonProps(COLORS),
errorMessageContainer: {
margin_top: spacings_1.SPACINGS.spacing_150,
},
},
[inputTheme_1.InputState.ERROR_ACTIVE]: {
...commonProps(COLORS),
errorMessageContainer: {
margin_top: spacings_1.SPACINGS.spacing_150,
},
},
[inputTheme_1.InputState.ERROR_FILLED_WITH_INFO]: {
...commonProps(COLORS),
errorMessageContainer: {
margin_top: spacings_1.SPACINGS.spacing_150,
},
},
[inputTheme_1.InputState.DISABLED_FILLED]: {
...commonProps(COLORS),
},
[inputTheme_1.InputState.DISABLED_EMPTY]: {
...commonProps(COLORS),
},
[inputTheme_1.InputState.DISABLED_FILLED_WITH_INFO]: {
...commonProps(COLORS),
},
},
};
};
exports.getInputStyles = getInputStyles;
//# sourceMappingURL=styles.js.map