UNPKG

@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

154 lines 7.44 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getVirtualKeyboardStyles = void 0; const state_1 = require("../../../../../components/virtualKeyboard/types/state"); const borders_1 = require("../../../../../designSystem/kubitWireframe/commons/foundations/borders"); const shadow_1 = require("../../../../../designSystem/kubitWireframe/commons/foundations/shadow"); const spacings_1 = require("../../../../../designSystem/kubitWireframe/commons/foundations/spacings"); const typography_1 = require("../../../../../designSystem/kubitWireframe/commons/foundations/typography"); const wireframe_1 = require("../../../../../designSystem/kubitWireframe/utils/wireframe"); const variants_1 = require("../../../../kubit/components/text/variants"); const variants_2 = require("./variants"); const buildCommonProps = (COLORS) => ({ container: { display: 'grid', grid_template_columns: 'repeat(6, 1fr)', grid_template_rows: 'repeat(2, 1fr)', grid_column_gap: spacings_1.SPACINGS.spacing_0, grid_row_gap: spacings_1.SPACINGS.spacing_0, overflow: 'visible', background_color: COLORS.NEUTRAL.color_neutral_bg_250, min_width: '20.5rem', border_style: 'solid', border_width: borders_1.BORDERS.border_50, border_color: COLORS.NEUTRAL.color_neutral_border_150, border_radius: `${borders_1.RADIUS.radius_00} ${borders_1.RADIUS.radius_00} ${borders_1.RADIUS.radius_100} ${borders_1.RADIUS.radius_00}`, ...(0, wireframe_1.transformShadow)(`${borders_1.RADIUS.radius_00} ${borders_1.RADIUS.radius_00} ${borders_1.RADIUS.radius_100} ${borders_1.RADIUS.radius_00}`), ...(0, wireframe_1.shadowAfterStyles)(`${borders_1.RADIUS.radius_00} ${borders_1.RADIUS.radius_100} ${borders_1.RADIUS.radius_100} ${borders_1.RADIUS.radius_100}`, COLORS.BRAND.color_brand_bg_50, spacings_1.SPACINGS.spacing_50), icon: { color: COLORS.ACCENT.color_accent_default_icon_100, height: spacings_1.SPACINGS.spacing_400, width: spacings_1.SPACINGS.spacing_400, }, }, removeButton: { justify_content: 'center', align_items: 'center', grid_area: '1 / 6 / 3 / 7', cursor: 'pointer', padding: `${spacings_1.SPACINGS.spacing_0} ${spacings_1.SPACINGS.spacing_50}`, min_width: '3.5rem', border_radius: `${borders_1.RADIUS.radius_00} ${borders_1.RADIUS.radius_00} ${borders_1.RADIUS.radius_100} ${borders_1.RADIUS.radius_00}`, }, digitButtons: { wrapper: { grid_area: '1 / 1 / 3 / 6', display: 'grid', grid_template_columns: 'auto auto auto auto auto', button: { cursor: 'pointer', display: 'flex', align_items: 'center', justify_content: 'center', border_style: 'solid', border_right_width: borders_1.BORDERS.border_50, border_bottom_width: borders_1.BORDERS.border_50, border_right_color: COLORS.NEUTRAL.color_neutral_border_150, border_bottom_color: COLORS.NEUTRAL.color_neutral_border_150, padding: `${spacings_1.SPACINGS.spacing_200} ${spacings_1.SPACINGS.spacing_150}`, }, text: { display: 'flex', align_items: 'center', justify_content: 'center', font_variant: variants_1.TextVariantType.PARAGRAPH_MEDIUM_EXPANDED, color: COLORS.NEUTRAL.color_neutral_font_50, }, }, }, }); const getVirtualKeyboardStyles = (COLORS) => { const commonProps = buildCommonProps(COLORS); return { [variants_2.VirtualKeyboardVariantType.DEFAULT]: { [state_1.VirtualKeyboardStateType.INACTIVE]: { container: { ...commonProps.container, }, removeButton: { [state_1.ButtonKeyboardStateType.DEFAULT]: { ...commonProps.removeButton, }, [state_1.ButtonKeyboardStateType.PRESSED]: { ...commonProps.removeButton, background_color: COLORS.NEUTRAL.color_neutral_bg_200, }, }, digitButtons: { wrapper: { ...commonProps.digitButtons.wrapper, [state_1.ButtonKeyboardStateType.DEFAULT]: { button: { ...commonProps.digitButtons.wrapper.button, }, text: { ...commonProps.digitButtons.wrapper.text, }, }, [state_1.ButtonKeyboardStateType.PRESSED]: { button: { ...commonProps.digitButtons.wrapper.button, background_color: COLORS.NEUTRAL.color_neutral_bg_200, }, text: { ...commonProps.digitButtons.wrapper.text, font_weight: typography_1.FONT_WEIGHT.font_weight_600, }, }, }, }, }, [state_1.VirtualKeyboardStateType.ACTIVE]: { container: { ...commonProps.container, box_shadow: shadow_1.SHADOW.shadow_10, }, removeButton: { [state_1.ButtonKeyboardStateType.DEFAULT]: { ...commonProps.removeButton, }, [state_1.ButtonKeyboardStateType.PRESSED]: { ...commonProps.removeButton, background_color: COLORS.NEUTRAL.color_neutral_bg_200, }, }, digitButtons: { wrapper: { ...commonProps.digitButtons.wrapper, [state_1.ButtonKeyboardStateType.DEFAULT]: { button: { ...commonProps.digitButtons.wrapper.button, background_color: COLORS.NEUTRAL.color_neutral_bg_250, }, text: { ...commonProps.digitButtons.wrapper.text, }, }, [state_1.ButtonKeyboardStateType.PRESSED]: { button: { ...commonProps.digitButtons.wrapper.button, background_color: COLORS.NEUTRAL.color_neutral_bg_200, }, text: { ...commonProps.digitButtons.wrapper.text, font_weight: typography_1.FONT_WEIGHT.font_weight_600, }, }, }, }, }, }, }; }; exports.getVirtualKeyboardStyles = getVirtualKeyboardStyles; //# sourceMappingURL=styles.js.map