@beweco/aurora-ui 0.1.8 → 0.1.9

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/index.cjs.js CHANGED
@@ -1400,28 +1400,12 @@ var MultistepNavigationButtons = function (_a) {
1400
1400
  return (jsxRuntime.jsx("div", { className: react.cn("flex w-full flex-col-reverse gap-2 pt-4 sm:flex-row sm:justify-between md:justify-end", className), children: jsxRuntime.jsxs("div", { className: "flex w-full flex-col-reverse gap-2 md:w-auto md:flex-row", children: [jsxRuntime.jsx(react.Button, __assign({ className: "w-full md:w-auto", color: "default", variant: "flat" }, restCancelButtonProps, { children: cancelButtonChildren || "Cancel" })), jsxRuntime.jsx(react.Button, __assign({ className: "w-full md:w-auto", color: "primary" }, restNextButtonProps, { children: nextButtonChildren || "Next" }))] }) }));
1401
1401
  };
1402
1402
 
1403
- var variants = {
1404
- enter: function (direction) { return ({
1405
- y: direction > 0 ? 30 : -30,
1406
- opacity: 0,
1407
- }); },
1408
- center: {
1409
- zIndex: 1,
1410
- y: 0,
1411
- opacity: 1,
1412
- },
1413
- exit: function (direction) { return ({
1414
- zIndex: 0,
1415
- y: direction < 0 ? 30 : -30,
1416
- opacity: 0,
1417
- }); },
1418
- };
1419
1403
  var MultiStepWizard = function (_a) {
1420
1404
  var isOpen = _a.isOpen, steps = _a.steps, translations = _a.translations, onClose = _a.onClose, onComplete = _a.onComplete, completeButtonText = _a.completeButtonText;
1421
- var _b = React.useState([0, 0]), _c = _b[0], page = _c[0], direction = _c[1], setPage = _b[1];
1405
+ var _b = React.useState(0), page = _b[0], setPage = _b[1];
1422
1406
  React.useEffect(function () {
1423
1407
  if (isOpen) {
1424
- setPage([0, 0]);
1408
+ setPage(0);
1425
1409
  }
1426
1410
  }, [isOpen]);
1427
1411
  var t = __assign({
@@ -1433,11 +1417,11 @@ var MultiStepWizard = function (_a) {
1433
1417
  }, translations);
1434
1418
  var paginate = React.useCallback(function (newDirection) {
1435
1419
  setPage(function (prev) {
1436
- var nextPage = prev[0] + newDirection;
1420
+ var nextPage = prev + newDirection;
1437
1421
  if (nextPage < 0 || nextPage > steps.length - 1) {
1438
1422
  return prev;
1439
1423
  }
1440
- return [nextPage, newDirection];
1424
+ return nextPage;
1441
1425
  });
1442
1426
  }, [steps]);
1443
1427
  var onChangePage = React.useCallback(function (newPage) {
@@ -1445,8 +1429,7 @@ var MultiStepWizard = function (_a) {
1445
1429
  if (newPage < 0 || newPage > steps.length - 1) {
1446
1430
  return prev;
1447
1431
  }
1448
- var currentPage = prev[0];
1449
- return [newPage, newPage > currentPage ? 1 : -1];
1432
+ return newPage;
1450
1433
  });
1451
1434
  }, [steps]);
1452
1435
  var onBack = React.useCallback(function () {
@@ -1477,14 +1460,8 @@ var MultiStepWizard = function (_a) {
1477
1460
  }
1478
1461
  };
1479
1462
  var content = React.useMemo(function () {
1480
- return (jsxRuntime.jsx(framerMotion.LazyMotion, { features: framerMotion.domAnimation, children: jsxRuntime.jsx(framerMotion.m.div, { animate: "center", className: "col-span-12", custom: direction, exit: "exit", initial: "exit", transition: {
1481
- y: {
1482
- ease: "backOut",
1483
- duration: 0.35,
1484
- },
1485
- opacity: { duration: 0.4 },
1486
- }, variants: variants, children: steps[page].content }, page) }));
1487
- }, [page, steps, direction]);
1463
+ return (jsxRuntime.jsx("div", { className: "col-span-12", children: steps[page].content }, page));
1464
+ }, [page, steps]);
1488
1465
  if (!isOpen) {
1489
1466
  return null;
1490
1467
  }
package/dist/index.esm.js CHANGED
@@ -1399,28 +1399,12 @@ var MultistepNavigationButtons = function (_a) {
1399
1399
  return (jsx("div", { className: cn("flex w-full flex-col-reverse gap-2 pt-4 sm:flex-row sm:justify-between md:justify-end", className), children: jsxs("div", { className: "flex w-full flex-col-reverse gap-2 md:w-auto md:flex-row", children: [jsx(Button$1, __assign({ className: "w-full md:w-auto", color: "default", variant: "flat" }, restCancelButtonProps, { children: cancelButtonChildren || "Cancel" })), jsx(Button$1, __assign({ className: "w-full md:w-auto", color: "primary" }, restNextButtonProps, { children: nextButtonChildren || "Next" }))] }) }));
1400
1400
  };
