@fixefy/fixefy-ui-components 0.2.18 → 0.2.20

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.
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ declare const FxWizard: ({ config, footer }: {
3
+ config: any;
4
+ footer: any;
5
+ }) => React.JSX.Element;
6
+ export default FxWizard;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _default;
9
+ }
10
+ });
11
+ const _jsxruntime = require("react/jsx-runtime");
12
+ const _react = /*#__PURE__*/ _interop_require_default(require("react"));
13
+ const _reactusewizard = require("react-use-wizard");
14
+ function _interop_require_default(obj) {
15
+ return obj && obj.__esModule ? obj : {
16
+ default: obj
17
+ };
18
+ }
19
+ const FxWizard = ({ config, footer })=>{
20
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactusewizard.Wizard, {
21
+ footer: footer,
22
+ children: config === null || config === void 0 ? void 0 : config.steps.map((step, i)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(WizardStepWrapper, {
23
+ props: step,
24
+ Component: step.component
25
+ }, i))
26
+ });
27
+ };
28
+ const WizardStepWrapper = ({ Component, props })=>{
29
+ console.log('WizardStepWrapper', JSON.stringify(props));
30
+ const { goToStep, isLastStep } = (0, _reactusewizard.useWizard)();
31
+ const handleNext = ()=>{
32
+ if (!isLastStep) {
33
+ goToStep(props.nextStepPath);
34
+ } else {
35
+ console.log('Reached the final step');
36
+ }
37
+ };
38
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(Component, {
39
+ onHandleNext: handleNext
40
+ });
41
+ };
42
+ const _default = FxWizard;
@@ -0,0 +1,2 @@
1
+ export * from './FxWizard';
2
+ export * from './utils';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ _export_star(require("./FxWizard"), exports);
6
+ _export_star(require("./utils"), exports);
7
+ function _export_star(from, to) {
8
+ Object.keys(from).forEach(function(k) {
9
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
10
+ Object.defineProperty(to, k, {
11
+ enumerable: true,
12
+ get: function() {
13
+ return from[k];
14
+ }
15
+ });
16
+ }
17
+ });
18
+ return from;
19
+ }
@@ -0,0 +1 @@
1
+ export declare const getEnvSuffix: () => string;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "getEnvSuffix", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return getEnvSuffix;
9
+ }
10
+ });
11
+ const getEnvSuffix = ()=>{
12
+ let rv;
13
+ switch(process.env.NEXT_PUBLIC_NODE_ENV){
14
+ case 'prod':
15
+ case 'production':
16
+ rv = '';
17
+ break;
18
+ case 'stage':
19
+ {
20
+ rv = '-stage';
21
+ break;
22
+ }
23
+ case 'dev':
24
+ case 'development':
25
+ rv = '-dev';
26
+ break;
27
+ case 'test':
28
+ rv = `-${process.env.NEXT_PUBLIC_NODE_ENV || ''}`;
29
+ break;
30
+ default:
31
+ rv = '-dev';
32
+ break;
33
+ }
34
+ return rv;
35
+ };
@@ -0,0 +1 @@
1
+ export * from './envHelpers';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ _export_star(require("./envHelpers"), exports);
6
+ function _export_star(from, to) {
7
+ Object.keys(from).forEach(function(k) {
8
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
9
+ Object.defineProperty(to, k, {
10
+ enumerable: true,
11
+ get: function() {
12
+ return from[k];
13
+ }
14
+ });
15
+ }
16
+ });
17
+ return from;
18
+ }
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export declare const FxWizard: ({ config, footer }: {
3
+ config: any;
4
+ footer: any;
5
+ }) => React.JSX.Element;
6
+ export default FxWizard;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ FxWizard: function() {
13
+ return FxWizard;
14
+ },
15
+ default: function() {
16
+ return _default;
17
+ }
18
+ });
19
+ const _jsxruntime = require("react/jsx-runtime");
20
+ const _react = /*#__PURE__*/ _interop_require_default(require("react"));
21
+ const _reactusewizard = require("react-use-wizard");
22
+ function _interop_require_default(obj) {
23
+ return obj && obj.__esModule ? obj : {
24
+ default: obj
25
+ };
26
+ }
27
+ const FxWizard = ({ config, footer })=>{
28
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactusewizard.Wizard, {
29
+ footer: footer,
30
+ children: config === null || config === void 0 ? void 0 : config.steps.map((step, i)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(WizardStepWrapper, {
31
+ props: step,
32
+ Component: step.component
33
+ }, i))
34
+ });
35
+ };
36
+ const WizardStepWrapper = ({ Component, props })=>{
37
+ console.log('WizardStepWrapper', JSON.stringify(props));
38
+ const { goToStep, isLastStep } = (0, _reactusewizard.useWizard)();
39
+ const handleNext = ()=>{
40
+ if (!isLastStep) {
41
+ goToStep(props.nextStepPath);
42
+ } else {
43
+ console.log('Reached the final step');
44
+ }
45
+ };
46
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(Component, {
47
+ onHandleNext: handleNext
48
+ });
49
+ };
50
+ const _default = FxWizard;
@@ -0,0 +1,2 @@
1
+ export * from './FxWizard';
2
+ export * from './steps launcher';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ _export_star(require("./FxWizard"), exports);
6
+ _export_star(require("./steps launcher"), exports);
7
+ function _export_star(from, to) {
8
+ Object.keys(from).forEach(function(k) {
9
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
10
+ Object.defineProperty(to, k, {
11
+ enumerable: true,
12
+ get: function() {
13
+ return from[k];
14
+ }
15
+ });
16
+ }
17
+ });
18
+ return from;
19
+ }
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export declare function getServerSideProps(context: any): Promise<{
3
+ props?: {
4
+ step: any;
5
+ pathname: string;
6
+ } | undefined;
7
+ }>;
8
+ declare const steps: (props: any) => React.JSX.Element;
9
+ export default steps;
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ default: function() {
13
+ return _default;
14
+ },
15
+ getServerSideProps: function() {
16
+ return getServerSideProps;
17
+ }
18
+ });
19
+ const _jsxruntime = require("react/jsx-runtime");
20
+ const _react = /*#__PURE__*/ _interop_require_default(require("react"));
21
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
22
+ try {
23
+ var info = gen[key](arg);
24
+ var value = info.value;
25
+ } catch (error) {
26
+ reject(error);
27
+ return;
28
+ }
29
+ if (info.done) {
30
+ resolve(value);
31
+ } else {
32
+ Promise.resolve(value).then(_next, _throw);
33
+ }
34
+ }
35
+ function _async_to_generator(fn) {
36
+ return function() {
37
+ var self = this, args = arguments;
38
+ return new Promise(function(resolve, reject) {
39
+ var gen = fn.apply(self, args);
40
+ function _next(value) {
41
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
42
+ }
43
+ function _throw(err) {
44
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
45
+ }
46
+ _next(undefined);
47
+ });
48
+ };
49
+ }
50
+ function _define_property(obj, key, value) {
51
+ if (key in obj) {
52
+ Object.defineProperty(obj, key, {
53
+ value: value,
54
+ enumerable: true,
55
+ configurable: true,
56
+ writable: true
57
+ });
58
+ } else {
59
+ obj[key] = value;
60
+ }
61
+ return obj;
62
+ }
63
+ function _interop_require_default(obj) {
64
+ return obj && obj.__esModule ? obj : {
65
+ default: obj
66
+ };
67
+ }
68
+ function _object_spread(target) {
69
+ for(var i = 1; i < arguments.length; i++){
70
+ var source = arguments[i] != null ? arguments[i] : {};
71
+ var ownKeys = Object.keys(source);
72
+ if (typeof Object.getOwnPropertySymbols === "function") {
73
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
74
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
75
+ }));
76
+ }
77
+ ownKeys.forEach(function(key) {
78
+ _define_property(target, key, source[key]);
79
+ });
80
+ }
81
+ return target;
82
+ }
83
+ // import { getServerSideProps as serverProps } from '@lib/serverProps'
84
+ const Step = ()=>{
85
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
86
+ children: "Step"
87
+ });
88
+ };
89
+ function getServerSideProps(context) {
90
+ return _getServerSideProps.apply(this, arguments);
91
+ }
92
+ function _getServerSideProps() {
93
+ _getServerSideProps = _async_to_generator(function*(context) {
94
+ const { query } = context;
95
+ let rv;
96
+ if (query) {
97
+ const { step, wizardId } = query;
98
+ rv = {
99
+ props: {
100
+ step,
101
+ pathname: `.../${wizardId}/steps/${step}`
102
+ }
103
+ };
104
+ }
105
+ return _object_spread({}, rv);
106
+ });
107
+ return _getServerSideProps.apply(this, arguments);
108
+ }
109
+ const steps = (props)=>{
110
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(Step, _object_spread({}, props));
111
+ };
112
+ const _default = steps;
@@ -0,0 +1 @@
1
+ export * from './[step]';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ _export_star(require("./[step]"), exports);
6
+ function _export_star(from, to) {
7
+ Object.keys(from).forEach(function(k) {
8
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
9
+ Object.defineProperty(to, k, {
10
+ enumerable: true,
11
+ get: function() {
12
+ return from[k];
13
+ }
14
+ });
15
+ }
16
+ });
17
+ return from;
18
+ }
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const StepsLauncher: (steps: any, footer: any) => React.JSX.Element;
3
+ export default StepsLauncher;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ StepsLauncher: function() {
13
+ return StepsLauncher;
14
+ },
15
+ default: function() {
16
+ return _default;
17
+ }
18
+ });
19
+ const _jsxruntime = require("react/jsx-runtime");
20
+ const _react = /*#__PURE__*/ _interop_require_default(require("react"));
21
+ const _FxWizard = /*#__PURE__*/ _interop_require_default(require("../FxWizard"));
22
+ function _interop_require_default(obj) {
23
+ return obj && obj.__esModule ? obj : {
24
+ default: obj
25
+ };
26
+ }
27
+ const StepsLauncher = (steps, footer)=>{
28
+ /* each config-step has a path, component, and nextStepPath
29
+ example:
30
+ steps = [
31
+ {
32
+ path: '/file-type-selection-page',
33
+ component: FileTypeSelectionPage,
34
+ nextStepPath: '/choose-and-display-files',
35
+ },
36
+ {
37
+ path: '/choose-and-display-files',
38
+ component: ChosenFilesDisplayPage,
39
+ nextStepPath: '/uploader-page',
40
+ },
41
+ ]
42
+
43
+ footer is a component
44
+ */ const config = {
45
+ steps
46
+ };
47
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_FxWizard.default, {
48
+ config: config,
49
+ footer: footer
50
+ });
51
+ };
52
+ const _default = StepsLauncher;
@@ -0,0 +1 @@
1
+ export * from './StepsLauncher';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ _export_star(require("./StepsLauncher"), exports);
6
+ function _export_star(from, to) {
7
+ Object.keys(from).forEach(function(k) {
8
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
9
+ Object.defineProperty(to, k, {
10
+ enumerable: true,
11
+ get: function() {
12
+ return from[k];
13
+ }
14
+ });
15
+ }
16
+ });
17
+ return from;
18
+ }
package/dist/index.d.ts CHANGED
@@ -20,4 +20,5 @@ export { FxStatusBar, StatusBarPropsType, Options } from './FxStatusBar';
20
20
  export { FxTag, TagPropsType } from './FxTag';
