@stack-spot/portal-components 1.6.0 → 2.0.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.
Files changed (46) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/components/SelectionList.d.ts.map +1 -1
  3. package/dist/components/SelectionList.js +6 -2
  4. package/dist/components/SelectionList.js.map +1 -1
  5. package/dist/components/error/index.d.ts +1 -1
  6. package/dist/components/error/index.d.ts.map +1 -1
  7. package/dist/components/error/index.js.map +1 -1
  8. package/dist/hooks/date.d.ts +0 -12
  9. package/dist/hooks/date.d.ts.map +1 -1
  10. package/dist/hooks/date.js +0 -18
  11. package/dist/hooks/date.js.map +1 -1
  12. package/package.json +1 -5
  13. package/readme.md +0 -4
  14. package/src/components/SelectionList.tsx +9 -6
  15. package/src/components/error/index.ts +2 -1
  16. package/src/hooks/date.ts +0 -20
  17. package/dist/components/Tour/StepContainer.d.ts +0 -29
  18. package/dist/components/Tour/StepContainer.d.ts.map +0 -1
  19. package/dist/components/Tour/StepContainer.js +0 -52
  20. package/dist/components/Tour/StepContainer.js.map +0 -1
  21. package/dist/components/Tour/StepNavigation.d.ts +0 -29
  22. package/dist/components/Tour/StepNavigation.d.ts.map +0 -1
  23. package/dist/components/Tour/StepNavigation.js +0 -38
  24. package/dist/components/Tour/StepNavigation.js.map +0 -1
  25. package/dist/components/Tour/StepTitle.d.ts +0 -17
  26. package/dist/components/Tour/StepTitle.d.ts.map +0 -1
  27. package/dist/components/Tour/StepTitle.js +0 -9
  28. package/dist/components/Tour/StepTitle.js.map +0 -1
  29. package/dist/components/Tour/context.d.ts +0 -28
  30. package/dist/components/Tour/context.d.ts.map +0 -1
  31. package/dist/components/Tour/context.js +0 -59
  32. package/dist/components/Tour/context.js.map +0 -1
  33. package/dist/components/Tour/index.d.ts +0 -9
  34. package/dist/components/Tour/index.d.ts.map +0 -1
  35. package/dist/components/Tour/index.js +0 -4
  36. package/dist/components/Tour/index.js.map +0 -1
  37. package/dist/components/Tour/utils.d.ts +0 -51
  38. package/dist/components/Tour/utils.d.ts.map +0 -1
  39. package/dist/components/Tour/utils.js +0 -60
  40. package/dist/components/Tour/utils.js.map +0 -1
  41. package/src/components/Tour/StepContainer.tsx +0 -83
  42. package/src/components/Tour/StepNavigation.tsx +0 -72
  43. package/src/components/Tour/StepTitle.tsx +0 -27
  44. package/src/components/Tour/context.tsx +0 -67
  45. package/src/components/Tour/index.ts +0 -7
  46. package/src/components/Tour/utils.tsx +0 -100
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.0.1](https://github.com/stack-spot/portal-commons/compare/portal-components@v2.0.0...portal-components@v2.0.1) (2024-07-02)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * 547 page selector ([bb82b81](https://github.com/stack-spot/portal-commons/commit/bb82b810d8b3a02997199f8bd8973b180dc681e3))
9
+
10
+ ## [2.0.0](https://github.com/stack-spot/portal-commons/compare/portal-components@v1.6.0...portal-components@v2.0.0) (2024-06-28)
11
+
12
+
13
+ ### ⚠ BREAKING CHANGES
14
+
15
+ * **portal-components:** removed Tour related componets
16
+ * **portal-layout:** Adds a new reworked Tour structure compatible with module federation
17
+ * new Tour strategy
18
+
19
+ ### Features
20
+
21
+ * new Tour strategy ([d6daf23](https://github.com/stack-spot/portal-commons/commit/d6daf238f9956e2c913a36773db9b34080fd17a5))
22
+ * **portal-components:** removed Tour related componets ([d6daf23](https://github.com/stack-spot/portal-commons/commit/d6daf238f9956e2c913a36773db9b34080fd17a5))
23
+ * **portal-layout:** Adds a new reworked Tour structure compatible with module federation ([d6daf23](https://github.com/stack-spot/portal-commons/commit/d6daf238f9956e2c913a36773db9b34080fd17a5))
24
+
3
25
  ## [1.6.0](https://github.com/stack-spot/portal-commons/compare/portal-components@v1.5.1...portal-components@v1.6.0) (2024-06-27)
4
26
 
5
27
 
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionList.d.ts","sourceRo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;IACjC;;OAEG;IACH,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrB;;MAEE;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,WAAY,SAAQ,SAAS;IACrC,IAAI,EAAE,SAAS,CAAC;IAChB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,eAAgB,SAAQ,SAAS,EAAE,YAAY;IACvD,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,KAAK,QAAQ,GAAG,WAAW,GAAG,eAAe,GAAG,UAAU,CAAA;AAW1D,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AA2HD;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,wFAEvB,kBAAkB,4CAsFpB,CAAA"}
1
+ {"version":3,"file":"SelectionList.d.ts","sourceRoot":"","sources":["../../src/components/SelectionList.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAsB,MAAM,0BAA0B,CAAA;AAExE,OAAO,EAAE,YAAY,EAA6C,MAAM,OAAO,CAAA;AAK/E,UAAU,WAAW;IACnB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED,MAAM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CAAC,EAAE,aAAa,CAAC;IACrB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,KAAK,QAAQ,GAAG,WAAW,GAAG,eAAe,GAAG,UAAU,CAAA;AAW1D,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AA2HD;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,wFAEvB,kBAAkB,4CAyFpB,CAAA"}
@@ -119,6 +119,10 @@ export const SelectionList = ({ id, items, className, style, visible = true, max
119
119
  onHide?.();
120
120
  }, []);
121
121
  useEffect(() => {
122
+ function removeListeners() {
123
+ detachKeyboardListeners();
124
+ document.removeEventListener('click', hide);
125
+ }
122
126
  if (visible) {
123
127
  setCurrent({ items });
124
128
  attachKeyboardListeners();
@@ -126,9 +130,9 @@ export const SelectionList = ({ id, items, className, style, visible = true, max
126
130
  setTimeout(() => document.addEventListener('click', hide), 50);
127
131
  }
128
132
  else {
129
- detachKeyboardListeners();
130
- document.removeEventListener('click', hide);
133
+ removeListeners();
131
134
  }
135
+ return () => removeListeners();
132
136
  }, [visible]);
133
137
  return (_jsx(SelectionBox, { id: id, ref: wrapper, "$maxHeight": maxHeight, style: style, className: listToClass(['selection-list', visible ? 'visible' : undefined, className]), "$scroll": scroll, "aria-hidden": !visible, children: _jsxs("div", { className: "selection-list-content", children: [before, current.parent
134
138
  ? (_jsxs(Flex, { mt: 5, mb: 1, alignItems: "center", children: [_jsx(IconButton, { onClick: (ev) => {
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionList.js","sourceRoot":"","sources":["../../src/components/SelectionList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAa,WAAW,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAO,EAAc,YAAY,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,EAAgB,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAmB,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAyGvD,MAAM,qBAAqB,GAAG,GAAG,CAAA;AACjC,MAAM,qBAAqB,GAAG,sBAAsB,qBAAqB,GAAG,IAAI,GAAG,CAAA;AA8CnF,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAA2C;;gBAE1D,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ;;gBAE5C,qBAAqB,mBAAmB,qBAAqB,GAAG,IAAI;;;;;;;;;kBASlE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;;wBAElB,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;wBACxB,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;oBAe5B,KAAK,CAAC,KAA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AAG,EAAE,OAAO,gBACA,SAAS,EACrB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,WAAW,CAAC,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,aAC7E,MAAM,iBACF,CAAC,OAAO,YAErB,eAAK,SAAS,EAAC,wBAAwB,aACpC,MAAM,EACN,OAAO,CAAC,MAAM;oBACb,CAAC,CAAC,CACA,MAAC,IAAI,IAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,UAAU,EAAC,QAAQ,aACrC,KAAC,UAAU,IACT,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE;oCACd,wHAAwH;oCACvH,EAAE,CAAC,MAAsB,EAAE,YAAY,EAAE,CAAC,eAAe,EAAE,OAAO,CAAC,CAAA;oCACpE,UAAU,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;gCACzC,CAAC,EACD,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EACb,KAAK,EAAE,CAAC,CAAC,IAAI,mBACE,EAAE,mBACF,IAAI,YAEnB,KAAC,SAAS,KAAG,GACF,EACb,KAAC,IAAI,IAAC,UAAU,EAAC,YAAY,YAAE,OAAO,CAAC,KAAK,GAAQ,IAC/C,CACR;oBACD,CAAC,CAAC,SAAS,EAEb,yBACG,SAAS,EACT,KAAK;4BACJ,aAAI,SAAS,EAAC,QAAQ,YACnB,KAAK,GACH,IAEJ,IACD,GACO,CAChB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,IAAI,EAAE,SAAS;KAChB;IACD,EAAE,EAAE;QACF,IAAI,EAAE,QAAQ;KACf;CACmB,CAAA"}
1
+ {"version":3,"file":"SelectionList.js","sourceRoot":"","sources":["../../src/components/SelectionList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE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CAAC,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,aAC7E,MAAM,iBACF,CAAC,OAAO,YAErB,eAAK,SAAS,EAAC,wBAAwB,aACpC,MAAM,EACN,OAAO,CAAC,MAAM;oBACb,CAAC,CAAC,CACA,MAAC,IAAI,IAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,UAAU,EAAC,QAAQ,aACrC,KAAC,UAAU,IACT,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE;oCACd,wHAAwH;oCACvH,EAAE,CAAC,MAAsB,EAAE,YAAY,EAAE,CAAC,eAAe,EAAE,OAAO,CAAC,CAAA;oCACpE,UAAU,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;gCACzC,CAAC,EACD,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EACb,KAAK,EAAE,CAAC,CAAC,IAAI,mBACE,EAAE,mBACF,IAAI,YAEnB,KAAC,SAAS,KAAG,GACF,EACb,KAAC,IAAI,IAAC,UAAU,EAAC,YAAY,YAAE,OAAO,CAAC,KAAK,GAAQ,IAC/C,CACR;oBACD,CAAC,CAAC,SAAS,EAEb,yBACG,SAAS,EACT,KAAK;4BACJ,aAAI,SAAS,EAAC,QAAQ,YACnB,KAAK,GACH,IAEJ,IACD,GACO,CAChB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,IAAI,EAAE,SAAS;KAChB;IACD,EAAE,EAAE;QACF,IAAI,EAAE,QAAQ;KACf;CACmB,CAAA"}
@@ -1,4 +1,4 @@
1
- export { ErrorFeedback } from './ErrorFeedback.js';
1
+ export { ErrorDescription, ErrorFeedback } from './ErrorFeedback.js';
2
2
  export { PageNotFound } from './NotFound.js';
3
3
  export { UnderMaintenance } from './UnderMaintenance.js';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/error/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/error/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/error/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/error/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA"}
@@ -1,15 +1,3 @@
1
- /**
2
- * @deprecated this hook is prone to errors due to how React Hooks work. Use `useDateFormatter()` instead.
3
- * @param date
4
- * @returns the formatted date
5
- */
6
- export declare function useFormatDate(date?: string): string | undefined;
7
- /**
8
- * @deprecated this hook is prone to errors due to how React Hooks work. Use `useDateFormatter()` instead.
9
- * @param date
10
- * @returns the formatted date with its time
11
- */
12
- export declare function useFormatDateWithTime(date?: string): string | undefined;
13
1
  /**
14
2
  * A utility for formatting dates.
15
3
  * @param date
@@ -1 +1 @@
1
- {"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/hooks/date.ts"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,CAAC,EAAE,MAAM,sBAG1C;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,CAAC,EAAE,MAAM,sBAGlD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB;wBAGR,MAAM;gCACE,MAAM;EAErC"}
1
+ {"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/hooks/date.ts"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,wBAAgB,gBAAgB;wBAGR,MAAM;gCACE,MAAM;EAErC"}
@@ -7,24 +7,6 @@ function formatDate(date, locale, includeTime) {
7
7
  ? format(new Date(date), `dd/MM/yyyy${time}`, { locale: ptBR })
8
8
  : format(new Date(date), `MMMM dd yyyy${time}`);
9
9
  }
10
- /**
11
- * @deprecated this hook is prone to errors due to how React Hooks work. Use `useDateFormatter()` instead.
12
- * @param date
13
- * @returns the formatted date
14
- */
15
- export function useFormatDate(date) {
16
- const locale = useLanguage();
17
- return date ? formatDate(date, locale, false) : undefined;
18
- }
19
- /**
20
- * @deprecated this hook is prone to errors due to how React Hooks work. Use `useDateFormatter()` instead.
21
- * @param date
22
- * @returns the formatted date with its time
23
- */
24
- export function useFormatDateWithTime(date) {
25
- const locale = useLanguage();
26
- return date ? formatDate(date, locale, true) : undefined;
27
- }
28
10
  /**
29
11
  * A utility for formatting dates.
30
12
  * @param date
@@ -1 +1 @@
1
- {"version":3,"file":"date.js","sourceRoot":"","sources":["../../src/hooks/date.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAEtC,S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zF,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"date.js","sourceRoot":"","sources":["../../src/hooks/date.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAEtC,SAAS,UAAU,CAAC,IAAY,EAAE,MAAgB,EAAE,WAAoB;IACtE,MAAM,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAA;IACxC,OAAO,MAAM,KAAK,IAAI;QACpB,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,aAAa,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QAC/D,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,eAAe,IAAI,EAAE,CAAC,CAAA;AACnD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,MAAM,GAAG,WAAW,EAAE,CAAA;IAC5B,OAAO;QACL,UAAU,EAAE,CAAC,IAAa,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;QACjF,kBAAkB,EAAE,CAAC,IAAa,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;KACzF,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,15 +1,13 @@
1
1
  {
2
2
  "name": "@stack-spot/portal-components",
3
- "version": "1.6.0",
3
+ "version": "2.0.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
8
8
  ".": "./dist/index.js",
9
9
  "./Breadcrumb": "./dist/components/Breadcrumb/index.js",
10
- "./ErrorFeedback": "./dist/components/error/ErrorFeedback.js",
11
10
  "./SelectionList": "./dist/components/SelectionList.js",
12
- "./Tour": "./dist/components/Tour/index.js",
13
11
  "./LazyMarkdown": "./dist/components/LazyMarkdown/index.js",
14
12
  "./Notifications": "./dist/components/Notifications/index.js",
15
13
  "./StatusCircle": "./dist/components/StatusCircle.js",
@@ -39,7 +37,6 @@
39
37
  "@types/react": "^18.2.37",
40
38
  "@types/react-dom": "^18.2.15",
41
39
  "@types/react-syntax-highlighter": "^15.5.13",
42
- "@types/reactour": "^1.18.5",
43
40
  "@typescript-eslint/eslint-plugin": "^6.10.0",
44
41
  "@typescript-eslint/parser": "^6.10.0",
45
42
  "agadoo": "^3.0.0",
@@ -64,7 +61,6 @@
64
61
  "react-infinite-scroll-component": "^6.1.0",
65
62
  "react-markdown": "^9.0.1",
66
63
  "react-syntax-highlighter": "^15.5.0",
67
- "reactour": "^1.19.3",
68
64
  "rehype-raw": "^7.0.0",
69
65
  "remark-gfm": "^4.0.0"
70
66
  }
package/readme.md CHANGED
@@ -11,8 +11,6 @@ Exceptions: translations are the only exception here. These components can acces
11
11
  parameter.
12
12
 
13
13
  - `BreadcrumbList`: renders a list of breadcrumb navigation items. Must be imported from `@stack-spot/portal-components/Breadcrumb`.
14
- - `StepContainer`, `TourProvider`, `TourStep`: components related to React Tour, i.e. the tutorial engine used by Stackspot. Must be imported
15
- from `@stack-spot/portal-components/Tour`.
16
14
  - `BannerWarning`: a yellow alert box with an exclamation icon and the content passed as parameter. Used for warning messages.
17
15
  - `ChatBot`: an orange circular button that can toggle the chat window from Service Now. The button has a chat icon when the window is
18
16
  closed and a close icon when it's open.
@@ -36,8 +34,6 @@ component that renders the HTML `<a>` tag directly. This is useful for integrati
36
34
  `@stack-spot/portal-components/anchor`.
37
35
  - `useKeyboardControls(options)`: creates listeners for controlling a Menu UI through the keyboard (up, down, tab, esc, enter).
38
36
  - `useServiceNowEffect(options)`, `useServiceNowChatButtonVisibility()`: Service Now hooks (chat capabilities).
39
- - `useTour()`: retrieves data related to the current step of React Tour (tutorial). Must be imported from
40
- `@stack-spot/portal-components/Tour`.
41
37
 
42
38
  ## SVG images
43
39
  Some SVG images are exported as React components at `@stack-spot/portal-components/svg`.
@@ -215,7 +215,7 @@ const SelectionBox = styled.div<{ $maxHeight: string, $scroll?: boolean }>`
215
215
 
216
216
  function renderAction({
217
217
  label, href, onClick, icon, iconRight, active, target, iconActive = <Check />,
218
- className='', lang, hrefLang,
218
+ className = '', lang, hrefLang,
219
219
  }: ListAction, { onClose, Link }: RenderOptions) {
220
220
  function handleClick(event: React.MouseEvent) {
221
221
  onClick?.(event)
@@ -237,7 +237,7 @@ function renderAction({
237
237
  )
238
238
  }
239
239
 
240
- function renderCollapsible({ label, icon, iconRight, className='', children }:
240
+ function renderCollapsible({ label, icon, iconRight, className = '', children }:
241
241
  ListCollapsible, { setCurrent, controllerId, Link }: RenderOptions) {
242
242
  function handleClick(ev: React.MouseEvent) {
243
243
  // accessibility: this will tell the screen reader the section was expanded before this link is removed from the DOM.
@@ -314,15 +314,18 @@ export const SelectionList = ({
314
314
  }, [])
315
315
 
316
316
  useEffect(() => {
317
+ function removeListeners() {
318
+ detachKeyboardListeners()
319
+ document.removeEventListener('click', hide)
320
+ }
317
321
  if (visible) {
318
322
  setCurrent({ items })
319
323
  attachKeyboardListeners()
320
324
  if (onHide) setTimeout(() => document.addEventListener('click', hide), 50)
325
+ } else {
326
+ removeListeners()
321
327
  }
322
- else {
323
- detachKeyboardListeners()
324
- document.removeEventListener('click', hide)
325
- }
328
+ return () => removeListeners()
326
329
  }, [visible])
327
330
 
328
331
  return (
@@ -1,3 +1,4 @@
1
- export { ErrorFeedback } from './ErrorFeedback'
1
+ export { ErrorDescription, ErrorFeedback } from './ErrorFeedback'
2
2
  export { PageNotFound } from './NotFound'
3
3
  export { UnderMaintenance } from './UnderMaintenance'
4
+
package/src/hooks/date.ts CHANGED
@@ -9,26 +9,6 @@ function formatDate(date: string, locale: Language, includeTime: boolean) {
9
9
  : format(new Date(date), `MMMM dd yyyy${time}`)
10
10
  }
11
11
 
12
- /**
13
- * @deprecated this hook is prone to errors due to how React Hooks work. Use `useDateFormatter()` instead.
14
- * @param date
15
- * @returns the formatted date
16
- */
17
- export function useFormatDate(date?: string) {
18
- const locale = useLanguage()
19
- return date ? formatDate(date, locale, false) : undefined
20
- }
21
-
22
- /**
23
- * @deprecated this hook is prone to errors due to how React Hooks work. Use `useDateFormatter()` instead.
24
- * @param date
25
- * @returns the formatted date with its time
26
- */
27
- export function useFormatDateWithTime(date?: string) {
28
- const locale = useLanguage()
29
- return date ? formatDate(date, locale, true) : undefined
30
- }
31
-
32
12
  /**
33
13
  * A utility for formatting dates.
34
14
  * @param date
@@ -1,29 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { NavigationProps } from './StepNavigation.js';
3
- interface StepContainerProps {
4
- children: ReactNode;
5
- /**
6
- * The unique identifier for the step.
7
- */
8
- stepKey: string;
9
- /**
10
- * The title for the step.
11
- */
12
- title: string;
13
- /**
14
- * The position of the tour overlay related to the content being explained.
15
- */
16
- position: PointingArrowPosition;
17
- /**
18
- * A customizable set of buttons for navigating the tour steps.
19
- */
20
- customNavigation?: Omit<NavigationProps, 'stepKey'>;
21
- }
22
- /**
23
- * Tutorial: the overlay component for showing a step on React Tour.
24
- * @param props the react props for the component {@link StepContainerProps}.
25
- */
26
- export declare const StepContainer: ({ title, stepKey, customNavigation, position, children }: StepContainerProps) => import("react/jsx-runtime").JSX.Element;
27
- export type PointingArrowPosition = 'right' | 'top' | 'left' | 'bottom';
28
- export {};
29
- //# sourceMappingURL=StepContainer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StepContainer.d.ts","sourceRoot":"","sources":["../../../src/components/Tour/StepContainer.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,eAAe,EAAkB,MAAM,kBAAkB,CAAA;AAIlE,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,qBAAqB,CAAC;IAChC;;OAEG;IACH,gBAAgB,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;CACrD;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,6DAA8D,kBAAkB,4CAOzG,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAA"}
@@ -1,52 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { theme } from '@stack-spot/portal-theme';
3
- import { styled } from 'styled-components';
4
- import { StepNavigation } from './StepNavigation.js';
5
- import { StepTitle } from './StepTitle.js';
6
- import { useTour } from './context.js';
7
- /**
8
- * Tutorial: the overlay component for showing a step on React Tour.
9
- * @param props the react props for the component {@link StepContainerProps}.
10
- */
11
- export const StepContainer = ({ title, stepKey, customNavigation, position, children }) => {
12
- const { finishStep } = useTour();
13
- return _jsxs(BoxWithPointingArrow, { "$position": position, children: [_jsx(StepTitle, { title: title, onClose: () => finishStep(stepKey) }), children, _jsx(StepNavigation, { stepKey: stepKey, ...(customNavigation || {}) })] });
14
- };
15
- const BoxWithPointingArrow = styled.div `
16
- position: relative;
17
- width: 100%;
18
- background-color: ${theme.color.inverse[500]};
19
- &::after {
20
- content: '';
21
- position: absolute;
22
- border-width: 10px;
23
- border-style: solid;
24
- border-color: transparent;
25
- margin-top: -5px;
26
- border-right-color: ${theme.color.inverse[500]};
27
- ${({ $position, $top }) => $position === 'right' ?
28
- `
29
- top: ${$top || '16px'};
30
- left: -18px;
31
- ` : ''}
32
- ${({ $position, $right }) => $position === 'top' ?
33
- `
34
- bottom: 96%;
35
- right: ${$right || '16px'};
36
- transform: rotate(90deg);
37
- ` : ''}
38
- ${({ $position, $top }) => $position === 'left' ?
39
- `
40
- top: ${$top || '16px'};
41
- right: -18px;
42
- transform: rotate(180deg);
43
- ` : ''}
44
- ${({ $position, $right }) => $position === 'bottom' ?
45
- `
46
- top: -13px;
47
- right: ${$right || '16px'};
48
- transform: rotate(90deg);
49
- ` : ''}
50
- }
51
- `;
52
- //# sourceMappingURL=StepContainer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StepContainer.js","sourceRoot":"","sources":["../../../src/components/Tour/StepContainer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAEhD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAmB,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAsBnC;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAsB,EAAE,EAAE;IAC5G,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,EAAE,CAAA;IAChC,OAAO,MAAC,oBAAoB,iBAAY,QAAQ,aAC9C,KAAC,SAAS,IAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,GAAI,EAC9D,QAAQ,EACT,KAAC,cAAc,IAAC,OAAO,EAAE,OAAO,KAAM,CAAC,gBAAgB,IAAI,EAAE,CAAC,GAAI,IAC7C,CAAA;AACzB,CAAC,CAAA;AAID,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAInC;;;sBAGkB,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;;;;;;;;0BAQpB,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;MAC5C,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,SAAS,KAAK,OAAO,CAAC,CAAC;IAClD;aACS,IAAI,IAAI,MAAM;;KAEtB,CAAC,CAAC,CAAC,EAAE;MACJ,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC;IAClD;;aAES,MAAM,IAAI,MAAM;;KAExB,CAAC,CAAC,CAAC,EAAE;MACJ,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,SAAS,KAAK,MAAM,CAAC,CAAC;IACjD;aACS,IAAI,IAAI,MAAM;;;KAGtB,CAAC,CAAC,CAAC,EAAE;MACJ,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC;IACrD;;aAES,MAAM,IAAI,MAAM;;KAExB,CAAC,CAAC,CAAC,EAAE;;CAET,CAAA"}
@@ -1,29 +0,0 @@
1
- import '@stack-spot/portal-theme/dist/theme.css';
2
- interface CustomNavigationButton {
3
- /**
4
- * The text content to render.
5
- */
6
- text: string;
7
- onClick?: () => void;
8
- }
9
- export interface NavigationProps {
10
- /**
11
- * The unique identifier of the step.
12
- */
13
- stepKey: string;
14
- /**
15
- * The text and click handler for the button "next".
16
- */
17
- nextButton?: CustomNavigationButton;
18
- /**
19
- * The text and click handler for the button "previous".
20
- */
21
- prevButton?: CustomNavigationButton;
22
- }
23
- /**
24
- * Tutorial: the component in a React Tour overlay that shows the next and previous buttons (for step navigation).
25
- * @param props the react props for the component {@link NavigationProps}.
26
- */
27
- export declare const StepNavigation: ({ stepKey, nextButton, prevButton }: NavigationProps) => import("react/jsx-runtime").JSX.Element;
28
- export {};
29
- //# sourceMappingURL=StepNavigation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StepNavigation.d.ts","sourceRoot":"","sources":["../../../src/components/Tour/StepNavigation.tsx"],"names":[],"mappings":"AACA,OAAO,yCAAyC,CAAA;AAKhD,UAAU,sBAAsB;IAC9B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC;;OAEG;IACH,UAAU,CAAC,EAAE,sBAAsB,CAAC;CACrC;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,wCAAyC,eAAe,4CAuBlF,CAAA"}
@@ -1,38 +0,0 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import { Button, Flex, Text } from '@citric/core';
3
- import '@stack-spot/portal-theme/dist/theme.css';
4
- import { useTranslate } from '@stack-spot/portal-translate';
5
- import { useTour } from './context.js';
6
- import { finishTourStep } from './utils.js';
7
- /**
8
- * Tutorial: the component in a React Tour overlay that shows the next and previous buttons (for step navigation).
9
- * @param props the react props for the component {@link NavigationProps}.
10
- */
11
- export const StepNavigation = ({ stepKey, nextButton, prevButton }) => {
12
- const { currentStep, steps, nextStep, prevStep } = useTour();
13
- const t = useTranslate(translations);
14
- return _jsxs(Flex, { w: 12, px: 5, py: 2, mt: "-1px", bg: "inverse.500", justifyContent: "space-between", alignItems: "center", children: [_jsxs(Text, { appearance: "microtext1", colorScheme: "inverse.contrastText", children: [currentStep + 1, " ", t.of, " ", steps.length] }), _jsxs(Flex, { sx: { gap: '8px' }, children: [currentStep >= 1 &&
15
- _jsx(Button, { sx: { paddingInline: '20px' }, onClick: () => {
16
- prevStep?.();
17
- prevButton?.onClick?.();
18
- }, size: "sm", appearance: "text", colorScheme: "light", children: prevButton?.text || t.back }), _jsx(Button, { sx: { paddingInline: '20px' }, onClick: () => {
19
- nextButton?.onClick?.();
20
- nextStep?.();
21
- finishTourStep(stepKey);
22
- }, size: "sm", colorScheme: "light", children: nextButton?.text || (currentStep < steps.length - 1 ? t.next : t.done) })] })] });
23
- };
24
- const translations = {
25
- en: {
26
- of: 'of',
27
- back: 'Back',
28
- next: 'Next',
29
- done: 'Done',
30
- },
31
- pt: {
32
- of: 'de',
33
- back: 'Voltar',
34
- next: 'Próximo',
35
- done: 'Finalizado',
36
- },
37
- };
38
- //# sourceMappingURL=StepNavigation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StepNavigation.js","sourceRoot":"","sources":["../../../src/components/Tour/StepNavigation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,yCAAyC,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAyBxC;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAmB,EAAE,EAAE;IACrF,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,CAAA;IAC5D,MAAM,CAAC,GAAG,YAAY,CAAC,YAAY,CAAC,CAAA;IAEpC,OAAO,MAAC,IAAI,IAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAC,MAAM,EAAC,EAAE,EAAC,aAAa,EAAC,cAAc,EAAC,eAAe,EAAC,UAAU,EAAC,QAAQ,aAC7G,MAAC,IAAI,IAAC,UAAU,EAAC,YAAY,EAAC,WAAW,EAAC,sBAAsB,aAAE,WAAW,GAAG,CAAC,OAA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**
3
- * The step's title.
4
- */
5
- title: string;
6
- /**
7
- * A function to run once the step is closed.
8
- */
9
- onClose?: () => void;
10
- }
11
- /**
12
- * Tutorial: the component in a React Tour overlay that renders the title.
13
- * @param props the react props for the component {@link StepTitleProps}.
14
- */
15
- export declare const StepTitle: ({ title, onClose }: StepTitleProps) => import("react/jsx-runtime").JSX.Element;
16
- export {};
17
- //# sourceMappingURL=StepTitle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StepTitle.d.ts","sourceRoot":"","sources":["../../../src/components/Tour/StepTitle.tsx"],"names":[],"mappings":"AAGA,UAAU,cAAc;IACtB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,uBAAwB,cAAc,4CAQnD,CAAA"}
@@ -1,9 +0,0 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import { Button, Flex, IconBox, Text } from '@citric/core';
3
- import { TimesMini } from '@citric/icons';
4
- /**
5
- * Tutorial: the component in a React Tour overlay that renders the title.
6
- * @param props the react props for the component {@link StepTitleProps}.
7
- */
8
- export const StepTitle = ({ title, onClose }) => _jsxs(Flex, { w: 12, pl: 5, py: 3, flexWrap: "nowrap", justifyContent: "space-between", alignItems: "center", children: [_jsxs(Text, { appearance: "body2", colorScheme: "inverse.contrastText", weight: "medium", children: [" ", title, " "] }), _jsx(Button, { appearance: "text", size: "sm", onClick: () => onClose?.(), sx: { ':hover': { borderColor: 'transparent !important' } }, children: _jsx(IconBox, { size: "xs", colorIcon: "inverse.contrastText", children: _jsx(TimesMini, {}) }) })] });
9
- //# sourceMappingURL=StepTitle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StepTitle.js","sourceRoot":"","sources":["../../../src/components/Tour/StepTitle.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAazC;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAkB,EAAE,EAAE,CAC9D,MAAC,IAAI,IAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAC,QAAQ,EAAC,cAAc,EAAC,eAAe,EAAC,UAAU,EAAC,QAAQ,aAC7F,MAAC,IAAI,IAAC,UAAU,EAAC,OAAO,EAAC,WAAW,EAAC,sBAAsB,EAAC,MAAM,EAAC,QAAQ,kBAAG,KAAK,SAAS,EAC5F,KAAC,MAAM,IAAC,UAAU,EAAC,MAAM,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,wBAAwB,EAAE,EAAE,YACzH,KAAC,OAAO,IAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,sBAAsB,YACjD,KAAC,SAAS,KAAG,GACL,GACH,IACJ,CAAA"}
@@ -1,28 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { ReactourProps } from 'reactour';
3
- type TourConfig = Omit<ReactourProps, 'children'>;
4
- /**
5
- * Tutorial: the default configuration for a React Tour.
6
- */
7
- export declare const defaultTourConfig: TourConfig;
8
- /**
9
- * Tutorial: provides the configuration for React Tour.
10
- * @param props the configuration for the tour and the content to render.
11
- */
12
- export declare const TourProvider: ({ config, children }: {
13
- config: TourConfig;
14
- children: ReactNode;
15
- }) => import("react/jsx-runtime").JSX.Element;
16
- /**
17
- * Tutorial: retrieves data related to the current step of React Tour.
18
- * @returns an object with all the information related to the steps of React Tour.
19
- */
20
- export declare const useTour: () => {
21
- currentStep: number;
22
- nextStep: (() => void) | undefined;
23
- prevStep: (() => void) | undefined;
24
- steps: import("reactour").ReactourStep[];
25
- finishStep: (stepKey: string) => void;
26
- };
27
- export {};
28
- //# sourceMappingURL=context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/components/Tour/context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAuC,MAAM,OAAO,CAAA;AACtE,OAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAG9C,KAAK,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAA;AAEjD;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,UAU9B,CAAA;AAOF;;;GAGG;AACH,eAAO,MAAM,YAAY,yBAA0B;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,4CAkB7F,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,OAAO;;;;;0BAOM,MAAM;CAK/B,CAAA"}
@@ -1,59 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { createContext, useContext, useState } from 'react';
3
- import Tour from 'reactour';
4
- import { finishTourStep } from './utils.js';
5
- /**
6
- * Tutorial: the default configuration for a React Tour.
7
- */
8
- export const defaultTourConfig = Object.freeze({
9
- steps: [],
10
- isOpen: true,
11
- onRequestClose: () => '',
12
- showButtons: false,
13
- showNavigation: false,
14
- showNavigationNumber: false,
15
- showNumber: false,
16
- showCloseButton: false,
17
- disableFocusLock: true,
18
- });
19
- const TourContext = createContext({
20
- tourConfig: defaultTourConfig,
21
- currentStep: 0,
22
- });
23
- /**
24
- * Tutorial: provides the configuration for React Tour.
25
- * @param props the configuration for the tour and the content to render.
26
- */
27
- export const TourProvider = ({ config, children }) => {
28
- const [currentStep, setCurrentStep] = useState(0);
29
- const tourConfig = {
30
- ...config,
31
- goToStep: currentStep,
32
- update: `${currentStep}`,
33
- nextStep: () => setCurrentStep(currentStep + 1),
34
- prevStep: () => setCurrentStep(currentStep - 1),
35
- isOpen: !!config.steps.length && (currentStep < config.steps.length),
36
- };
37
- return _jsxs(TourContext.Provider, { value: {
38
- currentStep,
39
- tourConfig,
40
- }, children: [_jsx(Tour, { ...tourConfig }), children] });
41
- };
42
- /**
43
- * Tutorial: retrieves data related to the current step of React Tour.
44
- * @returns an object with all the information related to the steps of React Tour.
45
- */
46
- export const useTour = () => {
47
- const { currentStep, tourConfig: { nextStep, prevStep, steps } } = useContext(TourContext);
48
- return {
49
- currentStep,
50
- nextStep,
51
- prevStep,
52
- steps,
53
- finishStep: (stepKey) => {
54
- finishTourStep(stepKey);
55
- nextStep?.();
56
- },
57
- };
58
- };
59
- //# sourceMappingURL=context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/components/Tour/context.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACtE,OAAO,IAAuB,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAIxC;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAe,MAAM,CAAC,MAAM,CAAC;IACzD,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE,GAAG,EAAE,CAAC,EAAE;IACxB,WAAW,EAAE,KAAK;IAClB,cAAc,EAAE,KAAK;IACrB,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE,KAAK;IACjB,eAAe,EAAE,KAAK;IACtB,gBAAgB,EAAE,IAAI;CACvB,CAAC,CAAA;AAEF,MAAM,WAAW,GAAG,aAAa,CAAkD;IACjF,UAAU,EAAE,iBAAiB;IAC7B,WAAW,EAAE,CAAC;CACf,CAAC,CAAA;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,MAAM,EAAE,QAAQ,EAA+C,EAAE,EAAE;IAChG,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAS,CAAC,CAAC,CAAA;IACzD,MAAM,UAAU,GAAe;QAC7B,GAAG,MAAM;QACT,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,GAAG,WAAW,EAAE;QACxB,QAAQ,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,WAAW,GAAG,CAAC,CAAC;QAC/C,QAAQ,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,WAAW,GAAG,CAAC,CAAC;QAC/C,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;KACrE,CAAA;IAED,OAAO,MAAC,WAAW,CAAC,QAAQ,IAAC,KAAK,EAAE;YAClC,WAAW;YACX,UAAU;SACX,aACC,KAAC,IAAI,OAAK,UAAU,GAAI,EACvB,QAAQ,IACY,CAAA;AACzB,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,EAAE;IAC1B,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,CAAA;IAC1F,OAAO;QACL,WAAW;QACX,QAAQ;QACR,QAAQ;QACR,KAAK;QACL,UAAU,EAAE,CAAC,OAAe,EAAE,EAAE;YAC9B,cAAc,CAAC,OAAO,CAAC,CAAA;YACvB,QAAQ,EAAE,EAAE,CAAA;QACd,CAAC;KACF,CAAA;AACH,CAAC,CAAA"}
@@ -1,9 +0,0 @@
1
- import { ReactourProps, ReactourStep } from 'reactour';
2
- export { StepContainer } from './StepContainer.js';
3
- export { TourProvider, defaultTourConfig, useTour } from './context.js';
4
- export { hasFinishedTourStep, isNewTourStep, tourStepBuilder } from './utils.js';
5
- export { ReactourStep as TourStep };
6
- export type TourProps = Partial<Omit<ReactourProps, 'children'>> & {
7
- steps: ReactourStep[];
8
- };
9
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Tour/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACpE,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC7E,OAAO,EAAE,YAAY,IAAI,QAAQ,EAAE,CAAA;AACnC,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC,GAAG;IAAE,KAAK,EAAE,YAAY,EAAE,CAAA;CAAE,CAAA"}
@@ -1,4 +0,0 @@
1
- export { StepContainer } from './StepContainer.js';
2
- export { TourProvider, defaultTourConfig, useTour } from './context.js';
3
- export { hasFinishedTourStep, isNewTourStep, tourStepBuilder } from './utils.js';
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Tour/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACpE,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA"}
@@ -1,51 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { ReactourStep } from 'reactour';
3
- import { NavigationProps } from './StepNavigation.js';
4
- /**
5
- * Tutorial: marks the tour step as finished. This sets a cookie, preventing the tour from showing again.
6
- * @param key the identifier for the step to mark as finished.
7
- */
8
- export declare const finishTourStep: (key: string) => void;
9
- /**
10
- * Tutorial: verifies if the React Tour step has not finished yet.
11
- *
12
- * A step has not finished if the array stored as a cookie doesn't include the string value of `step.selector`.
13
- * @param step the step config.
14
- * @returns true if the step has not yet been marked as finished. False otherwise.
15
- */
16
- export declare const isNewTourStep: (step: ReactourStep) => boolean;
17
- /**
18
- * Tutorial: verifies if the key passed as parameter refers to a React Tour step that has already finished.
19
- *
20
- * The key refers to a finished step if the array stored as a cookie includes it.
21
- * If the cookie is set to 'disabled', then the step will be considered finished.Particularly useful in scenarios like e2e tests.
22
- * @param key the step's identifier to check.
23
- * @returns true if the key refers to a finished step. False otherwise.
24
- */
25
- export declare const hasFinishedTourStep: (key: string) => boolean;
26
- interface StackspotTourStep extends ReactourStep {
27
- /**
28
- * The step's title.
29
- */
30
- title: string;
31
- /**
32
- * The unique identifier for the step (key).
33
- */
34
- selector: string;
35
- /**
36
- * The step's content.
37
- */
38
- content: ReactNode;
39
- /**
40
- * A set of properties for customizing the next and previous buttons.
41
- */
42
- customNavigation?: NavigationProps;
43
- }
44
- /**
45
- * Tutorial: utility for building a React Tour step. This already includes some default configuration for tours in Stackspot.
46
- * @param options the options for building the step: {@link StackspotTourStep}.
47
- * @returns the React Tour step.
48
- */
49
- export declare const tourStepBuilder: ({ selector, position, title, content, style, customNavigation, ...rest }: StackspotTourStep) => ReactourStep;
50
- export {};
51
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Tour/utils.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAGvC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAYlD;;;GAGG;AACH,eAAO,MAAM,cAAc,QAAS,MAAM,SAIzC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,SAAU,YAAY,YAA6C,CAAA;AAE7F;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,QAAS,MAAM,YAG9C,CAAA;AAED,UAAU,iBAAkB,SAAQ,YAAY;IAC9C;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;OAEG;IACH,gBAAgB,CAAC,EAAE,eAAe,CAAC;CACpC;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,6EAQzB,iBAAiB,KAAG,YAkBrB,CAAA"}
@@ -1,60 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { theme } from '@stack-spot/portal-theme';
3
- import { getCookie, setCookie } from '../../utils/cookie.js';
4
- import { StepContainer } from './StepContainer.js';
5
- const TOUR_COOKIE = 'guided-tour-global';
6
- const defaultExpires = new Date();
7
- defaultExpires.setFullYear(new Date().getFullYear() + 1);
8
- const getTourCookie = () => {
9
- const currentTourObject = getCookie(TOUR_COOKIE);
10
- return currentTourObject ? currentTourObject.split(',') : [];
11
- };
12
- /**
13
- * Tutorial: marks the tour step as finished. This sets a cookie, preventing the tour from showing again.
14
- * @param key the identifier for the step to mark as finished.
15
- */
16
- export const finishTourStep = (key) => {
17
- const finishedTours = getTourCookie();
18
- if (!finishedTours.includes(key))
19
- finishedTours.push(key);
20
- setCookie(TOUR_COOKIE, finishedTours.toString(), { expires: defaultExpires.toUTCString() });
21
- };
22
- /**
23
- * Tutorial: verifies if the React Tour step has not finished yet.
24
- *
25
- * A step has not finished if the array stored as a cookie doesn't include the string value of `step.selector`.
26
- * @param step the step config.
27
- * @returns true if the step has not yet been marked as finished. False otherwise.
28
- */
29
- export const isNewTourStep = (step) => !hasFinishedTourStep(`${step.selector}`);
30
- /**
31
- * Tutorial: verifies if the key passed as parameter refers to a React Tour step that has already finished.
32
- *
33
- * The key refers to a finished step if the array stored as a cookie includes it.
34
- * If the cookie is set to 'disabled', then the step will be considered finished.Particularly useful in scenarios like e2e tests.
35
- * @param key the step's identifier to check.
36
- * @returns true if the key refers to a finished step. False otherwise.
37
- */
38
- export const hasFinishedTourStep = (key) => {
39
- const tourCookie = getTourCookie();
40
- return tourCookie.includes(key) || tourCookie[0] === 'disabled';
41
- };
42
- /**
43
- * Tutorial: utility for building a React Tour step. This already includes some default configuration for tours in Stackspot.
44
- * @param options the options for building the step: {@link StackspotTourStep}.
45
- * @returns the React Tour step.
46
- */
47
- export const tourStepBuilder = ({ selector, position, title, content, style, customNavigation, ...rest }) => ({
48
- selector,
49
- content: (_jsx(StepContainer, { stepKey: selector, position: position, title: title, customNavigation: customNavigation, children: content })),
50
- position,
51
- style: {
52
- backgroundColor: theme.color.inverse[500],
53
- width: '256px',
54
- padding: 0,
55
- top: ['right', 'left'].includes(position) ? '-3px' : '0',
56
- ...(style || {}),
57
- },
58
- ...(rest || {}),
59
- });
60
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/Tour/utils.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAGhD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,EAAyB,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAGtE,MAAM,WAAW,GAAG,oBAAoB,CAAA;AAExC,MAAM,cAAc,GAAG,IAAI,IAAI,EAAE,CAAA;AACjC,cAAc,CAAC,WAAW,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAA;AAExD,MAAM,aAAa,GAAG,GAAG,EAAE;IACzB,MAAM,iBAAiB,GAAG,SAAS,CAAC,WAAW,CAAC,CAAA;IAChD,OAAO,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAA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AAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QACzC,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,CAAC;QACV,GAAG,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAiC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG;QACjF,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;KACjB;IACD,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;CAChB,CAAC,CAAA"}
@@ -1,83 +0,0 @@
1
- import { theme } from '@stack-spot/portal-theme'
2
- import { ReactNode } from 'react'
3
- import { styled } from 'styled-components'
4
- import { NavigationProps, StepNavigation } from './StepNavigation'
5
- import { StepTitle } from './StepTitle'
6
- import { useTour } from './context'
7
-
8
- interface StepContainerProps {
9
- children: ReactNode,
10
- /**
11
- * The unique identifier for the step.
12
- */
13
- stepKey: string,
14
- /**
15
- * The title for the step.
16
- */
17
- title: string,
18
- /**
19
- * The position of the tour overlay related to the content being explained.
20
- */
21
- position: PointingArrowPosition,
22
- /**
23
- * A customizable set of buttons for navigating the tour steps.
24
- */
25
- customNavigation?: Omit<NavigationProps, 'stepKey'>,
26
- }
27
-
28
- /**
29
- * Tutorial: the overlay component for showing a step on React Tour.
30
- * @param props the react props for the component {@link StepContainerProps}.
31
- */
32
- export const StepContainer = ({ title, stepKey, customNavigation, position, children }: StepContainerProps) => {
33
- const { finishStep } = useTour()
34
- return <BoxWithPointingArrow $position={position}>
35
- <StepTitle title={title} onClose={() => finishStep(stepKey)} />
36
- {children}
37
- <StepNavigation stepKey={stepKey} {...(customNavigation || {})} />
38
- </BoxWithPointingArrow>
39
- }
40
-
41
- export type PointingArrowPosition = 'right' | 'top' | 'left' | 'bottom'
42
-
43
- const BoxWithPointingArrow = styled.div < {
44
- $position: PointingArrowPosition,
45
- $top?: string,
46
- $right?: string,
47
- } > `
48
- position: relative;
49
- width: 100%;
50
- background-color: ${theme.color.inverse[500]};
51
- &::after {
52
- content: '';
53
- position: absolute;
54
- border-width: 10px;
55
- border-style: solid;
56
- border-color: transparent;
57
- margin-top: -5px;
58
- border-right-color: ${theme.color.inverse[500]};
59
- ${({ $position, $top }) => $position === 'right' ?
60
- `
61
- top: ${$top || '16px'};
62
- left: -18px;
63
- ` : ''}
64
- ${({ $position, $right }) => $position === 'top' ?
65
- `
66
- bottom: 96%;
67
- right: ${$right || '16px'};
68
- transform: rotate(90deg);
69
- ` : ''}
70
- ${({ $position, $top }) => $position === 'left' ?
71
- `
72
- top: ${$top || '16px'};
73
- right: -18px;
74
- transform: rotate(180deg);
75
- ` : ''}
76
- ${({ $position, $right }) => $position === 'bottom' ?
77
- `
78
- top: -13px;
79
- right: ${$right || '16px'};
80
- transform: rotate(90deg);
81
- ` : ''}
82
- }
83
- `
@@ -1,72 +0,0 @@
1
- import { Button, Flex, Text } from '@citric/core'
2
- import '@stack-spot/portal-theme/dist/theme.css'
3
- import { useTranslate } from '@stack-spot/portal-translate'
4
- import { useTour } from './context'
5
- import { finishTourStep } from './utils'
6
-
7
- interface CustomNavigationButton {
8
- /**
9
- * The text content to render.
10
- */
11
- text: string,
12
- onClick?: () => void,
13
- }
14
-
15
- export interface NavigationProps {
16
- /**
17
- * The unique identifier of the step.
18
- */
19
- stepKey: string,
20
- /**
21
- * The text and click handler for the button "next".
22
- */
23
- nextButton?: CustomNavigationButton,
24
- /**
25
- * The text and click handler for the button "previous".
26
- */
27
- prevButton?: CustomNavigationButton,
28
- }
29
-
30
- /**
31
- * Tutorial: the component in a React Tour overlay that shows the next and previous buttons (for step navigation).
32
- * @param props the react props for the component {@link NavigationProps}.
33
- */
34
- export const StepNavigation = ({ stepKey, nextButton, prevButton }: NavigationProps) => {
35
- const { currentStep, steps, nextStep, prevStep } = useTour()
36
- const t = useTranslate(translations)
37
-
38
- return <Flex w={12} px={5} py={2} mt="-1px" bg="inverse.500" justifyContent="space-between" alignItems="center">
39
- <Text appearance="microtext1" colorScheme="inverse.contrastText">{currentStep + 1} {t.of} {steps.length}</Text>
40
- <Flex sx={{ gap: '8px' }}>
41
- {currentStep >= 1 &&
42
- <Button sx={{ paddingInline: '20px' }} onClick={() => {
43
- prevStep?.()
44
- prevButton?.onClick?.()
45
- }} size="sm" appearance="text" colorScheme="light">
46
- {prevButton?.text || t.back}
47
- </Button>}
48
- <Button sx={{ paddingInline: '20px' }} onClick={() => {
49
- nextButton?.onClick?.()
50
- nextStep?.()
51
- finishTourStep(stepKey)
52
- }} size="sm" colorScheme="light">
53
- {nextButton?.text || (currentStep < steps.length - 1 ? t.next : t.done)}
54
- </Button>
55
- </Flex>
56
- </Flex>
57
- }
58
-
59
- const translations = {
60
- en: {
61
- of: 'of',
62
- back: 'Back',
63
- next: 'Next',
64
- done: 'Done',
65
- },
66
- pt: {
67
- of: 'de',
68
- back: 'Voltar',
69
- next: 'Próximo',
70
- done: 'Finalizado',
71
- },
72
- }
@@ -1,27 +0,0 @@
1
- import { Button, Flex, IconBox, Text } from '@citric/core'
2
- import { TimesMini } from '@citric/icons'
3
-
4
- interface StepTitleProps {
5
- /**
6
- * The step's title.
7
- */
8
- title: string,
9
- /**
10
- * A function to run once the step is closed.
11
- */
12
- onClose?: () => void,
13
- }
14
-
15
- /**
16
- * Tutorial: the component in a React Tour overlay that renders the title.
17
- * @param props the react props for the component {@link StepTitleProps}.
18
- */
19
- export const StepTitle = ({ title, onClose }: StepTitleProps) =>
20
- <Flex w={12} pl={5} py={3} flexWrap="nowrap" justifyContent="space-between" alignItems="center">
21
- <Text appearance="body2" colorScheme="inverse.contrastText" weight="medium"> {title} </Text>
22
- <Button appearance="text" size="sm" onClick={() => onClose?.()} sx={{ ':hover': { borderColor: 'transparent !important' } }}>
23
- <IconBox size="xs" colorIcon="inverse.contrastText">
24
- <TimesMini />
25
- </IconBox>
26
- </Button>
27
- </Flex>
@@ -1,67 +0,0 @@
1
- import { ReactNode, createContext, useContext, useState } from 'react'
2
- import Tour, { ReactourProps } from 'reactour'
3
- import { finishTourStep } from './utils'
4
-
5
- type TourConfig = Omit<ReactourProps, 'children'>
6
-
7
- /**
8
- * Tutorial: the default configuration for a React Tour.
9
- */
10
- export const defaultTourConfig: TourConfig = Object.freeze({
11
- steps: [],
12
- isOpen: true,
13
- onRequestClose: () => '',
14
- showButtons: false,
15
- showNavigation: false,
16
- showNavigationNumber: false,
17
- showNumber: false,
18
- showCloseButton: false,
19
- disableFocusLock: true,
20
- })
21
-
22
- const TourContext = createContext<{ tourConfig: TourConfig, currentStep: number }>({
23
- tourConfig: defaultTourConfig,
24
- currentStep: 0,
25
- })
26
-
27
- /**
28
- * Tutorial: provides the configuration for React Tour.
29
- * @param props the configuration for the tour and the content to render.
30
- */
31
- export const TourProvider = ({ config, children }: { config: TourConfig, children: ReactNode }) => {
32
- const [currentStep, setCurrentStep] = useState<number>(0)
33
- const tourConfig: TourConfig = {
34
- ...config,
35
- goToStep: currentStep,
36
- update: `${currentStep}`,
37
- nextStep: () => setCurrentStep(currentStep + 1),
38
- prevStep: () => setCurrentStep(currentStep - 1),
39
- isOpen: !!config.steps.length && (currentStep < config.steps.length),
40
- }
41
-
42
- return <TourContext.Provider value={{
43
- currentStep,
44
- tourConfig,
45
- }}>
46
- <Tour {...tourConfig} />
47
- {children}
48
- </TourContext.Provider>
49
- }
50
-
51
- /**
52
- * Tutorial: retrieves data related to the current step of React Tour.
53
- * @returns an object with all the information related to the steps of React Tour.
54
- */
55
- export const useTour = () => {
56
- const { currentStep, tourConfig: { nextStep, prevStep, steps } } = useContext(TourContext)
57
- return {
58
- currentStep,
59
- nextStep,
60
- prevStep,
61
- steps,
62
- finishStep: (stepKey: string) => {
63
- finishTourStep(stepKey)
64
- nextStep?.()
65
- },
66
- }
67
- }
@@ -1,7 +0,0 @@
1
- import { ReactourProps, ReactourStep } from 'reactour'
2
-
3
- export { StepContainer } from './StepContainer'
4
- export { TourProvider, defaultTourConfig, useTour } from './context'
5
- export { hasFinishedTourStep, isNewTourStep, tourStepBuilder } from './utils'
6
- export { ReactourStep as TourStep }
7
- export type TourProps = Partial<Omit<ReactourProps, 'children'>> & { steps: ReactourStep[] }
@@ -1,100 +0,0 @@
1
- import { theme } from '@stack-spot/portal-theme'
2
- import { ReactNode } from 'react'
3
- import { ReactourStep } from 'reactour'
4
- import { getCookie, setCookie } from '../../utils/cookie'
5
- import { PointingArrowPosition, StepContainer } from './StepContainer'
6
- import { NavigationProps } from './StepNavigation'
7
-
8
- const TOUR_COOKIE = 'guided-tour-global'
9
-
10
- const defaultExpires = new Date()
11
- defaultExpires.setFullYear(new Date().getFullYear() + 1)
12
-
13
- const getTourCookie = () => {
14
- const currentTourObject = getCookie(TOUR_COOKIE)
15
- return currentTourObject ? currentTourObject.split(',') : []
16
- }
17
-
18
- /**
19
- * Tutorial: marks the tour step as finished. This sets a cookie, preventing the tour from showing again.
20
- * @param key the identifier for the step to mark as finished.
21
- */
22
- export const finishTourStep = (key: string) => {
23
- const finishedTours: string[] = getTourCookie()
24
- if (!finishedTours.includes(key)) finishedTours.push(key)
25
- setCookie(TOUR_COOKIE, finishedTours.toString(), { expires: defaultExpires.toUTCString() })
26
- }
27
-
28
- /**
29
- * Tutorial: verifies if the React Tour step has not finished yet.
30
- *
31
- * A step has not finished if the array stored as a cookie doesn't include the string value of `step.selector`.
32
- * @param step the step config.
33
- * @returns true if the step has not yet been marked as finished. False otherwise.
34
- */
35
- export const isNewTourStep = (step: ReactourStep) => !hasFinishedTourStep(`${step.selector}`)
36
-
37
- /**
38
- * Tutorial: verifies if the key passed as parameter refers to a React Tour step that has already finished.
39
- *
40
- * The key refers to a finished step if the array stored as a cookie includes it.
41
- * If the cookie is set to 'disabled', then the step will be considered finished.Particularly useful in scenarios like e2e tests.
42
- * @param key the step's identifier to check.
43
- * @returns true if the key refers to a finished step. False otherwise.
44
- */
45
- export const hasFinishedTourStep = (key: string) => {
46
- const tourCookie = getTourCookie()
47
- return tourCookie.includes(key) || tourCookie[0] === 'disabled'
48
- }
49
-
50
- interface StackspotTourStep extends ReactourStep {
51
- /**
52
- * The step's title.
53
- */
54
- title: string,
55
- /**
56
- * The unique identifier for the step (key).
57
- */
58
- selector: string,
59
- /**
60
- * The step's content.
61
- */
62
- content: ReactNode,
63
- /**
64
- * A set of properties for customizing the next and previous buttons.
65
- */
66
- customNavigation?: NavigationProps,
67
- }
68
-
69
- /**
70
- * Tutorial: utility for building a React Tour step. This already includes some default configuration for tours in Stackspot.
71
- * @param options the options for building the step: {@link StackspotTourStep}.
72
- * @returns the React Tour step.
73
- */
74
- export const tourStepBuilder = ({
75
- selector,
76
- position,
77
- title,
78
- content,
79
- style,
80
- customNavigation,
81
- ...rest
82
- }: StackspotTourStep): ReactourStep => ({
83
- selector,
84
- content: (<StepContainer
85
- stepKey={selector}
86
- position={position as PointingArrowPosition}
87
- title={title}
88
- customNavigation={customNavigation}>
89
- {content}
90
- </StepContainer>),
91
- position,
92
- style: {
93
- backgroundColor: theme.color.inverse[500],
94
- width: '256px',
95
- padding: 0,
96
- top: ['right', 'left'].includes(position as PointingArrowPosition) ? '-3px' : '0',
97
- ...(style || {}),
98
- },
99
- ...(rest || {}),
100
- })