Home Reference Source

src/utils/DimensionsConstants.js

/**
 * Enum constants defining size, dimensions and style of components
 */

/**
 * Enum defining the length of a button (journal button)
 * @readonly
 * @enum {number}
 * @type {Object}
 * @property {number} NORMAL - Normal length
 * @property {number} SHORT - Short length
 * @property {number} FULL_LENGTH - Full length
 */
const ButtonLength = Object.freeze({
    NORMAL: 1,
    SHORT: 2,
    FULL_LENGTH: 3,
});

/**
 * Enum defining the size of round button
 * @readonly
 * @enum {number}
 * @type {Object}
 * @property {number} NORMAL - Normal size button for main navigation elements
 * @property {number} SMALL - Small size button
 * @property {number} TINY - Tiny button
 */
const RoundButtonSize = Object.freeze({
    NORMAL: 1,
    SMALL: 2,
    TINY: 3,
});

/**
 * Enum defining the dimensions of round buttons (journal button)
 * @readonly
 * @enum {number}
 * @type {Object}
 * @property {number} NORMAL_BUTTON - Normal size button
 * @property {number} SMALL_BUTTON - Small size button
 * @property {number} TINY_BUTTON - Tiny size button
 */
const RoundButtonDimensions = Object.freeze({
    NORMAL_BUTTON: {
        width: 120,
    },
    SMALL_BUTTON: {
        width: 100,
    },
    TINY_BUTTON: {
        width: 60,
    },
});

/**
 * Enum defining the color lightness of a component of a button
 * @readonly
 * @enum {number}
 * @type {Object}
 * @property {number} DARK - Dark color component
 * @property {number} LIGHT - Light color component
 */
const ButtonLightness = Object.freeze({
    DARK: 1,
    LIGHT: 2,
});

/**
 * Enum defining the dimensions of square buttons
 * @readonly
 * @enum {number}
 * @type {Object}
 * @property {number} LARGE_BUTTON - Large button
 */
const SquareButtonDimensions = Object.freeze({
    LARGE_BUTTON: {
        width: 220,
        height: 100,
    },
});

/**
 * Enum defining the dimensions of round buttons in journal module.
 * @readonly
 * @enum {number}
 * @type {Object}
 * @property {number} SMALL_BUTTON - Small size button
 * @property {number} NORMAL_BUTTON - Normal size button
 * @property {number} LARGE_BUTTON - Large size button
 */
const JournalButtonDimensions = Object.freeze({
    SMALL_BUTTON: {
        height: 35,
        width: 100,
        borderRadius: 8,
    },
    NORMAL_BUTTON: {
        height: 50,
        width: 120,
        borderRadius: 10,
    },
    LARGE_BUTTON: {
        width: 160,
        height: 65,
        borderRadius: 15,
    },
});

/**
 * Enum defining the position of components
 * @readonly
 * @enum {number}
 * @type {Object}
 * @property {number} LEFT - Left side of the parent
 * @property {number} RIGHT - Right side of the parent
 * @property {number} MIDDLE - In the middle of the parent
 */
const ButtonPosition = Object.freeze({
    LEFT: 1,
    RIGHT: 2,
    MIDDLE: 3,
});

export {
    ButtonLength,
    ButtonPosition,
    RoundButtonSize,
    RoundButtonDimensions,
    ButtonLightness,
    SquareButtonDimensions,
    JournalButtonDimensions,
};