21
21
  export { FxTextField, TextFieldPropsType } from './FxTextField';
22
22
  export { FxTodo, TodoItemType, TodoPropsType } from './FxTodo';
23
+ export { FxWizard, StepsLauncher } from './FxWizard';
23
24
  export { Card, PageHeader, Label, BoldValue, Value, PageTitle, Link, Text, ShowMore, ShowMoreContainer, DataWrapper, Bars, } from './FxStyledComponents';
package/dist/index.js CHANGED
@@ -111,6 +111,9 @@ _export(exports, {
111
111
  FxTodo: function() {
112
112
  return _FxTodo.FxTodo;
113
113
  },
114
+ FxWizard: function() {
115
+ return _FxWizard.FxWizard;
116
+ },
114
117
  Label: function() {
115
118
  return _FxStyledComponents.Label;
116
119
  },
@@ -168,6 +171,9 @@ _export(exports, {
168
171
  StatusBarPropsType: function() {
169
172
  return _FxStatusBar.StatusBarPropsType;
170
173
  },
174
+ StepsLauncher: function() {
175
+ return _FxWizard.StepsLauncher;
176
+ },
171
177
  StylesOptions: function() {
172
178
  return _FxAsyncDropdown.StylesOptions;
173
179
  },
@@ -212,4 +218,5 @@ const _FxStatusBar = require("./FxStatusBar");
212
218
  const _FxTag = require("./FxTag");
213
219
  const _FxTextField = require("./FxTextField");
214
220
  const _FxTodo = require("./FxTodo");
221
+ const _FxWizard = require("./FxWizard");
215
222
  const _FxStyledComponents = require("./FxStyledComponents");
package/package.json CHANGED
@@ -14,7 +14,8 @@
14
14
  "graphql-tag": "^2.12.6",
15
15
  "next": "^14.2.3",
16
16
  "react": "18.3.1",
17
- "react-dom": "18.3.1"
17
+ "react-dom": "18.3.1",
18
+ "react-use-wizard": "^2.3.0"
18
19
  },
19
20
  "devDependencies": {
20
21
  "@svgr/webpack": "^8.1.0",
@@ -64,5 +65,5 @@
64
65
  "require": "./dist/index.js"
65
66
  }
66
67
  },
67
- "version": "0.2.18"
68
+ "version": "0.2.20"
68
69
  }