0.1.73 • Published 4 days ago

tec-web-base v0.1.73

Weekly downloads
-
License
MIT
Repository
-
Last release
4 days ago

Tec Web Base

Welcome to the comprehensive documentation for our tec-web-base npm package, a dynamic foundation meticulously built on React.js, integrating essential components and best practices for seamless and efficient software development. This robust starting point encapsulates a wealth of features, including custom hooks for HTTP services and sessions, Material-UI for component design. Whether you are a seasoned developer or just starting, this documentation provides a roadmap to leverage the rich functionalities and ensure a smooth development journey.

Getting Started

Install npm package tec-web-base in your project through this command:

npm i tec-web-base

Components

Our package comes equipped with a versatile set of components, carefully selected to enhance your development experience. Each component is designed to seamlessly integrate with your projects, providing consistent styling and behavior. Let's explore the main components included in our package:

Backdrop

The Backdrop component narrows the user's focus to a particular element on the screen.

import {Backdrop} from 'tec-web-base';

<Backdrop loading={loading}/>

Props

NameTypeDefaultDescription
loadingbooleanfalseControls the visibility of the backdrop. When set to true, the backdrop is visible; when set to false, the backdrop is hidden.

Note: You can further enhance the functionality by including the additional props available for the MUI Backdrop component... Read More

Button

The Button component allows users to take actions and make choices with a single tap.

import {Button} from 'tec-web-base';

<Button
    variant="contained"
    title="Title"
    startIcon={<AddIcon/>}
    onClick={() => {
    }}
/>

Props

NameTypeDefaultDescription
titlestring'Button'The text displayed on the button

Note: You can further enhance the functionality by including the additional props available for the MUI Button component... Read More

Checkbox

The Checkboxes allow the user to select one or more items from a set.

import {CheckBox} from 'tec-web-base';

<CheckBox
    name="jobType"
    label="Job Type"
    value={['full-time', 'contract']}
    options={[
        {id: 'full-time', label: 'Full Time', checked: false},
        {id: 'part-time', label: 'Part Time', checked: false},
        {id: 'contract', label: 'Contract', checked: false}
    ]}
    onChangeHandler={(event, selectedValues) => {
        console.log('job type', event.target.value, selectedValues)
    }}
    errors={{jobType: {message: 'Something went wrong'}}}
/>

Props

NameTypeDefaultDescription
namestring-This property will be used when you are using a checkbox in a form or when displaying errors.
labelstring'Checkbox'The text displayed as the title of the checkbox.
optionsarray-TIn this property, you will send an array of options for the checkbox.
valuearray-Represent the current state of the checkbox group. The array should contain the IDs of items that are to be checked by default.
disabledbooleanfalseThis is used to disable the checkbox group.

Note: You can further enhance the functionality by including the additional props available for the MUI FormGroup component... Read More

Dialog

A Dialog is a type of modal window that appears in front of app content to provide critical information or ask for a decision. Dialogs disable all app functionality when they appear and remain on screen until confirmed, dismissed, or a required action has been taken.

import * as React from 'react';
import Box from '@mui/material/Box';
import {Dialog} from 'tec-web-base';

export default function Component() {
    const [open, setOpen] = React.useState(false);
    return (
        <Box>
            <Dialog
                open={open}
                setOpen={setOpen}
            />
        </Box>
    );
}

You can pass children to Dialog components. This allows you to include additional content, such as text, buttons, or other components, within the dialog.

import * as React from 'react';
import Box from '@mui/material/Box';
import {Dialog} from 'tec-web-base';

export default function Component() {
    const [open, setOpen] = React.useState(false);
    return (
        <Box>
            <Dialog
                open={open}
                setOpen={setOpen}
                children={<Typography>You can pass any JSX/React component here.</Typography>}
            />
        </Box>
    );
}

Props

NameTypeDefaultDescription
openbooleanfalseIf true, the component is shown.
setOpenfunction-'setOpen' is a function that will change the state of 'open'.
actionobject{ title: 'Okay', variant: 'contained', onClick: function () {setOpen(false)} }Action is an object that contains additional props for the action button. For more details, see the 'Action Props'.
headingstring'Success!'The heading prop contains the title of the dialog.
descriptionstring'Your action has been completed successfully.'It contains the message of the dialog.
childrennode-Dialog children, usually the included sub-components.

