@hitachivantara/uikit-react-lab 5.1.0 → 5.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/dist/cjs/packages/lab/src/components/StepNavigation/StepNavigation.cjs +4 -4
- package/dist/cjs/packages/lab/src/components/StepNavigation/StepNavigation.cjs.map +1 -1
- package/dist/cjs/packages/lab/src/components/Wizard/Wizard.cjs +65 -0
- package/dist/cjs/packages/lab/src/components/Wizard/Wizard.cjs.map +1 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardActions/WizardActions.cjs +113 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardActions/WizardActions.cjs.map +1 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardActions/WizardActions.styles.cjs +28 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardActions/WizardActions.styles.cjs.map +1 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardActions/wizardActionsClasses.cjs +8 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardActions/wizardActionsClasses.cjs.map +1 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardContainer/WizardContainer.cjs +34 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardContainer/WizardContainer.cjs.map +1 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardContainer/WizardContainer.styles.cjs +15 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardContainer/WizardContainer.styles.cjs.map +1 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardContainer/wizardContainerClasses.cjs +8 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardContainer/wizardContainerClasses.cjs.map +1 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardContent/LoadingContainer.cjs +38 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardContent/LoadingContainer.cjs.map +1 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardContent/LoadingContainer.styles.cjs +21 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardContent/LoadingContainer.styles.cjs.map +1 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardContent/WizardContent.cjs +141 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardContent/WizardContent.cjs.map +1 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardContent/WizardContent.styles.cjs +37 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardContent/WizardContent.styles.cjs.map +1 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardContent/wizardContentClasses.cjs +8 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardContent/wizardContentClasses.cjs.map +1 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardContext/WizardContext.cjs +42 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardContext/WizardContext.cjs.map +1 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardTitle/WizardTitle.cjs +106 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardTitle/WizardTitle.cjs.map +1 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardTitle/WizardTitle.styles.cjs +33 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardTitle/WizardTitle.styles.cjs.map +1 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardTitle/wizardTitleClasses.cjs +8 -0
- package/dist/cjs/packages/lab/src/components/Wizard/WizardTitle/wizardTitleClasses.cjs.map +1 -0
- package/dist/cjs/packages/lab/src/components/Wizard/wizardClasses.cjs +8 -0
- package/dist/cjs/packages/lab/src/components/Wizard/wizardClasses.cjs.map +1 -0
- package/dist/cjs/packages/lab/src/index.cjs +14 -0
- package/dist/cjs/packages/lab/src/index.cjs.map +1 -1
- package/dist/esm/packages/lab/src/components/StepNavigation/StepNavigation.js +4 -4
- package/dist/esm/packages/lab/src/components/StepNavigation/StepNavigation.js.map +1 -1
- package/dist/esm/packages/lab/src/components/Wizard/Wizard.js +65 -0
- package/dist/esm/packages/lab/src/components/Wizard/Wizard.js.map +1 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardActions/WizardActions.js +113 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardActions/WizardActions.js.map +1 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardActions/WizardActions.styles.js +28 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardActions/WizardActions.styles.js.map +1 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardActions/wizardActionsClasses.js +8 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardActions/wizardActionsClasses.js.map +1 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardContainer/WizardContainer.js +34 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardContainer/WizardContainer.js.map +1 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardContainer/WizardContainer.styles.js +15 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardContainer/WizardContainer.styles.js.map +1 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardContainer/wizardContainerClasses.js +8 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardContainer/wizardContainerClasses.js.map +1 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardContent/LoadingContainer.js +38 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardContent/LoadingContainer.js.map +1 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardContent/LoadingContainer.styles.js +21 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardContent/LoadingContainer.styles.js.map +1 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardContent/WizardContent.js +139 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardContent/WizardContent.js.map +1 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardContent/WizardContent.styles.js +37 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardContent/WizardContent.styles.js.map +1 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardContent/wizardContentClasses.js +8 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardContent/wizardContentClasses.js.map +1 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardContext/WizardContext.js +42 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardContext/WizardContext.js.map +1 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardTitle/WizardTitle.js +106 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardTitle/WizardTitle.js.map +1 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardTitle/WizardTitle.styles.js +33 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardTitle/WizardTitle.styles.js.map +1 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardTitle/wizardTitleClasses.js +8 -0
- package/dist/esm/packages/lab/src/components/Wizard/WizardTitle/wizardTitleClasses.js.map +1 -0
- package/dist/esm/packages/lab/src/components/Wizard/wizardClasses.js +8 -0
- package/dist/esm/packages/lab/src/components/Wizard/wizardClasses.js.map +1 -0
- package/dist/esm/packages/lab/src/index.js +15 -1
- package/dist/esm/packages/lab/src/index.js.map +1 -1
- package/dist/types/index.d.ts +172 -1
- package/package.json +4 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wizardContentClasses.js","sources":["../../../../../../../../src/components/Wizard/WizardContent/wizardContentClasses.ts"],"sourcesContent":["import { getClasses } from \"@hitachivantara/uikit-react-core\";\n\nexport type HvWizardContentClasses = {\n /** Style applied to the Wizard content container. */\n contentContainer?: string;\n /** Style applied to the Wizard to fix its height. */\n fixedHeight?: string;\n /** Style applied to the summary container around the page content container. */\n summaryRef?: string;\n /** Style applied to the Summary container to stick it to the top. */\n summarySticky?: string;\n /** Style applied to the Summary container to position it on the right. */\n summaryContainer?: string;\n};\n\nconst classKeys: string[] = [\n \"contentContainer\",\n \"fixedHeight\",\n \"summaryRef\",\n \"summarySticky\",\n \"summaryContainer\",\n];\n\nconst wizardContentClasses = getClasses<HvWizardContentClasses>(\n classKeys,\n \"HvWizardContent\"\n);\n\nexport default wizardContentClasses;\n"],"names":["classKeys","wizardContentClasses","getClasses"],"mappings":";AAeA,MAAMA,YAAsB,CAC1B,oBACA,eACA,cACA,iBACA,kBAAkB;AAGpB,MAAMC,uBAAuBC,WAC3BF,WACA,iBAAiB;AAGnB,MAAA,yBAAeC;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createContext, useState, useCallback } from "react";
|
|
2
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
3
|
+
const HvWizardContext = createContext({
|
|
4
|
+
context: {},
|
|
5
|
+
updateContext: () => {
|
|
6
|
+
},
|
|
7
|
+
summary: void 0,
|
|
8
|
+
setSummary: ({}) => {
|
|
9
|
+
},
|
|
10
|
+
tab: 0,
|
|
11
|
+
setTab: () => {
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
const HvWizardProvider = ({
|
|
15
|
+
children
|
|
16
|
+
}) => {
|
|
17
|
+
const [context, setContext] = useState({});
|
|
18
|
+
const [summary, setSummary] = useState(void 0);
|
|
19
|
+
const [tab, setTab] = useState(0);
|
|
20
|
+
const updateContext = useCallback((newContext) => {
|
|
21
|
+
if (Object.entries(newContext).length > 0) {
|
|
22
|
+
setContext(newContext);
|
|
23
|
+
}
|
|
24
|
+
}, [setContext]);
|
|
25
|
+
return /* @__PURE__ */ jsx(HvWizardContext.Provider, {
|
|
26
|
+
value: {
|
|
27
|
+
context,
|
|
28
|
+
updateContext,
|
|
29
|
+
summary,
|
|
30
|
+
setSummary,
|
|
31
|
+
tab,
|
|
32
|
+
setTab
|
|
33
|
+
},
|
|
34
|
+
children
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
const WizardProvider = HvWizardProvider;
|
|
38
|
+
export {
|
|
39
|
+
HvWizardContext,
|
|
40
|
+
WizardProvider as default
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=WizardContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardContext.js","sources":["../../../../../../../../src/components/Wizard/WizardContext/WizardContext.tsx"],"sourcesContent":["import React, {\n createContext,\n useState,\n Dispatch,\n SetStateAction,\n useCallback,\n} from \"react\";\n\nexport type HvWizardTab = {\n name?: string;\n valid?: boolean;\n mustValidate?: boolean;\n touched?: boolean;\n form?: any;\n children?: React.ReactNode;\n};\n\nexport type HvWizardTabs<T extends HvWizardTab> = {\n [tab in number]?: T;\n};\n\ntype HvWizardContextProp = {\n context: HvWizardTabs<HvWizardTab>;\n updateContext: (values?: HvWizardTabs<HvWizardTab>) => void;\n summary: any;\n setSummary: (oldSummary?: any) => void;\n tab: any;\n setTab: Dispatch<SetStateAction<number>>;\n};\n\nexport const HvWizardContext = createContext<HvWizardContextProp>({\n context: {},\n updateContext: () => {},\n summary: undefined,\n setSummary: ({}) => {},\n tab: 0,\n setTab: () => {},\n});\n\nconst HvWizardProvider = ({ children }) => {\n const [context, setContext] = useState({});\n const [summary, setSummary] = useState(undefined);\n const [tab, setTab] = useState(0);\n\n const updateContext = useCallback(\n (newContext) => {\n if (Object.entries(newContext).length > 0) {\n setContext(newContext);\n }\n },\n [setContext]\n );\n\n return (\n <HvWizardContext.Provider\n value={{\n context,\n updateContext,\n summary,\n setSummary,\n tab,\n setTab,\n }}\n >\n {children}\n </HvWizardContext.Provider>\n );\n};\n\nexport default HvWizardProvider;\n"],"names":["HvWizardContext","createContext","context","updateContext","summary","undefined","setSummary","tab","setTab","HvWizardProvider","children","setContext","useState","useCallback","newContext","Object","entries","length","_jsx","Provider","value"],"mappings":";;AA8BO,MAAMA,kBAAkBC,cAAmC;AAAA,EAChEC,SAAS,CAAC;AAAA,EACVC,eAAeA,MAAM;AAAA,EAAC;AAAA,EACtBC,SAASC;AAAAA,EACTC,YAAYA,CAAC,CAAA,MAAO;AAAA,EAAC;AAAA,EACrBC,KAAK;AAAA,EACLC,QAAQA,MAAM;AAAA,EAAC;AACjB,CAAC;AAED,MAAMC,mBAAmBA,CAAC;AAAA,EAAEC;AAAS,MAAM;AACzC,QAAM,CAACR,SAASS,UAAU,IAAIC,SAAS,CAAE,CAAA;AACzC,QAAM,CAACR,SAASE,UAAU,IAAIM,SAASP,MAAS;AAChD,QAAM,CAACE,KAAKC,MAAM,IAAII,SAAS,CAAC;AAE1BT,QAAAA,gBAAgBU,YACnBC,CAAe,eAAA;AACd,QAAIC,OAAOC,QAAQF,UAAU,EAAEG,SAAS,GAAG;AACzCN,iBAAWG,UAAU;AAAA,IACvB;AAAA,EAAA,GAEF,CAACH,UAAU,CAAC;AAIZO,SAAAA,oBAAClB,gBAAgBmB,UAAQ;AAAA,IACvBC,OAAO;AAAA,MACLlB;AAAAA,MACAC;AAAAA,MACAC;AAAAA,MACAE;AAAAA,MACAC;AAAAA,MACAC;AAAAA,IACF;AAAA,IAAEE;AAAAA,EAAAA,CAGuB;AAE/B;AAEA,MAAA,iBAAeD;"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { ClassNames } from "@emotion/react";
|
|
2
|
+
import { HvDialogTitle, HvGrid, HvTypography, HvButton } from "@hitachivantara/uikit-react-core";
|
|
3
|
+
import { Report } from "@hitachivantara/uikit-react-icons";
|
|
4
|
+
import { clsx } from "../../../../../../node_modules/clsx/dist/clsx.m.js";
|
|
5
|
+
import wizardTitleClasses from "./wizardTitleClasses.js";
|
|
6
|
+
import { styles } from "./WizardTitle.styles.js";
|
|
7
|
+
import { useContext, useState, useEffect } from "react";
|
|
8
|
+
import { HvWizardContext } from "../WizardContext/WizardContext.js";
|
|
9
|
+
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
10
|
+
import { HvStepNavigation } from "../../StepNavigation/StepNavigation.js";
|
|
11
|
+
const switchTabState = (state, currentTab, index) => {
|
|
12
|
+
if (index === currentTab)
|
|
13
|
+
return "Current";
|
|
14
|
+
if (state.valid)
|
|
15
|
+
return "Completed";
|
|
16
|
+
if (state.valid === null)
|
|
17
|
+
return "Enabled";
|
|
18
|
+
if (state.touched && state.valid === false)
|
|
19
|
+
return "Failed";
|
|
20
|
+
return "Enabled";
|
|
21
|
+
};
|
|
22
|
+
const HvWizardTitle = ({
|
|
23
|
+
title,
|
|
24
|
+
hasSummary = false,
|
|
25
|
+
labels = {},
|
|
26
|
+
classes,
|
|
27
|
+
customStep = {}
|
|
28
|
+
}) => {
|
|
29
|
+
const {
|
|
30
|
+
context,
|
|
31
|
+
summary,
|
|
32
|
+
setSummary,
|
|
33
|
+
tab,
|
|
34
|
+
setTab
|
|
35
|
+
} = useContext(HvWizardContext);
|
|
36
|
+
const [steps, setSteps] = useState([]);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (summary === null && hasSummary) {
|
|
39
|
+
setSummary(false);
|
|
40
|
+
}
|
|
41
|
+
return () => {
|
|
42
|
+
setSummary(false);
|
|
43
|
+
};
|
|
44
|
+
}, []);
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
const contextArray = Object.entries(context);
|
|
47
|
+
if (contextArray.length) {
|
|
48
|
+
const updatedSteps = contextArray.map(([, childState], index) => {
|
|
49
|
+
return {
|
|
50
|
+
title: (childState == null ? void 0 : childState.name) ?? `${index + 1}`,
|
|
51
|
+
state: switchTabState(childState, tab, index),
|
|
52
|
+
onClick: () => setTab(index)
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
setSteps(updatedSteps);
|
|
56
|
+
}
|
|
57
|
+
}, [context, tab, setTab]);
|
|
58
|
+
const toggleSummary = () => {
|
|
59
|
+
setSummary((oldSummary) => !oldSummary);
|
|
60
|
+
};
|
|
61
|
+
return /* @__PURE__ */ jsx(ClassNames, {
|
|
62
|
+
children: ({
|
|
63
|
+
css
|
|
64
|
+
}) => /* @__PURE__ */ jsx(HvDialogTitle, {
|
|
65
|
+
className: clsx(classes == null ? void 0 : classes.headerContainer, wizardTitleClasses.headerContainer, css(styles.headerContainer)),
|
|
66
|
+
classes: {
|
|
67
|
+
messageContainer: clsx(classes == null ? void 0 : classes.messageContainer, wizardTitleClasses.messageContainer, css(styles.messageContainer))
|
|
68
|
+
},
|
|
69
|
+
children: /* @__PURE__ */ jsxs(HvGrid, {
|
|
70
|
+
container: true,
|
|
71
|
+
justifyContent: "space-between",
|
|
72
|
+
alignItems: "center",
|
|
73
|
+
className: clsx(classes == null ? void 0 : classes.titleContainer, wizardTitleClasses.titleContainer, css(styles.titleContainer)),
|
|
74
|
+
children: [title && /* @__PURE__ */ jsx(HvTypography, {
|
|
75
|
+
variant: "title3",
|
|
76
|
+
component: "h3",
|
|
77
|
+
children: title
|
|
78
|
+
}), !!steps.length && /* @__PURE__ */ jsx(HvStepNavigation, {
|
|
79
|
+
className: clsx(classes == null ? void 0 : classes.stepContainer, wizardTitleClasses.stepContainer, css(styles.stepContainer)),
|
|
80
|
+
steps,
|
|
81
|
+
type: (customStep == null ? void 0 : customStep.type) ?? "Default",
|
|
82
|
+
stepSize: (customStep == null ? void 0 : customStep.stepSize) ?? "xs",
|
|
83
|
+
width: (customStep == null ? void 0 : customStep.width) ?? {
|
|
84
|
+
xs: 200,
|
|
85
|
+
sm: 350,
|
|
86
|
+
md: 600,
|
|
87
|
+
lg: 800
|
|
88
|
+
}
|
|
89
|
+
}), hasSummary && /* @__PURE__ */ jsx(HvButton, {
|
|
90
|
+
variant: "secondarySubtle",
|
|
91
|
+
className: clsx(classes == null ? void 0 : classes.buttonWidth, wizardTitleClasses.buttonWidth, css(styles.buttonWidth)),
|
|
92
|
+
classes: {
|
|
93
|
+
root: clsx(classes == null ? void 0 : classes.rootSummaryButton, wizardTitleClasses.rootSummaryButton, css(styles.rootSummaryButton))
|
|
94
|
+
},
|
|
95
|
+
onClick: toggleSummary,
|
|
96
|
+
startIcon: /* @__PURE__ */ jsx(Report, {}),
|
|
97
|
+
children: `${labels.summary ?? "Summary"}`
|
|
98
|
+
})]
|
|
99
|
+
})
|
|
100
|
+
})
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
export {
|
|
104
|
+
HvWizardTitle
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=WizardTitle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardTitle.js","sources":["../../../../../../../../src/components/Wizard/WizardTitle/WizardTitle.tsx"],"sourcesContent":["import { ClassNames } from \"@emotion/react\";\nimport {\n HvBaseProps,\n HvButton,\n HvDialogTitle,\n HvGrid,\n HvTypography,\n} from \"@hitachivantara/uikit-react-core\";\nimport { Report } from \"@hitachivantara/uikit-react-icons\";\nimport { clsx } from \"clsx\";\nimport wizardTitleClasses, { HvWizardTitleClasses } from \"./wizardTitleClasses\";\nimport { styles } from \"./WizardTitle.styles\";\nimport { HvStepNavigation, HvStepNavigationProps } from \"../..\";\nimport { useContext, useEffect, useState } from \"react\";\nimport { HvWizardContext } from \"../WizardContext/WizardContext\";\nimport { HvStepProps } from \"components/StepNavigation/DefaultNavigation/Step/Step\";\n\nexport interface HvWizardTitleProps extends HvBaseProps {\n /** Title for the wizard. */\n title?: string;\n /** Shows the summary button. */\n hasSummary?: boolean;\n /** An object containing all the labels for the wizard header. */\n labels?: {\n /** Summary button label. */\n summary?: string;\n };\n /** Custom object to define type, size and width of the StepNavigation component */\n customStep?: Pick<HvStepNavigationProps, \"type\" | \"stepSize\" | \"width\">;\n /** A Jss Object used to override or extend the styles applied to the empty state Wizard. */\n classes?: HvWizardTitleClasses;\n}\n\nconst switchTabState = (state, currentTab, index) => {\n if (index === currentTab) return \"Current\";\n if (state.valid) return \"Completed\";\n if (state.valid === null) return \"Enabled\";\n if (state.touched && state.valid === false) return \"Failed\";\n // \"Disabled\"\n // \"Pending\"\n return \"Enabled\";\n};\n\nexport const HvWizardTitle = ({\n title,\n hasSummary = false,\n labels = {},\n classes,\n customStep = {},\n}: HvWizardTitleProps) => {\n const { context, summary, setSummary, tab, setTab } =\n useContext(HvWizardContext);\n\n const [steps, setSteps] = useState<HvStepProps[]>([]);\n\n useEffect(() => {\n if (summary === null && hasSummary) {\n setSummary(false);\n }\n\n return () => {\n setSummary(false);\n };\n }, []);\n\n useEffect(() => {\n const contextArray = Object.entries(context);\n\n if (contextArray.length) {\n const updatedSteps: HvStepProps[] = contextArray.map(\n ([, childState], index) => {\n return {\n title: childState?.name ?? `${index + 1}`,\n state: switchTabState(childState, tab, index),\n onClick: () => setTab(index),\n };\n }\n );\n\n setSteps(updatedSteps);\n }\n }, [context, tab, setTab]);\n\n const toggleSummary = () => {\n setSummary((oldSummary) => !oldSummary);\n };\n\n return (\n <ClassNames>\n {({ css }) => (\n <HvDialogTitle\n className={clsx(\n classes?.headerContainer,\n wizardTitleClasses.headerContainer,\n css(styles.headerContainer)\n )}\n classes={{\n messageContainer: clsx(\n classes?.messageContainer,\n wizardTitleClasses.messageContainer,\n css(styles.messageContainer)\n ),\n }}\n >\n <HvGrid\n container\n justifyContent=\"space-between\"\n alignItems=\"center\"\n className={clsx(\n classes?.titleContainer,\n wizardTitleClasses.titleContainer,\n css(styles.titleContainer)\n )}\n >\n {title && (\n <HvTypography variant=\"title3\" component=\"h3\">\n {title}\n </HvTypography>\n )}\n {!!steps.length && (\n <HvStepNavigation\n className={clsx(\n classes?.stepContainer,\n wizardTitleClasses.stepContainer,\n css(styles.stepContainer)\n )}\n steps={steps}\n type={customStep?.type ?? \"Default\"}\n stepSize={customStep?.stepSize ?? \"xs\"}\n width={\n customStep?.width ?? { xs: 200, sm: 350, md: 600, lg: 800 }\n }\n />\n )}\n {hasSummary && (\n <HvButton\n variant=\"secondarySubtle\"\n className={clsx(\n classes?.buttonWidth,\n wizardTitleClasses.buttonWidth,\n css(styles.buttonWidth)\n )}\n classes={{\n root: clsx(\n classes?.rootSummaryButton,\n wizardTitleClasses.rootSummaryButton,\n css(styles.rootSummaryButton)\n ),\n }}\n onClick={toggleSummary}\n startIcon={<Report />}\n >\n {`${labels.summary ?? \"Summary\"}`}\n </HvButton>\n )}\n </HvGrid>\n </HvDialogTitle>\n )}\n </ClassNames>\n );\n};\n"],"names":["switchTabState","state","currentTab","index","valid","touched","HvWizardTitle","title","hasSummary","labels","classes","customStep","context","summary","setSummary","tab","setTab","useContext","HvWizardContext","steps","setSteps","useState","useEffect","contextArray","Object","entries","length","updatedSteps","map","childState","name","onClick","toggleSummary","oldSummary","ClassNames","children","css","HvDialogTitle","className","clsx","headerContainer","wizardTitleClasses","styles","messageContainer","HvGrid","container","justifyContent","alignItems","titleContainer","_jsx","HvTypography","variant","component","HvStepNavigation","stepContainer","type","stepSize","width","xs","sm","md","lg","HvButton","buttonWidth","root","rootSummaryButton","startIcon","Report"],"mappings":"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"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { theme } from "@hitachivantara/uikit-react-core";
|
|
2
|
+
const styles = {
|
|
3
|
+
messageContainer: {
|
|
4
|
+
"& > div": {
|
|
5
|
+
width: "100%"
|
|
6
|
+
}
|
|
7
|
+
},
|
|
8
|
+
titleContainer: {
|
|
9
|
+
margin: 0,
|
|
10
|
+
width: "100%"
|
|
11
|
+
},
|
|
12
|
+
buttonWidth: {
|
|
13
|
+
width: 120
|
|
14
|
+
},
|
|
15
|
+
rootSummaryButton: {
|
|
16
|
+
paddingRight: 18
|
|
17
|
+
},
|
|
18
|
+
headerContainer: {
|
|
19
|
+
backgroundColor: theme.colors.atmo2,
|
|
20
|
+
"& h6": {
|
|
21
|
+
fontSize: "16px",
|
|
22
|
+
fontWeight: "bold",
|
|
23
|
+
letterSpacing: 0
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
stepContainer: {
|
|
27
|
+
margin: "auto"
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
styles
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=WizardTitle.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardTitle.styles.js","sources":["../../../../../../../../src/components/Wizard/WizardTitle/WizardTitle.styles.tsx"],"sourcesContent":["import { CSSInterpolation } from \"@emotion/serialize\";\nimport { theme } from \"@hitachivantara/uikit-react-core\";\n\nexport const styles: { [key: string]: CSSInterpolation } = {\n messageContainer: {\n \"& > div\": {\n width: \"100%\",\n },\n },\n titleContainer: {\n margin: 0,\n width: \"100%\",\n },\n buttonWidth: {\n width: 120,\n },\n rootSummaryButton: {\n paddingRight: 18,\n },\n headerContainer: {\n backgroundColor: theme.colors.atmo2,\n \"& h6\": {\n fontSize: \"16px\",\n fontWeight: \"bold\",\n letterSpacing: 0,\n },\n },\n stepContainer: {\n margin: \"auto\",\n },\n};\n"],"names":["styles","messageContainer","width","titleContainer","margin","buttonWidth","rootSummaryButton","paddingRight","headerContainer","backgroundColor","theme","colors","atmo2","fontSize","fontWeight","letterSpacing","stepContainer"],"mappings":";AAGO,MAAMA,SAA8C;AAAA,EACzDC,kBAAkB;AAAA,IAChB,WAAW;AAAA,MACTC,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EACAC,gBAAgB;AAAA,IACdC,QAAQ;AAAA,IACRF,OAAO;AAAA,EACT;AAAA,EACAG,aAAa;AAAA,IACXH,OAAO;AAAA,EACT;AAAA,EACAI,mBAAmB;AAAA,IACjBC,cAAc;AAAA,EAChB;AAAA,EACAC,iBAAiB;AAAA,IACfC,iBAAiBC,MAAMC,OAAOC;AAAAA,IAC9B,QAAQ;AAAA,MACNC,UAAU;AAAA,MACVC,YAAY;AAAA,MACZC,eAAe;AAAA,IACjB;AAAA,EACF;AAAA,EACAC,eAAe;AAAA,IACbZ,QAAQ;AAAA,EACV;AACF;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { getClasses } from "@hitachivantara/uikit-react-core";
|
|
2
|
+
const classKeys = ["headerContainer", "messageContainer", "titleContainer", "buttonWidth", "rootSummaryButton", "stepContainer"];
|
|
3
|
+
const wizardTitleClasses = getClasses(classKeys, "HvWizardTitle");
|
|
4
|
+
const wizardTitleClasses$1 = wizardTitleClasses;
|
|
5
|
+
export {
|
|
6
|
+
wizardTitleClasses$1 as default
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=wizardTitleClasses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wizardTitleClasses.js","sources":["../../../../../../../../src/components/Wizard/WizardTitle/wizardTitleClasses.ts"],"sourcesContent":["import { getClasses } from \"@hitachivantara/uikit-react-core\";\n\nexport type HvWizardTitleClasses = {\n /** Styles applied to the header container. */\n headerContainer?: string;\n /** Styles applied to override the Dialog Title styles. */\n messageContainer?: string;\n /** Styles applied to the header content container. */\n titleContainer?: string;\n /** Styles applied to the Button component to override its width. */\n buttonWidth?: string;\n /** Styles applied to the Button component to override its right padding. */\n rootSummaryButton?: string;\n /** Styles applies to the step container. */\n stepContainer?: string;\n};\n\nconst classKeys: string[] = [\n \"headerContainer\",\n \"messageContainer\",\n \"titleContainer\",\n \"buttonWidth\",\n \"rootSummaryButton\",\n \"stepContainer\",\n];\n\nconst wizardTitleClasses = getClasses<HvWizardTitleClasses>(\n classKeys,\n \"HvWizardTitle\"\n);\n\nexport default wizardTitleClasses;\n"],"names":["classKeys","wizardTitleClasses","getClasses"],"mappings":";AAiBA,MAAMA,YAAsB,CAC1B,mBACA,oBACA,kBACA,eACA,qBACA,eAAe;AAGjB,MAAMC,qBAAqBC,WACzBF,WACA,eAAe;AAGjB,MAAA,uBAAeC;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { getClasses } from "@hitachivantara/uikit-react-core";
|
|
2
|
+
const classKeys = ["root"];
|
|
3
|
+
const wizardClasses = getClasses(classKeys, "HvWizard");
|
|
4
|
+
const wizardClasses$1 = wizardClasses;
|
|
5
|
+
export {
|
|
6
|
+
wizardClasses$1 as default
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=wizardClasses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wizardClasses.js","sources":["../../../../../../../src/components/Wizard/wizardClasses.ts"],"sourcesContent":["import { getClasses } from \"@hitachivantara/uikit-react-core\";\n\nexport type HvWizardClasses = {\n /** Styles applied to the component root class. */\n root?: string;\n};\n\nconst classKeys: string[] = [\"root\"];\n\nconst wizardClasses = getClasses<HvWizardClasses>(classKeys, \"HvWizard\");\n\nexport default wizardClasses;\n"],"names":["classKeys","wizardClasses","getClasses"],"mappings":";AAOA,MAAMA,YAAsB,CAAC,MAAM;AAEnC,MAAMC,gBAAgBC,WAA4BF,WAAW,UAAU;AAEvE,MAAA,kBAAeC;"}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
|
+
import { default as default2 } from "./components/StepNavigation/stepNavigationClasses.js";
|
|
1
2
|
import { HvStepNavigation } from "./components/StepNavigation/StepNavigation.js";
|
|
3
|
+
import { default as default3 } from "./components/Wizard/wizardClasses.js";
|
|
4
|
+
import { HvWizardContainer } from "./components/Wizard/WizardContainer/WizardContainer.js";
|
|
5
|
+
import { HvWizardTitle } from "./components/Wizard/WizardTitle/WizardTitle.js";
|
|
6
|
+
import { HvWizardContent } from "./components/Wizard/WizardContent/WizardContent.js";
|
|
7
|
+
import { HvWizardActions } from "./components/Wizard/WizardActions/WizardActions.js";
|
|
8
|
+
import { HvWizard } from "./components/Wizard/Wizard.js";
|
|
2
9
|
export {
|
|
3
|
-
HvStepNavigation
|
|
10
|
+
HvStepNavigation,
|
|
11
|
+
HvWizard,
|
|
12
|
+
HvWizardActions,
|
|
13
|
+
HvWizardContainer,
|
|
14
|
+
HvWizardContent,
|
|
15
|
+
HvWizardTitle,
|
|
16
|
+
default2 as stepNavigationClasses,
|
|
17
|
+
default3 as wizardClasses
|
|
4
18
|
};
|
|
5
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { HvBaseProps } from '@hitachivantara/uikit-react-core';
|
|
|
3
3
|
import { HvBreakpoints } from '@hitachivantara/uikit-react-core';
|
|
4
4
|
import { HvButtonProps } from '@hitachivantara/uikit-react-core';
|
|
5
5
|
import type { JSX as JSX_2 } from '@emotion/react/jsx-runtime';
|
|
6
|
+
import { ModalProps } from '@mui/material';
|
|
7
|
+
import { default as React_2 } from 'react';
|
|
6
8
|
|
|
7
9
|
declare interface HvStepClasses {
|
|
8
10
|
/** Styles applied to the component root class. */
|
|
@@ -52,7 +54,7 @@ declare interface HvStepClasses {
|
|
|
52
54
|
*/
|
|
53
55
|
export declare const HvStepNavigation: ({ className, classes, width, steps, stepSize, showTitles, type, ...others }: HvStepNavigationProps) => JSX_2.Element;
|
|
54
56
|
|
|
55
|
-
declare interface HvStepNavigationClasses {
|
|
57
|
+
export declare interface HvStepNavigationClasses {
|
|
56
58
|
/** Styles applied to the component root class. */
|
|
57
59
|
root?: string;
|
|
58
60
|
/** Styles applied to the title element. */
|
|
@@ -105,4 +107,173 @@ declare interface HvStepProps extends Pick<HvButtonProps, "onClick">, Omit<HvBas
|
|
|
105
107
|
disabled?: boolean;
|
|
106
108
|
}
|
|
107
109
|
|
|
110
|
+
export declare const HvWizard: ({ className, children, onClose, handleSubmit, title, open, skippable, loading, hasSummary, summaryContent, labels, fixedHeight, customStep, ...others }: HvWizardProps) => JSX_2.Element;
|
|
111
|
+
|
|
112
|
+
export declare const HvWizardActions: ({ classes, handleClose, handleSubmit, loading, skippable, labels, }: HvWizardActionsProps) => JSX_2.Element;
|
|
113
|
+
|
|
114
|
+
declare type HvWizardActionsClasses = {
|
|
115
|
+
/** Styles applied to the component which contains the groups of buttons. */
|
|
116
|
+
actionsContainer?: string;
|
|
117
|
+
/** Styles applied to the component which contains the buttons. */
|
|
118
|
+
buttonsContainer?: string;
|
|
119
|
+
/** Styles applied to the Button component to override its width. */
|
|
120
|
+
buttonWidth?: string;
|
|
121
|
+
/** Styles applied to some Button components to override its left padding. */
|
|
122
|
+
buttonSpacing?: string;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
declare interface HvWizardActionsProps extends HvBaseProps {
|
|
126
|
+
/** Function to handle the cancel button. */
|
|
127
|
+
handleClose: (event: React.SyntheticEvent, reason?: "escapeKeyDown" | "backdropClick") => void;
|
|
128
|
+
/** Function to handle the submit button. Also sends the current context state. */
|
|
129
|
+
handleSubmit: (context: any) => void;
|
|
130
|
+
/** An object containing all the labels for the wizard actions component. */
|
|
131
|
+
labels?: {
|
|
132
|
+
/** Cancel button label. */
|
|
133
|
+
cancel?: string;
|
|
134
|
+
/** Skip button label. */
|
|
135
|
+
skip?: string;
|
|
136
|
+
/** Previous button label. */
|
|
137
|
+
previous?: string;
|
|
138
|
+
/** Next button label. */
|
|
139
|
+
next?: string;
|
|
140
|
+
/** Submit button label. */
|
|
141
|
+
submit?: string;
|
|
142
|
+
};
|
|
143
|
+
/** Whether the submit button is disabled. */
|
|
144
|
+
loading?: boolean;
|
|
145
|
+
/** Enables the skip button. */
|
|
146
|
+
skippable?: boolean;
|
|
147
|
+
/** A Jss Object used to override or extend the styles applied to the empty state Wizard. */
|
|
148
|
+
classes?: HvWizardActionsClasses;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export declare type HvWizardClasses = {
|
|
152
|
+
/** Styles applied to the component root class. */
|
|
153
|
+
root?: string;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export declare const HvWizardContainer: ({ classes, className, children, handleClose, open, ...others }: HvWizardContainerProps) => JSX_2.Element;
|
|
157
|
+
|
|
158
|
+
declare type HvWizardContainerClasses = {
|
|
159
|
+
/** Styles applied to the component root class. */
|
|
160
|
+
root?: string;
|
|
161
|
+
/** Style applied to the component (root). */
|
|
162
|
+
paper?: string;
|
|
163
|
+
/** Style applied to the close button. */
|
|
164
|
+
closeButton?: string;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
declare interface HvWizardContainerProps extends Omit<HvBaseProps, "onClose"> {
|
|
168
|
+
/** Current state of the Wizard. */
|
|
169
|
+
open: boolean;
|
|
170
|
+
/** Function executed on close. */
|
|
171
|
+
handleClose: (event: React_2.SyntheticEvent, reason?: "escapeKeyDown" | "backdropClick") => void;
|
|
172
|
+
/** A Jss Object used to override or extend the styles applied to the empty state Wizard. */
|
|
173
|
+
classes?: HvWizardContainerClasses;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export declare const HvWizardContent: ({ classes, fixedHeight, loading, children, summaryContent, }: HvWizardContentProps) => JSX_2.Element;
|
|
177
|
+
|
|
178
|
+
declare type HvWizardContentClasses = {
|
|
179
|
+
/** Style applied to the Wizard content container. */
|
|
180
|
+
contentContainer?: string;
|
|
181
|
+
/** Style applied to the Wizard to fix its height. */
|
|
182
|
+
fixedHeight?: string;
|
|
183
|
+
/** Style applied to the summary container around the page content container. */
|
|
184
|
+
summaryRef?: string;
|
|
185
|
+
/** Style applied to the Summary container to stick it to the top. */
|
|
186
|
+
summarySticky?: string;
|
|
187
|
+
/** Style applied to the Summary container to position it on the right. */
|
|
188
|
+
summaryContainer?: string;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
declare interface HvWizardContentProps extends HvBaseProps {
|
|
192
|
+
/** Forces minimum height to the component. */
|
|
193
|
+
fixedHeight?: boolean;
|
|
194
|
+
/** Whether the loading animation is shown. */
|
|
195
|
+
loading?: boolean;
|
|
196
|
+
/** The content of the summary. */
|
|
197
|
+
summaryContent?: React_2.ReactNode;
|
|
198
|
+
/** A Jss Object used to override or extend the styles applied to the empty state Wizard. */
|
|
199
|
+
classes?: HvWizardContentClasses;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export declare interface HvWizardProps extends HvBaseProps {
|
|
203
|
+
/** Current state of the Wizard. */
|
|
204
|
+
open: boolean;
|
|
205
|
+
/** Function executed on close. */
|
|
206
|
+
onClose: ModalProps["onClose"];
|
|
207
|
+
/** Function executed on submit. */
|
|
208
|
+
handleSubmit: (context: HvWizardTabs<HvWizardTab>) => void;
|
|
209
|
+
/** Title for the wizard. */
|
|
210
|
+
title?: string;
|
|
211
|
+
/** An object containing all the labels for the wizard. */
|
|
212
|
+
labels?: HvWizardActionsProps["labels"] & HvWizardTitleProps["labels"];
|
|
213
|
+
/** Shows the summary button. */
|
|
214
|
+
hasSummary?: boolean;
|
|
215
|
+
/** The content of the summary. */
|
|
216
|
+
summaryContent?: React_2.ReactNode;
|
|
217
|
+
/** Enables the skip button. */
|
|
218
|
+
skippable?: boolean;
|
|
219
|
+
/** Forces minimum height to the component. */
|
|
220
|
+
fixedHeight?: boolean;
|
|
221
|
+
/** Whether the loading animation is shown. */
|
|
222
|
+
loading?: boolean;
|
|
223
|
+
/** Custom object to define type, size and width of the StepNavigation component */
|
|
224
|
+
customStep?: Pick<HvStepNavigationProps, "type" | "stepSize" | "width">;
|
|
225
|
+
/** A Jss Object used to override or extend the styles applied to the empty state Wizard. */
|
|
226
|
+
classes?: HvWizardClasses;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
declare type HvWizardTab = {
|
|
230
|
+
name?: string;
|
|
231
|
+
valid?: boolean;
|
|
232
|
+
mustValidate?: boolean;
|
|
233
|
+
touched?: boolean;
|
|
234
|
+
form?: any;
|
|
235
|
+
children?: React_2.ReactNode;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
declare type HvWizardTabs<T extends HvWizardTab> = {
|
|
239
|
+
[tab in number]?: T;
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
export declare const HvWizardTitle: ({ title, hasSummary, labels, classes, customStep, }: HvWizardTitleProps) => JSX_2.Element;
|
|
243
|
+
|
|
244
|
+
declare type HvWizardTitleClasses = {
|
|
245
|
+
/** Styles applied to the header container. */
|
|
246
|
+
headerContainer?: string;
|
|
247
|
+
/** Styles applied to override the Dialog Title styles. */
|
|
248
|
+
messageContainer?: string;
|
|
249
|
+
/** Styles applied to the header content container. */
|
|
250
|
+
titleContainer?: string;
|
|
251
|
+
/** Styles applied to the Button component to override its width. */
|
|
252
|
+
buttonWidth?: string;
|
|
253
|
+
/** Styles applied to the Button component to override its right padding. */
|
|
254
|
+
rootSummaryButton?: string;
|
|
255
|
+
/** Styles applies to the step container. */
|
|
256
|
+
stepContainer?: string;
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
declare interface HvWizardTitleProps extends HvBaseProps {
|
|
260
|
+
/** Title for the wizard. */
|
|
261
|
+
title?: string;
|
|
262
|
+
/** Shows the summary button. */
|
|
263
|
+
hasSummary?: boolean;
|
|
264
|
+
/** An object containing all the labels for the wizard header. */
|
|
265
|
+
labels?: {
|
|
266
|
+
/** Summary button label. */
|
|
267
|
+
summary?: string;
|
|
268
|
+
};
|
|
269
|
+
/** Custom object to define type, size and width of the StepNavigation component */
|
|
270
|
+
customStep?: Pick<HvStepNavigationProps, "type" | "stepSize" | "width">;
|
|
271
|
+
/** A Jss Object used to override or extend the styles applied to the empty state Wizard. */
|
|
272
|
+
classes?: HvWizardTitleClasses;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export declare const stepNavigationClasses: HvStepNavigationClasses;
|
|
276
|
+
|
|
277
|
+
export declare const wizardClasses: HvWizardClasses;
|
|
278
|
+
|
|
108
279
|
export { }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hitachivantara/uikit-react-lab",
|
|
3
|
-
"version": "5.1
|
|
3
|
+
"version": "5.2.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Hitachi Vantara UI Kit Team",
|
|
6
6
|
"description": "Contributed React components for the NEXT UI Kit.",
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@emotion/cache": "^11.10.5",
|
|
33
|
-
"@hitachivantara/uikit-react-core": "^5.
|
|
33
|
+
"@hitachivantara/uikit-react-core": "^5.4.0",
|
|
34
|
+
"usehooks-ts": "^2.9.1"
|
|
34
35
|
},
|
|
35
36
|
"files": [
|
|
36
37
|
"dist"
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
"access": "public",
|
|
40
41
|
"directory": "package"
|
|
41
42
|
},
|
|
42
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "6a771d68070e4bfb03ca573900704d35934c0573",
|
|
43
44
|
"main": "dist/cjs/index.cjs",
|
|
44
45
|
"exports": {
|
|
45
46
|
".": {
|