# Scone JS Common

<p  align='center'>React component library for Scone

### Install

```js

$ npm install scone-js-common

```

or if you prefer yarn

```js

$ yarn add scone-js-common

```

### List of components that are available in the library

```js
import { SconeCalculator } from "scone-js-common";

or;

import SconeCalculator from "scone-js-common/build/components/SconeCalculator";
```

### Usage

```ts
import { SconeCalculator } from "scone-js-common";

const Demo = () => {
  const handleCompletion = (footPrintDetails: any) => {
    console.log("completed", footPrintDetails);
  };

  const handleStepChange = (step: number, footPrintDetails: any) => {
    console.log("step", step, footPrintDetails);
  };

  const handleSkip = (footPrintDetails: any) => {
    console.log("skip", footPrintDetails);
  };

  return (
    <SconeCalculator
      showSideBar={true}
      showSkip={true}
      locale={"en-US"}
      onCompletion={handleCompletion}
      onStepChange={handleStepChange}
      onSkip={handleSkip}
      calculatorApiUrl={API_RAW_CALCULATE}
    />
  );
};
```

### Component props

#### SconeCalculator

```ts
interface SconeCalculatorProps {
  showSideBar?: boolean;
  calculatorApiUrl?: string;
  showSkip?: boolean;
  offsetRoute?: string;
  locale?: Locale;
  onCompletion?: (footPrint: any) => void;
  onStepChange?: (step: number, footPrint: any) => void;
  onSkip?: (footPrint: any) => void;
}
```

### Development

To generate all `*.js`, `*.d.ts` files

```bash

$ npm run build

```
