package
<!-- README for NPM; the one for GitHub is in .github directory. -->
npm install @shipengine/elementsGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
ShipEngine Elements is a collection of React components that provide shipping functionality through a standardized interface. This guide provides the essential steps for creating new elements in the ShipEngine Elements library.
Each element is composed of:
libs/elements/src/elements/new-element/
├── index.ts # Export file
├── new-element.tsx # Main element file
├── __stories__/ # Storybook stories
│ └── new-element.stories.tsx
└── __tests__/ # Jest tests
└── new-element.test.tsxmkdir -p libs/elements/src/elements/new-element/{__stories__,__tests__}libs/elements/src/elements/new-element/new-element.tsx
import { ErrorFallback } from "@components/error-fallback";
import { Button, Typography } from "@shipengine/giger";
import { useTranslation } from "react-i18next";
import { createElement } from "../../create-element";
import { en } from "../../locales";
/**
* Props for the NewElement component
*/
export type NewElementProps = {
/** Optional title to display */
title?: string;
/** Callback function when action is performed */
onClick?: (value: any) => void;
};
libs/elements/src/elements/new-element/index.ts
export * as NewElement from "./new-element";
export type { NewElementProps } from "./new-element";libs/elements/src/locales/en/new-element.json
{
"description": "This is a new Element!",
"actionButton": "Continue"
}libs/elements/src/elements/new-element/__stories__/new-element.stories.tsx
import type { Meta, StoryObj } from "@storybook/react";
import { NewElement } from "../new-element";
const meta: Meta<typeof NewElement.Element> = {
title: "Elements/NewElement",
component: NewElement.Element,
parameters: {
layout: "centered",
},
tags: ["autodocs"],
};
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
Add your new element to libs/elements/package.json exports:
{
"exports": {
"./new-element": {
"source": "./src/elements/new-element/index.ts",
"import": {
"types": "./dist/types/elements/new-element/index.d.ts",
"default": "./dist/esm/elements/new-element/index.js"
},
"require": {
"types": "./dist/types/elements/new-element/index.d.ts",
"default": "./dist/cjs/elements/new-element/index.cjs"
}
}
}
}Add your element to libs/elements/src/index.ts:
export * from "./elements/new-element";agustin.martin.auctane
agustin.martin@auctane.com
joshuaflanagan
joshua@shippingeasy.com
prasadjoshi29
prasad.joshi@auctane.com
binkard-auctane
andrew.binkard@auctane.com
lzhang
lewiszhang@gmail.com
dlblom
danielle.blom@auctane.com
rickyr
ricky.rivera@gmail.com
dbernazal
david.bernazal@auctane.com
auc-rhibbeler
ryan.hibbeler@auctane.com
harris.butler
harris.butler@auctane.com
jeffrysparrow
sparrowjefft@gmail.com
ckroutterauctane
cristina.kroutter@auctane.com
chunter-auctane
chris.hunter@auctane.com
arapicki
adam.rapicki@auctane.com
romofel
felipe@romofel.dev
auctane.joshua.semar
joshua.semar@auctane.com
christian.casado
christian.casado@auctane.com
auctome
tom.coladonato@auctane.com
arjun.modi
arjun.modi@auctane.com
ddygas
danuta.dygas@auctane.com
deeepawesome
deeepawesome@gmail.com
lukasz.parala
lukasz.parala@auctane.com
pspringerauct
przemyslaw.springer@auctane.com
akowalczyk
adam.kowalczyk@auctane.com
alicjawolnikkuzminska
alicja.wolnik-kuzminska@auctane.com
dangnguyen91
dang.nguyen@auctane.com
krzysztof.malcher
krzysztof.malcher@auctane.com
marcin_karwat_auctane
marcin.karwat@auctane.com
maciej_adamek
maciej.adamek@auctane.com
mspiaczka-auctane
marcel.spiaczka@auctane.com
bartoszzurawski
bartosz.zurawski@auctane.com
mmilowska
magdalena.milowska@auctane.com
bmusielak
bartosz.musielak@auctane.com
kdobrzynskiactn
krzysztof.dobrzynski@auctane.com
maciej_sabik_auctane
maciej.sabik@auctane.com
zjaholkowska
zuzanna.czarnecka@auctane.com
rafal.maj
rafal.majewski@auctane.com
greta.ratajczak
greta.ratajczak@auctane.com
jakubhypki
jakub.hypki@auctane.com
alejandro-orta
alejandro.orta@auctane.com
liana.reyes.auctane
liana.reyes@auctane.com
jhkillam-auctane
joseph.killam@auctane.com
Estimated unpacked size across 65 packages.
72.8 MB+
Includes dependencies.
^4.0.0
4.0.0
^5.16.1
6.11.1
^10.0.0
10.1.1
^8.1.1
10.0.4
^7.31.2
7.92.0
^1.26.0
1.32.1
^1.10.14
1.13.16
4.43.0
4.44.0
2.9.11
7.0.6
^5.16.1
6.11.1
4.23.7
4.27.0
^4.0.0
5.107.1
8.3.0