@shipengine/elements 1.1.2 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +5443 -4730
- package/index.js +5434 -4729
- package/package.json +3 -2
- package/src/components/code-block/code-block.d.ts +6 -0
- package/src/components/code-block/index.d.ts +1 -0
- package/src/components/drawer/drawer.d.ts +9 -0
- package/src/components/drawer/drawer.styles.d.ts +28 -0
- package/src/components/drawer/index.d.ts +1 -0
- package/src/components/field/date-picker/date-picker.d.ts +2 -2
- package/src/components/index.d.ts +6 -3
- package/src/components/tabs/index.d.ts +1 -0
- package/src/components/tabs/tabs.d.ts +7 -0
- package/src/components/tabs/tabs.styles.d.ts +20 -0
- package/src/components/templates/index.d.ts +4 -3
- package/src/components/templates/theme-creator/color-palette-editor/color-palette-editor.d.ts +8 -0
- package/src/components/templates/theme-creator/color-palette-editor/color-palette-editor.styles.d.ts +49 -0
- package/src/components/templates/theme-creator/color-palette-editor/index.d.ts +1 -0
- package/src/components/templates/theme-creator/index.d.ts +3 -0
- package/src/components/templates/theme-creator/theme-creator.d.ts +10 -0
- package/src/components/templates/theme-creator/theme-creator.styles.d.ts +71 -0
- package/src/components/templates/theme-creator/typography-editor/index.d.ts +1 -0
- package/src/components/templates/theme-creator/typography-editor/typography-editor.d.ts +8 -0
- package/src/components/templates/theme-creator/typography-editor/typography-editor.styles.d.ts +36 -0
- package/src/elements/index.d.ts +2 -1
- package/src/elements/theme-creator/index.d.ts +2 -0
- package/src/elements/theme-creator/theme-creator-provider.d.ts +12 -0
- package/src/elements/theme-creator/theme-creator.d.ts +694 -0
- package/src/elements/theme-creator/themeData/index.d.ts +1 -0
- package/src/elements/theme-creator/themeData/themeData.d.ts +3 -0
- package/src/utilities/{string.d.ts → formatString.d.ts} +2 -0
- package/src/utilities/index.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipengine/elements",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@shipengine/alchemy": "5.x.x",
|
|
6
6
|
"@emotion/react": "11.x",
|
|
@@ -45,7 +45,8 @@
|
|
|
45
45
|
"js-base64": "3.7.3",
|
|
46
46
|
"libphonenumber-js": "1.10.14",
|
|
47
47
|
"lodash": "4.17.21",
|
|
48
|
-
"react-
|
|
48
|
+
"prism-react-renderer": "2.3.1",
|
|
49
|
+
"react-datepicker": "4.25.0",
|
|
49
50
|
"react-hook-form": "7.40.0",
|
|
50
51
|
"rollup-plugin-copy": "3.4.0",
|
|
51
52
|
"zod": "3.19.1"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./code-block";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type DrawerProps = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
headerContent?: React.ReactNode;
|
|
5
|
+
isOpen?: boolean;
|
|
6
|
+
toggleDrawer: () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const Drawer: ({ children, headerContent, isOpen, toggleDrawer }: DrawerProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Theme } from "@emotion/react";
|
|
2
|
+
export declare const styles: {
|
|
3
|
+
container: {
|
|
4
|
+
backgroundColor: "#11003A";
|
|
5
|
+
};
|
|
6
|
+
getChildrenStyles: (isOpen?: boolean) => (theme: Theme) => {
|
|
7
|
+
height: string;
|
|
8
|
+
overflow: "scroll";
|
|
9
|
+
paddingLeft: number;
|
|
10
|
+
};
|
|
11
|
+
getDrawerStyles: (isOpen?: boolean) => (theme: Theme) => {
|
|
12
|
+
backgroundColor: "#11003A";
|
|
13
|
+
bottom: number;
|
|
14
|
+
height: string;
|
|
15
|
+
minWidth: string;
|
|
16
|
+
position: "fixed";
|
|
17
|
+
transformOrigin: string;
|
|
18
|
+
transition: "height 0.5s;";
|
|
19
|
+
};
|
|
20
|
+
header: (theme: Theme) => {
|
|
21
|
+
alignItems: "center";
|
|
22
|
+
color: "#fff";
|
|
23
|
+
display: "flex";
|
|
24
|
+
height: number;
|
|
25
|
+
justifyContent: "space-between";
|
|
26
|
+
padding: number;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./drawer";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as RDP from "react-datepicker";
|
|
2
2
|
import { ControlledField } from "../create-field-controller";
|
|
3
3
|
export type DatePickerProps = {
|
|
4
4
|
onChange?: (date: string | null) => void;
|
|
5
5
|
translator?: (text: string) => string;
|
|
6
|
-
} & Omit<ReactDatePickerProps, "onChange">;
|
|
6
|
+
} & Omit<RDP.ReactDatePickerProps, "onChange">;
|
|
7
7
|
export declare const DatePicker: ControlledField<DatePickerProps>;
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
export * from "./collapsible-panel";
|
|
2
1
|
export * from "./add-funds-form";
|
|
3
2
|
export * from "./auto-funding-form";
|
|
4
3
|
export * from "./button-group";
|
|
5
4
|
export * from "./carrier-balance";
|
|
6
5
|
export * from "./carrier-icon";
|
|
7
6
|
export * from "./carrier-logo";
|
|
7
|
+
export * from "./code-block";
|
|
8
|
+
export * from "./collapsible-panel";
|
|
8
9
|
export * from "./copy";
|
|
9
10
|
export * from "./cube";
|
|
10
11
|
export * from "./date-range-combo";
|
|
11
12
|
export * from "./date-range-select";
|
|
12
13
|
export * from "./display-term";
|
|
14
|
+
export * from "./drawer";
|
|
13
15
|
export * from "./error-fallback";
|
|
14
|
-
export * from "./field";
|
|
15
16
|
export * from "./field-label";
|
|
17
|
+
export * from "./field";
|
|
16
18
|
export * from "./form-portal";
|
|
17
19
|
export * from "./fund-and-purchase";
|
|
20
|
+
export * from "./grid-controller";
|
|
18
21
|
export * from "./inline-label";
|
|
19
22
|
export * from "./items-breakdown";
|
|
20
23
|
export * from "./link-action";
|
|
@@ -28,4 +31,4 @@ export * from "./section";
|
|
|
28
31
|
export * from "./spacer";
|
|
29
32
|
export * from "./spread";
|
|
30
33
|
export * from "./story-notes";
|
|
31
|
-
export * from "./
|
|
34
|
+
export * from "./tabs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./tabs";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const styles: {
|
|
2
|
+
container: (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
|
|
3
|
+
border: string;
|
|
4
|
+
borderRadius: string;
|
|
5
|
+
display: "flex";
|
|
6
|
+
gap: number;
|
|
7
|
+
padding: number;
|
|
8
|
+
width: string;
|
|
9
|
+
};
|
|
10
|
+
getTabStyles: (selected: boolean) => (theme: import("@shipengine/giger-theme/dist/lib/Theme").Theme) => {
|
|
11
|
+
backgroundColor: string;
|
|
12
|
+
border: string;
|
|
13
|
+
borderRadius: string;
|
|
14
|
+
color: string;
|
|
15
|
+
cursor: "pointer";
|
|
16
|
+
fontSize: string;
|
|
17
|
+
fontWeight: "normal" | "bold";
|
|
18
|
+
padding: number;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
export * from "../address-preference-context";
|
|
1
2
|
export * from "./account-settings";
|
|
2
3
|
export * from "./add-carrier-form";
|
|
3
4
|
export * from "./address-display";
|
|
4
5
|
export * from "./address-form";
|
|
5
6
|
export * from "./address-parser";
|
|
6
|
-
export * from "../address-preference-context";
|
|
7
7
|
export * from "./address-preference-display";
|
|
8
8
|
export * from "./address-preference-select";
|
|
9
9
|
export * from "./customs-item-form";
|
|
@@ -11,9 +11,10 @@ export * from "./label";
|
|
|
11
11
|
export * from "./list-carriers";
|
|
12
12
|
export * from "./manage-warehouses";
|
|
13
13
|
export * from "./rate-form";
|
|
14
|
-
export * from "./suspend-sales-order";
|
|
15
14
|
export * from "./shipment-form";
|
|
16
15
|
export * from "./shipment";
|
|
16
|
+
export * from "./suspend-sales-order";
|
|
17
17
|
export * from "./suspend-shipment";
|
|
18
|
-
export * from "./
|
|
18
|
+
export * from "./theme-creator";
|
|
19
19
|
export * from "./wallet-form";
|
|
20
|
+
export * from "./warehouse-form";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CustomThemeData } from "@shipengine/giger-theme";
|
|
2
|
+
type ColorPaletteEditorProps = {
|
|
3
|
+
formatKey: (key: string) => string;
|
|
4
|
+
onUpdatePaletteConfig: (paletteConfig: CustomThemeData["palette"]) => void;
|
|
5
|
+
paletteConfig: CustomThemeData["palette"];
|
|
6
|
+
};
|
|
7
|
+
export declare const ColorPaletteEditor: ({ paletteConfig, onUpdatePaletteConfig, formatKey, }: ColorPaletteEditorProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
package/src/components/templates/theme-creator/color-palette-editor/color-palette-editor.styles.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Theme } from "@emotion/react";
|
|
2
|
+
export declare const styles: {
|
|
3
|
+
category: {
|
|
4
|
+
alignItems: "center";
|
|
5
|
+
cursor: "pointer";
|
|
6
|
+
display: "flex";
|
|
7
|
+
flexDirection: "row";
|
|
8
|
+
justifyContent: "space-between";
|
|
9
|
+
};
|
|
10
|
+
colorPicker: (theme: Theme) => {
|
|
11
|
+
"&::-webkit-color-swatch": {
|
|
12
|
+
border: string;
|
|
13
|
+
borderRadius: string;
|
|
14
|
+
padding: number;
|
|
15
|
+
};
|
|
16
|
+
"&::-webkit-color-swatch-wrapper": {
|
|
17
|
+
padding: number;
|
|
18
|
+
};
|
|
19
|
+
alignSelf: "center";
|
|
20
|
+
appearance: "none";
|
|
21
|
+
background: string;
|
|
22
|
+
border: number;
|
|
23
|
+
cursor: "pointer";
|
|
24
|
+
height: number;
|
|
25
|
+
outline: string;
|
|
26
|
+
width: number;
|
|
27
|
+
};
|
|
28
|
+
container: (theme: Theme) => {
|
|
29
|
+
marginBottom: number;
|
|
30
|
+
};
|
|
31
|
+
input: (theme: Theme) => {
|
|
32
|
+
border: string;
|
|
33
|
+
borderRadius: string;
|
|
34
|
+
color: string;
|
|
35
|
+
fontSize: string;
|
|
36
|
+
padding: number;
|
|
37
|
+
};
|
|
38
|
+
inputContainer: (theme: Theme) => {
|
|
39
|
+
alignItems: "center";
|
|
40
|
+
display: "flex";
|
|
41
|
+
flexDirection: "row";
|
|
42
|
+
justifyContent: "space-between";
|
|
43
|
+
padding: string;
|
|
44
|
+
};
|
|
45
|
+
wrapper: (theme: Theme) => {
|
|
46
|
+
display: "flex";
|
|
47
|
+
gap: number;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./color-palette-editor";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CustomThemeData } from "@shipengine/giger-theme";
|
|
2
|
+
export type ThemeCreatorProps = {
|
|
3
|
+
onUpdateThemeConfig: (themeConfig: CustomThemeData) => void;
|
|
4
|
+
presets?: {
|
|
5
|
+
presetName: string;
|
|
6
|
+
themeConfig: CustomThemeData;
|
|
7
|
+
}[];
|
|
8
|
+
themeConfig: CustomThemeData;
|
|
9
|
+
};
|
|
10
|
+
export declare const ThemeCreator: ({ themeConfig, onUpdateThemeConfig, presets }: ThemeCreatorProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Theme } from "@emotion/react";
|
|
2
|
+
export declare const styles: {
|
|
3
|
+
container: (theme: Theme) => {
|
|
4
|
+
color: string;
|
|
5
|
+
display: "flex";
|
|
6
|
+
flexDirection: "column";
|
|
7
|
+
flexGrow: number;
|
|
8
|
+
overflow: "hidden";
|
|
9
|
+
position: "relative";
|
|
10
|
+
};
|
|
11
|
+
content: (theme: Theme) => {
|
|
12
|
+
display: "flex";
|
|
13
|
+
flexDirection: "column";
|
|
14
|
+
gap: number;
|
|
15
|
+
padding: number;
|
|
16
|
+
};
|
|
17
|
+
copy: (theme: Theme) => {
|
|
18
|
+
backgroundColor: string;
|
|
19
|
+
borderRadius: string;
|
|
20
|
+
padding: number;
|
|
21
|
+
};
|
|
22
|
+
drawerHeader: (theme: Theme) => {
|
|
23
|
+
alignItems: "center";
|
|
24
|
+
display: "flex";
|
|
25
|
+
gap: number;
|
|
26
|
+
justifyContent: "end";
|
|
27
|
+
width: string;
|
|
28
|
+
};
|
|
29
|
+
drawerWrapper: {
|
|
30
|
+
display: "flex";
|
|
31
|
+
justifyContent: "space-between";
|
|
32
|
+
position: "relative";
|
|
33
|
+
};
|
|
34
|
+
header: {
|
|
35
|
+
alignItems: "center";
|
|
36
|
+
display: "flex";
|
|
37
|
+
justifyContent: "space-between";
|
|
38
|
+
};
|
|
39
|
+
popoverWrapper: (theme: Theme) => {
|
|
40
|
+
display: "flex";
|
|
41
|
+
flexDirection: "column";
|
|
42
|
+
gap: number;
|
|
43
|
+
};
|
|
44
|
+
pre: (theme: Theme) => {
|
|
45
|
+
backgroundColor: "#FFFFFF66";
|
|
46
|
+
borderRadius: string;
|
|
47
|
+
fontSize: string;
|
|
48
|
+
padding: number;
|
|
49
|
+
};
|
|
50
|
+
presetOption: (theme: Theme) => {
|
|
51
|
+
"&:hover": {
|
|
52
|
+
backgroundColor: string;
|
|
53
|
+
};
|
|
54
|
+
backgroundColor: "transparent";
|
|
55
|
+
borderRadius: string;
|
|
56
|
+
fontSize: string;
|
|
57
|
+
padding: number;
|
|
58
|
+
};
|
|
59
|
+
presetsButton: (theme: Theme) => {
|
|
60
|
+
"&:hover": {
|
|
61
|
+
backgroundColor: "#d1d4d7";
|
|
62
|
+
};
|
|
63
|
+
backgroundColor: string;
|
|
64
|
+
borderRadius: string;
|
|
65
|
+
cursor: "pointer";
|
|
66
|
+
display: "flex";
|
|
67
|
+
fontSize: string;
|
|
68
|
+
gap: number;
|
|
69
|
+
padding: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./typography-editor";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CustomComponentsVariables } from "@shipengine/giger-theme";
|
|
2
|
+
type TypographyEditorProps = {
|
|
3
|
+
formatKey: (key: string) => string;
|
|
4
|
+
onUpdateTypographyConfig: (typographyConfig: CustomComponentsVariables["Typography"]) => void;
|
|
5
|
+
typographyConfig: CustomComponentsVariables["Typography"];
|
|
6
|
+
};
|
|
7
|
+
export declare const TypographyEditor: ({ onUpdateTypographyConfig, typographyConfig, formatKey, }: TypographyEditorProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
package/src/components/templates/theme-creator/typography-editor/typography-editor.styles.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Theme } from "@emotion/react";
|
|
2
|
+
export declare const styles: {
|
|
3
|
+
input: (theme: Theme) => {
|
|
4
|
+
border: string;
|
|
5
|
+
borderRadius: string;
|
|
6
|
+
color: string;
|
|
7
|
+
fontSize: string;
|
|
8
|
+
maxWidth: number;
|
|
9
|
+
padding: number;
|
|
10
|
+
};
|
|
11
|
+
keys: {
|
|
12
|
+
fontSize: string;
|
|
13
|
+
fontWeight: "bold";
|
|
14
|
+
marginTop: string;
|
|
15
|
+
};
|
|
16
|
+
section: (theme: Theme) => {
|
|
17
|
+
"& > div:first-child": {
|
|
18
|
+
flexGrow: number;
|
|
19
|
+
};
|
|
20
|
+
"& > div:last-child": {
|
|
21
|
+
flexShrink: number;
|
|
22
|
+
};
|
|
23
|
+
display: "flex";
|
|
24
|
+
gap: number;
|
|
25
|
+
justifyContent: "space-between";
|
|
26
|
+
};
|
|
27
|
+
sectionContainer: (theme: Theme) => {
|
|
28
|
+
marginBottom: number;
|
|
29
|
+
};
|
|
30
|
+
select: (theme: Theme) => {
|
|
31
|
+
border: string;
|
|
32
|
+
borderRadius: string;
|
|
33
|
+
color: string;
|
|
34
|
+
fontSize: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
package/src/elements/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./account-settings";
|
|
|
2
2
|
export * from "./list-carriers";
|
|
3
3
|
export * from "./manage-warehouses";
|
|
4
4
|
export * from "./purchase-label";
|
|
5
|
+
export * from "./shipengine-workflow";
|
|
6
|
+
export * from "./theme-creator";
|
|
5
7
|
export * from "./view-shipment";
|
|
6
8
|
export * from "./void-label";
|
|
7
|
-
export * from "./shipengine-workflow";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from "react";
|
|
2
|
+
import { CustomThemeData } from "@shipengine/giger-theme";
|
|
3
|
+
export type ThemeCreatorContextValue = {
|
|
4
|
+
setThemeConfig: Dispatch<SetStateAction<CustomThemeData>>;
|
|
5
|
+
themeConfig: CustomThemeData;
|
|
6
|
+
};
|
|
7
|
+
export type ThemeCreatorProviderProps = {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
editableTheme: CustomThemeData;
|
|
10
|
+
};
|
|
11
|
+
export declare const ThemeCreatorProvider: ({ children, editableTheme, }: ThemeCreatorProviderProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const useThemeCreator: () => ThemeCreatorContextValue;
|