Note: You can further enhance the functionality by including the additional props available for the MUI Dialog component... Read More

Action Props

NameTypeDefaultDescription
titlestring'Okay'The text displayed on the action button.
variantstring'contained', 'outlined', 'text', 'string'The variant to use.
onClickfunctionfunction () { setOpen(false) }Funcation that will call on action button click.

Note: You can further enhance the functionality by including the additional props available for the MUI Button component... Read More

FileUpload

The File Upload component allows users to easily select and upload files.

import * as React from 'react';
import Box from '@mui/material/Box';
import {FileUpload} from 'tec-web-base';

export default function BasicTextFields() {
    const [open, setOpen] = React.useState(false);
    return (
        <Box>
            <FileUpload
                name="logo"
                label="Logo"
                accept="image/*"
                onChangeHandler={(event) => {
                    let {files} = event?.target;
                    //Here You can implement your logic.
                }}
            />
        </Box>
    );
}

Props

NameTypeDefaultDescription
namestring-This property will be used when you are using a FileUpload Field in a form or when displaying errors.
labelstring'Upload File'The text displayed as the title of the
variant'contained', 'outlined', 'filled''outlined'The variant to use.
onChangeHandlerfunction-function(event: object) => void event The event source of the callback. You can pull out the new value by accessing event.target.value (string).
acceptstring'image/*'The accept attribute specifies the types of files that are allowed to be uploaded using this file input field

Note: You can further enhance the functionality by including the additional props available for the MUI Button component... Read More

Note: The documentation for tec-web-base is currently incomplete and is still in the process of being developed. We apologize for any inconvenience this may cause and appreciate your patience.

0.1.73

4 days ago

0.1.72

10 days ago

0.1.71

11 days ago

0.1.70

12 days ago

0.1.66

12 days ago

0.1.67

12 days ago

0.1.68

12 days ago

0.1.69

12 days ago

0.1.63

13 days ago

0.1.64

13 days ago

0.1.65

13 days ago

0.1.62

13 days ago

0.1.58

2 months ago

0.1.59

2 months ago

0.1.60

2 months ago

0.1.61

2 months ago

0.1.52

3 months ago

0.1.53

3 months ago

0.1.55

3 months ago

0.1.56

3 months ago

0.1.57

3 months ago

0.1.50

3 months ago

0.1.51

3 months ago

0.1.49

3 months ago

0.1.47

3 months ago

0.1.48

3 months ago

0.1.43

4 months ago

0.1.44

4 months ago

0.1.45

4 months ago

0.1.46

4 months ago

0.1.41

4 months ago

0.1.42

4 months ago

0.1.40

4 months ago

0.1.38

4 months ago

0.1.39

4 months ago

0.1.30

4 months ago

0.1.31

4 months ago

0.1.32

4 months ago

0.1.33

4 months ago

0.1.34

4 months ago

0.1.35

4 months ago

0.1.36

4 months ago

0.1.37

4 months ago

0.1.29

4 months ago

0.1.27

4 months ago

0.1.28

4 months ago

0.1.24

4 months ago

0.1.25

4 months ago

0.1.26

4 months ago

0.1.10

4 months ago

0.1.11

4 months ago

0.1.12

4 months ago

0.1.13

4 months ago

0.1.14

4 months ago

0.1.15

4 months ago

0.1.20

4 months ago

0.1.21

4 months ago

0.1.22

4 months ago

0.1.23

4 months ago

0.1.16

4 months ago

0.1.17

4 months ago

0.1.18

4 months ago

0.1.19

4 months ago

0.1.8

4 months ago

0.1.7

4 months ago

0.1.9

4 months ago

0.1.6

4 months ago

0.1.5

4 months ago

0.1.4

4 months ago

0.1.3

4 months ago

0.1.2

4 months ago

0.1.1

4 months ago

0.1.0

4 months ago