1401
1401
 
1402
- var variants = {
1403
- enter: function (direction) { return ({
1404
- y: direction > 0 ? 30 : -30,
1405
- opacity: 0,
1406
- }); },
1407
- center: {
1408
- zIndex: 1,
1409
- y: 0,
1410
- opacity: 1,
1411
- },
1412
- exit: function (direction) { return ({
1413
- zIndex: 0,
1414
- y: direction < 0 ? 30 : -30,
1415
- opacity: 0,
1416
- }); },
1417
- };
1418
1402
  var MultiStepWizard = function (_a) {
1419
1403
  var isOpen = _a.isOpen, steps = _a.steps, translations = _a.translations, onClose = _a.onClose, onComplete = _a.onComplete, completeButtonText = _a.completeButtonText;
1420
- var _b = React.useState([0, 0]), _c = _b[0], page = _c[0], direction = _c[1], setPage = _b[1];
1404
+ var _b = React.useState(0), page = _b[0], setPage = _b[1];
1421
1405
  React.useEffect(function () {
1422
1406
  if (isOpen) {
1423
- setPage([0, 0]);
1407
+ setPage(0);
1424
1408
  }
1425
1409
  }, [isOpen]);
1426
1410
  var t = __assign({
@@ -1432,11 +1416,11 @@ var MultiStepWizard = function (_a) {
1432
1416
  }, translations);
1433
1417
  var paginate = React.useCallback(function (newDirection) {
1434
1418
  setPage(function (prev) {
1435
- var nextPage = prev[0] + newDirection;
1419
+ var nextPage = prev + newDirection;
1436
1420
  if (nextPage < 0 || nextPage > steps.length - 1) {
1437
1421
  return prev;
1438
1422
  }
1439
- return [nextPage, newDirection];
1423
+ return nextPage;
1440
1424
  });
1441
1425
  }, [steps]);
1442
1426
  var onChangePage = React.useCallback(function (newPage) {
@@ -1444,8 +1428,7 @@ var MultiStepWizard = function (_a) {
1444
1428
  if (newPage < 0 || newPage > steps.length - 1) {
1445
1429
  return prev;
1446
1430
  }
1447
- var currentPage = prev[0];
1448
- return [newPage, newPage > currentPage ? 1 : -1];
1431
+ return newPage;
1449
1432
  });
1450
1433
  }, [steps]);
1451
1434
  var onBack = React.useCallback(function () {
@@ -1476,14 +1459,8 @@ var MultiStepWizard = function (_a) {
1476
1459
  }
1477
1460
  };
1478
1461
  var content = React.useMemo(function () {
1479
- return (jsx(LazyMotion, { features: domAnimation, children: jsx(m.div, { animate: "center", className: "col-span-12", custom: direction, exit: "exit", initial: "exit", transition: {
1480
- y: {
1481
- ease: "backOut",
1482
- duration: 0.35,
1483
- },
1484
- opacity: { duration: 0.4 },
1485
- }, variants: variants, children: steps[page].content }, page) }));
1486
- }, [page, steps, direction]);
1462
+ return (jsx("div", { className: "col-span-12", children: steps[page].content }, page));
1463
+ }, [page, steps]);
1487
1464
  if (!isOpen) {
1488
1465
  return null;
1489
1466
  }
@@ -1 +1 @@
1
- {"version":3,"file":"MultiStepWizard.d.ts","sourceRoot":"","sources":["../../../../src/components/multi-step-wizard/MultiStepWizard.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAqBpE,eAAO,MAAM,eAAe,GAAI,2EAO7B,oBAAoB,mDA6JtB,CAAC"}
1
+ {"version":3,"file":"MultiStepWizard.d.ts","sourceRoot":"","sources":["../../../../src/components/multi-step-wizard/MultiStepWizard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAIpE,eAAO,MAAM,eAAe,GAAI,2EAO7B,oBAAoB,mDA2ItB,CAAC"}
package/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "@beweco/aurora-ui",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Bewe Aurora UI Component Library",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.esm.js",
7
7
  "types": "./dist/types/index.d.ts",
8
8
  "style": "./dist/assets/css/styles.css",
9
- "files": ["dist"],
9
+ "files": [
10
+ "dist"
11
+ ],
10
12
  "sideEffects": false,
11
13
  "author": "Bewe",
12
14
  "license": "MIT",